Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit 1b47bfb

Browse files
committed
Fix tests
1 parent 29bea21 commit 1b47bfb

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010

1111
runs-on: ubuntu-latest
1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
python-version: ["3.10", "3.11"]
1516

tests/tests.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,22 @@
1111
"id": 0,
1212
"workflow_name": "CI",
1313
"started_at": "2023-01-27T14:00:00Z",
14+
"conclusion": None,
15+
"labels": [],
16+
"runner_id": None,
17+
"runner_name": None,
18+
"runner_group_id": None,
19+
"runner_group_name": None,
1420
},
1521
"repository": {
22+
"name": "foo",
1623
"full_name": "foo/foo",
24+
"private": False,
25+
},
26+
"sender": {
27+
"login": "testerbot",
28+
"id": 1,
29+
"type": "User",
1730
},
1831
}
1932

@@ -53,7 +66,8 @@ def test_started_job_not_stored(client, caplog):
5366
assert response.status_code == 200
5467
assert caplog.messages == [
5568
"Job 2 is in_progress but not stored!",
56-
'action=in_progress repository=foo/foo job_id=2 workflow="CI" time_to_start=0',
69+
'action=in_progress repository=foo/foo job_id=2 workflow=CI requestor=testerbot time_to_start=0 '
70+
'runner_name= runner_public=false repository_private=false',
5771
]
5872

5973

@@ -65,7 +79,7 @@ def test_finished_job_not_stored(client, caplog):
6579
assert response.status_code == 200
6680
assert caplog.messages == [
6781
"Job 3 is completed but not stored!",
68-
'action=completed repository=foo/foo job_id=3 workflow="CI" time_to_finish=0',
82+
'action=completed repository=foo/foo job_id=3 workflow=CI requestor=testerbot time_to_finish=0 conclusion=',
6983
]
7084

7185

@@ -79,7 +93,7 @@ def test_unknown_action(client, caplog):
7993
response = client.post("/github-webhook", headers=HEADERS, json=body_failed)
8094
assert response.status_code == 200
8195
assert caplog.messages == [
82-
'action=queued repository=foo/foo job_id=4 workflow="CI"',
96+
'action=queued repository=foo/foo job_id=4 workflow=CI requestor=testerbot',
8397
"Unknown action failed, removing from memory",
8498
]
8599

@@ -91,7 +105,7 @@ def test_queued_job(client, caplog):
91105
response = client.post("/github-webhook", headers=HEADERS, json=body_queued)
92106
assert response.status_code == 200
93107
assert caplog.messages == [
94-
'action=queued repository=foo/foo job_id=1 workflow="CI"'
108+
'action=queued repository=foo/foo job_id=1 workflow=CI requestor=testerbot'
95109
]
96110

97111

@@ -103,7 +117,7 @@ def test_logging_flow(client, caplog):
103117
response = client.post("/github-webhook", headers=HEADERS, json=body_queued)
104118
assert response.status_code == 200
105119
assert (
106-
caplog.messages[0] == 'action=queued repository=foo/foo job_id=5 workflow="CI"'
120+
caplog.messages[0] == 'action=queued repository=foo/foo job_id=5 workflow=CI requestor=testerbot'
107121
)
108122

109123
body_started = BODY.copy()
@@ -113,15 +127,19 @@ def test_logging_flow(client, caplog):
113127
assert response.status_code == 200
114128
assert (
115129
caplog.messages[1]
116-
== 'action=in_progress repository=foo/foo job_id=5 workflow="CI" time_to_start=5'
130+
== 'action=in_progress repository=foo/foo job_id=5 workflow=CI requestor=testerbot time_to_start=5 '
131+
'runner_name= runner_public=false repository_private=false'
132+
117133
)
118134

119135
body_completed = BODY.copy()
120136
body_completed["action"] = "completed"
137+
body_completed["workflow_job"]["conclusion"] = "success"
121138
body_completed["workflow_job"]["completed_at"] = "2023-01-27T14:05:00Z"
122139
response = client.post("/github-webhook", headers=HEADERS, json=body_completed)
123140
assert response.status_code == 200
124141
assert (
125142
caplog.messages[2]
126-
== 'action=completed repository=foo/foo job_id=5 workflow="CI" time_to_finish=295'
143+
== 'action=completed repository=foo/foo job_id=5 workflow=CI requestor=testerbot '
144+
'time_to_finish=295 conclusion=success'
127145
)

0 commit comments

Comments
 (0)