Skip to content

Commit

Permalink
tests: Misc fixes to test_ingest_main
Browse files Browse the repository at this point in the history
Fix IDs of sample objects in test_ingest_main(), and make sure all
notifications that should be generated are accounted for.
  • Loading branch information
spbnick committed Dec 8, 2023
1 parent 2a21af8 commit fbd38a1
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions test_kcidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,27 +467,28 @@ def test_ingest_main():
status="PASS")
],
issues=[
dict(id="test:1",
dict(id="test:issue:1",
version=1,
origin="test",
report_url="https://test.com/bug/1",
report_subject="Bug in kernel",
culprit=dict(code=True))
culprit=dict(code=True)),
],
incidents=[
dict(id="test:1",
issue_id="test:1",
dict(id="test:incident:1",
issue_id="test:issue:1",
issue_version=1,
origin="test",
test_id="test:1",
present=True)
]
test_id="test:test:1",
present=True),
],
))
assert_executes(one_of_everything, "kcidb.ingest_main",
stdout_re="Subject: Test revision: .*\x00"
"Subject: Test checkout: .*\x00"
"Subject: Test build: .*\x00"
"Subject: Test test: .*\x00"
"Subject: Test bug: .*\x00"
"Subject: Test issue: .*\x00"
"Subject: Test incident: .*\x00")

Expand Down Expand Up @@ -526,33 +527,33 @@ def test_ingest_main():
status="FAIL"),
],
issues=[
dict(id="test:1",
dict(id="test:issue:1",
version=1,
origin="test",
report_url="https://test.com/bug/1",
report_subject="Bug in kernel",
culprit=dict(code=True)),
dict(id="non_test:1",
dict(id="test:issue:2",
version=1,
origin="non_test",
origin="test",
report_url="https://non-test.com/bug/1",
report_subject="Another bug in kernel",
culprit=dict(tool=True))
],
incidents=[
dict(id="test:1",
issue_id="test:1",
dict(id="test:incident:1",
issue_id="test:issue:1",
issue_version=1,
origin="test",
test_id="test:1",
test_id="test:test:1",
present=True),
dict(id="non_test:1",
issue_id="non_test:1",
dict(id="test:incident:2",
issue_id="test:issue:2",
issue_version=1,
origin="non_test",
test_id="non_test:1",
origin="test",
test_id="test:test:2",
present=True)
]
],
))

assert_executes(two_of_everything,
Expand All @@ -563,5 +564,9 @@ def test_ingest_main():
"Subject: Test checkout: .*\x00"
"Subject: Test build: .*\x00"
"Subject: Test build: .*\x00"
"Subject: Test bug: .*\x00"
"Subject: Test bug: .*\x00"
"Subject: Test issue: .*\x00"
"Subject: Test issue: .*\x00"
"Subject: Test incident: .*\x00"
"Subject: Test incident: .*\x00")

0 comments on commit fbd38a1

Please sign in to comment.