99 "action" : "" ,
1010 "workflow_job" : {
1111 "id" : 0 ,
12+ "run_id" : 10 ,
1213 "workflow_name" : "CI" ,
14+ "head_branch" : "new-feature-branch" ,
1315 "started_at" : "2023-01-27T14:00:00Z" ,
1416 "conclusion" : None ,
1517 "labels" : [],
1618 "runner_id" : None ,
1719 "runner_name" : None ,
1820 "runner_group_id" : None ,
1921 "runner_group_name" : None ,
22+ "name" : "Build" ,
2023 },
2124 "repository" : {
2225 "name" : "foo" ,
@@ -66,8 +69,9 @@ def test_started_job_not_stored(client, caplog):
6669 assert response .status_code == 200
6770 assert caplog .messages == [
6871 "Job 2 is in_progress but not stored!" ,
69- "action=in_progress repository=foo/foo job_id=2 workflow=CI requestor=testerbot "
70- "runner_name= runner_public=false repository_private=false" ,
72+ "action=in_progress repository=foo/foo branch=new-feature-branch job_id=2 run_id=10 "
73+ "job_name=Build workflow=CI requestor=testerbot runner_name= runner_public=false "
74+ "repository_private=false" ,
7175 ]
7276
7377
@@ -79,7 +83,8 @@ def test_finished_job_not_stored(client, caplog):
7983 assert response .status_code == 200
8084 assert caplog .messages == [
8185 "Job 3 is completed but not stored!" ,
82- "action=completed repository=foo/foo job_id=3 workflow=CI requestor=testerbot time_to_finish=0 conclusion=" ,
86+ "action=completed repository=foo/foo branch=new-feature-branch job_id=3 run_id=10 "
87+ "job_name=Build workflow=CI requestor=testerbot runner_name= time_to_finish=0 conclusion=" ,
8388 ]
8489
8590
@@ -93,7 +98,8 @@ def test_unknown_action(client, caplog):
9398 response = client .post ("/github-webhook" , headers = HEADERS , json = body_failed )
9499 assert response .status_code == 200
95100 assert caplog .messages == [
96- "action=queued repository=foo/foo job_id=4 workflow=CI requestor=testerbot" ,
101+ "action=queued repository=foo/foo branch=new-feature-branch job_id=4 run_id=10 "
102+ "job_name=Build workflow=CI requestor=testerbot" ,
97103 "Unknown action failed, removing from memory" ,
98104 ]
99105
@@ -105,7 +111,8 @@ def test_queued_job(client, caplog):
105111 response = client .post ("/github-webhook" , headers = HEADERS , json = body_queued )
106112 assert response .status_code == 200
107113 assert caplog .messages == [
108- "action=queued repository=foo/foo job_id=1 workflow=CI requestor=testerbot"
114+ "action=queued repository=foo/foo branch=new-feature-branch job_id=1 run_id=10 "
115+ "job_name=Build workflow=CI requestor=testerbot"
109116 ]
110117
111118
@@ -118,7 +125,8 @@ def test_logging_flow(client, caplog):
118125 assert response .status_code == 200
119126 assert (
120127 caplog .messages [0 ]
121- == "action=queued repository=foo/foo job_id=5 workflow=CI requestor=testerbot"
128+ == "action=queued repository=foo/foo branch=new-feature-branch job_id=5 run_id=10 "
129+ "job_name=Build workflow=CI requestor=testerbot"
122130 )
123131
124132 body_started = BODY .copy ()
@@ -128,8 +136,9 @@ def test_logging_flow(client, caplog):
128136 assert response .status_code == 200
129137 assert (
130138 caplog .messages [1 ]
131- == "action=in_progress repository=foo/foo job_id=5 workflow=CI requestor=testerbot "
132- "runner_name= runner_public=false repository_private=false time_to_start=5"
139+ == "action=in_progress repository=foo/foo branch=new-feature-branch job_id=5 run_id=10 "
140+ "job_name=Build workflow=CI requestor=testerbot runner_name= runner_public=false "
141+ "repository_private=false time_to_start=5"
133142 )
134143
135144 body_completed = BODY .copy ()
@@ -140,8 +149,9 @@ def test_logging_flow(client, caplog):
140149 assert response .status_code == 200
141150 assert (
142151 caplog .messages [2 ]
143- == "action=completed repository=foo/foo job_id=5 workflow=CI requestor=testerbot "
144- "time_to_finish=295 conclusion=success"
152+ == "action=completed repository=foo/foo branch=new-feature-branch job_id=5 run_id=10 "
153+ "job_name=Build workflow=CI requestor=testerbot runner_name= time_to_finish=295 "
154+ "conclusion=success"
145155 )
146156
147157
@@ -155,7 +165,8 @@ def test_logging_flow_queued_after_in_progress(client, caplog):
155165 assert response .status_code == 200
156166 assert (
157167 caplog .messages [0 ]
158- == "action=queued repository=foo/foo job_id=6 workflow=CI requestor=testerbot"
168+ == "action=queued repository=foo/foo branch=new-feature-branch job_id=6 run_id=10 "
169+ "job_name=Build workflow=CI requestor=testerbot"
159170 )
160171
161172 body_started = BODY .copy ()
@@ -167,6 +178,7 @@ def test_logging_flow_queued_after_in_progress(client, caplog):
167178 assert caplog .messages [1 ] == "Job 6 was in progress before being queued"
168179 assert (
169180 caplog .messages [2 ]
170- == "action=in_progress repository=foo/foo job_id=6 workflow=CI"
171- " requestor=testerbot runner_name= runner_public=false repository_private=false"
181+ == "action=in_progress repository=foo/foo branch=new-feature-branch job_id=6 run_id=10 "
182+ "job_name=Build workflow=CI requestor=testerbot runner_name= runner_public=false "
183+ "repository_private=false"
172184 )
0 commit comments