Skip to content

Commit 810d74e

Browse files
committed
test(actions): cover workflow rerun variants
1 parent e0ce530 commit 810d74e

11 files changed

Lines changed: 229 additions & 0 deletions

src/test/java/org/kohsuke/github/GHWorkflowRunTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,24 @@ public void testManualRunAndBasicInformation() throws IOException {
648648
assertThat(workflowRun.getTriggeringActor(), hasProperty("login", equalTo("octocat_trigger")));
649649
}
650650

651+
/**
652+
* Test rerun variants.
653+
*
654+
* @throws IOException
655+
* Signals that an I/O exception has occurred.
656+
*/
657+
@Test
658+
public void testRerunVariants() throws IOException {
659+
GHWorkflowRun workflowRun = repo.getWorkflowRun(686036126L);
660+
661+
assertThat(workflowRun.getId(), is(686036126L));
662+
663+
workflowRun.rerunFailedJobs();
664+
workflowRun.rerunFailedJobs(true);
665+
workflowRun.rerun(true);
666+
workflowRun.rerun();
667+
}
668+
651669
/**
652670
* Test search on branch.
653671
*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"login": "ayagmar"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": 348674220,
3+
"name": "GHWorkflowRunTest",
4+
"full_name": "hub4j-test-org/GHWorkflowRunTest",
5+
"url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest",
6+
"owner": {
7+
"login": "hub4j-test-org"
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": 686036126,
3+
"name": "Slow workflow",
4+
"url": "https://api.github.com/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126",
5+
"html_url": "https://github.com/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126",
6+
"status": "completed",
7+
"conclusion": "failure",
8+
"workflow_id": 6820849,
9+
"run_attempt": 1
10+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "3e7dbf87-7930-4d75-aa8d-d65b76de98dc",
3+
"name": "user",
4+
"request": {
5+
"url": "/user",
6+
"method": "GET",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github+json"
10+
}
11+
}
12+
},
13+
"response": {
14+
"status": 200,
15+
"bodyFileName": "1-user.json",
16+
"headers": {
17+
"Content-Type": "application/json; charset=utf-8"
18+
}
19+
},
20+
"uuid": "3e7dbf87-7930-4d75-aa8d-d65b76de98dc",
21+
"persistent": true,
22+
"insertionIndex": 1
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "fd7591c0-77eb-4e52-9b4b-0dc73777a5a0",
3+
"name": "repos_hub4j-test-org_ghworkflowruntest",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/GHWorkflowRunTest",
6+
"method": "GET",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github+json"
10+
}
11+
}
12+
},
13+
"response": {
14+
"status": 200,
15+
"bodyFileName": "2-r_h_ghworkflowruntest.json",
16+
"headers": {
17+
"Content-Type": "application/json; charset=utf-8"
18+
}
19+
},
20+
"uuid": "fd7591c0-77eb-4e52-9b4b-0dc73777a5a0",
21+
"persistent": true,
22+
"insertionIndex": 2
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "77e5d70a-1cf7-44bf-b170-c458d7060d65",
3+
"name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126",
6+
"method": "GET",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github+json"
10+
}
11+
}
12+
},
13+
"response": {
14+
"status": 200,
15+
"bodyFileName": "3-r_h_g_actions_runs_686036126.json",
16+
"headers": {
17+
"Content-Type": "application/json; charset=utf-8"
18+
}
19+
},
20+
"uuid": "77e5d70a-1cf7-44bf-b170-c458d7060d65",
21+
"persistent": true,
22+
"insertionIndex": 3
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"id": "16330f88-a67e-41e6-b636-58db8d3e8f0c",
3+
"name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_rerun_failed_jobs",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun-failed-jobs",
6+
"method": "POST",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github+json"
10+
}
11+
},
12+
"bodyPatterns": [
13+
{
14+
"equalToJson": "{}",
15+
"ignoreArrayOrder": true,
16+
"ignoreExtraElements": false
17+
}
18+
]
19+
},
20+
"response": {
21+
"status": 201,
22+
"body": "{}",
23+
"headers": {
24+
"Content-Type": "application/json; charset=utf-8"
25+
}
26+
},
27+
"uuid": "16330f88-a67e-41e6-b636-58db8d3e8f0c",
28+
"persistent": true,
29+
"insertionIndex": 4
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"id": "8b165443-a354-489f-8fee-73801637dbfd",
3+
"name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_rerun_failed_jobs_debug",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun-failed-jobs",
6+
"method": "POST",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github+json"
10+
}
11+
},
12+
"bodyPatterns": [
13+
{
14+
"equalToJson": "{\"enable_debug_logging\":true}",
15+
"ignoreArrayOrder": true,
16+
"ignoreExtraElements": false
17+
}
18+
]
19+
},
20+
"response": {
21+
"status": 201,
22+
"body": "{}",
23+
"headers": {
24+
"Content-Type": "application/json; charset=utf-8"
25+
}
26+
},
27+
"uuid": "8b165443-a354-489f-8fee-73801637dbfd",
28+
"persistent": true,
29+
"insertionIndex": 5
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"id": "d5f0000f-e754-447c-84fd-804df2dbed78",
3+
"name": "repos_hub4j-test-org_ghworkflowruntest_actions_runs_686036126_rerun_debug",
4+
"request": {
5+
"url": "/repos/hub4j-test-org/GHWorkflowRunTest/actions/runs/686036126/rerun",
6+
"method": "POST",
7+
"headers": {
8+
"Accept": {
9+
"equalTo": "application/vnd.github+json"
10+
}
11+
},
12+
"bodyPatterns": [
13+
{
14+
"equalToJson": "{\"enable_debug_logging\":true}",
15+
"ignoreArrayOrder": true,
16+
"ignoreExtraElements": false
17+
}
18+
]
19+
},
20+
"response": {
21+
"status": 201,
22+
"body": "{}",
23+
"headers": {
24+
"Content-Type": "application/json; charset=utf-8"
25+
}
26+
},
27+
"uuid": "d5f0000f-e754-447c-84fd-804df2dbed78",
28+
"persistent": true,
29+
"insertionIndex": 6
30+
}

0 commit comments

Comments
 (0)