Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
driazati committed Feb 10, 2022
1 parent bfe75cd commit 1547cec
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions tests/python/unittest/test_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,28 @@ 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(
{
"isDraft": False,
"number": 2,
},
"Checking 0 PRs",
"Checking 0 of 1 fetched",
)

run(
Expand All @@ -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",
Expand All @@ -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
Expand All @@ -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",
},
]
},
},
Expand All @@ -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"},
]
},
},
Expand Down

0 comments on commit 1547cec

Please sign in to comment.