diff --git a/tests/python/unittest/test_ci.py b/tests/python/unittest/test_ci.py index f5183d79b768b..4e0690cf09337 100644 --- a/tests/python/unittest/test_ci.py +++ b/tests/python/unittest/test_ci.py @@ -206,11 +206,20 @@ def run(pr, check): assert check in proc.stdout + def all_time_keys(time): + return { + "updatedAt": time, + "lastEditedAt": time, + "createdAt": time, + "publishedAt": time, + } + run( { "isDraft": True, + "number": 2, }, - "Checking 0 PRs", + "Checking 0 of 1 fetched", ) run( @@ -218,7 +227,7 @@ def run(pr, check): "isDraft": False, "number": 2, }, - "Checking 0 PRs", + "Checking 0 of 1 fetched", ) run( @@ -229,7 +238,7 @@ def run(pr, check): "isDraft": False, "author": {"login": "user"}, "reviews": {"nodes": []}, - "publishedAt": "2022-01-18T17:54:19Z", + **all_time_keys("2022-01-18T17:54:19Z"), "comments": {"nodes": []}, }, "Pinging reviewers ['someone'] on https://github.com/apache/tvm/pull/123", @@ -244,14 +253,14 @@ def run(pr, check): "isDraft": False, "author": {"login": "user2"}, "reviews": {"nodes": []}, - "publishedAt": "2022-01-18T17:54:19Z", + **all_time_keys("2022-01-18T17:54:19Z"), "comments": { "nodes": [ - {"updatedAt": "2022-01-19T17:54:19Z", "bodyText": "abc"}, + {**all_time_keys("2022-01-19T17:54:19Z"), "bodyText": "abc"}, ] }, }, - "Checking 0 PRs", + "Checking 0 of 1 fetched", ) # Old comment, ping @@ -263,10 +272,13 @@ def run(pr, check): "isDraft": False, "author": {"login": "user"}, "reviews": {"nodes": []}, - "publishedAt": "2022-01-18T17:54:19Z", + **all_time_keys("2022-01-18T17:54:19Z"), "comments": { "nodes": [ - {"updatedAt": "2022-01-19T17:54:19Z", "bodyText": "abc"}, + { + **all_time_keys("2022-01-18T17:54:19Z"), + "bodyText": "abc", + }, ] }, }, @@ -282,10 +294,10 @@ def run(pr, check): "isDraft": False, "author": {"login": "user"}, "reviews": {"nodes": []}, - "publishedAt": "2022-01-18T17:54:19Z", + **all_time_keys("2022-01-18T17:54:19Z"), "comments": { "nodes": [ - {"updatedAt": "2022-01-27T17:54:19Z", "bodyText": "abc"}, + {**all_time_keys("2022-01-27T17:54:19Z"), "bodyText": "abc"}, ] }, },