Skip to content

Commit

Permalink
fix: create test instance with repoid field set (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-sentry authored Jul 8, 2024
1 parent d1c1caf commit 562a878
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions database/models/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ class TestInstance(CodecovBaseModel, MixinBaseClass):
failure_message = Column(types.Text)
branch = Column(types.Text, nullable=True)
commitid = Column(types.Text, nullable=True)
repoid = Column(types.Integer, nullable=True)

reduced_error_id = Column(
types.Integer, ForeignKey("reports_reducederror.id"), nullable=True
Expand Down
1 change: 1 addition & 0 deletions tasks/test_results_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def _bulk_write_tests_to_db(
commitid=commitid,
branch=branch,
reduced_error_id=None,
repoid=repoid,
)
)

Expand Down
3 changes: 3 additions & 0 deletions tasks/tests/unit/test_test_results_processor_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ def test_upload_processor_task_call_pytest_reportlog(
== "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
)
assert test_instances[0].test.id == tests[0].id
assert test_instances[0].commitid == commit.commitid
assert test_instances[0].branch == commit.branch
assert test_instances[0].repoid == commit.repoid
assert expected_result == result
assert commit.message == "hello world"

Expand Down

0 comments on commit 562a878

Please sign in to comment.