Skip to content

Commit ff54f7c

Browse files
committed
Use actual GitHub workflow URL format in test mock workflow run data
1 parent 6c3db6e commit ff54f7c

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

src/bors/handlers/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ mod tests {
182182
- Priority: 10
183183
- Mergeable: yes
184184
- Try build is in progress
185-
- Workflow URL: https://github.com/workflows/Workflow1/1
185+
- Workflow URL: https://github.com/rust-lang/borstest/actions/runs/1
186186
"
187187
);
188188
Ok(())

src/bors/handlers/pr_events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ mod tests {
733733
734734
Auto build cancelled due to push. Cancelled workflows:
735735
736-
- https://github.com/workflows/Workflow1/1
736+
- https://github.com/rust-lang/borstest/actions/runs/1
737737
");
738738
Ok(())
739739
})

src/bors/handlers/review.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ merge_queue_enabled = true
13431343
13441344
Auto build cancelled due to unapproval. Cancelled workflows:
13451345
1346-
- https://github.com/workflows/Workflow1/1
1346+
- https://github.com/rust-lang/borstest/actions/runs/1
13471347
");
13481348
Ok(())
13491349
})

src/bors/handlers/trybuild.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ mod tests {
387387
insta::assert_snapshot!(
388388
tester.get_comment().await?,
389389
@r#"
390-
:sunny: Try build successful ([Workflow1](https://github.com/workflows/Workflow1/1))
390+
:sunny: Try build successful ([Workflow1](https://github.com/rust-lang/borstest/actions/runs/1))
391391
Build commit: merge-0-pr-1 (`merge-0-pr-1`, parent: `main-sha1`)
392392
393393
<!-- homu: {"type":"TryBuildCompleted","merge_sha":"merge-0-pr-1"} -->
@@ -406,7 +406,7 @@ mod tests {
406406
tester.workflow_full_failure(tester.try_branch()).await?;
407407
insta::assert_snapshot!(
408408
tester.get_comment().await?,
409-
@":broken_heart: Test failed ([Workflow1](https://github.com/workflows/Workflow1/1))"
409+
@":broken_heart: Test failed ([Workflow1](https://github.com/rust-lang/borstest/actions/runs/1))"
410410
);
411411
Ok(())
412412
})
@@ -438,7 +438,7 @@ mod tests {
438438
insta::assert_snapshot!(
439439
tester.get_comment().await?,
440440
@r"
441-
:broken_heart: Test failed ([Workflow1](https://github.com/workflows/Workflow1/1)). Failed jobs:
441+
:broken_heart: Test failed ([Workflow1](https://github.com/rust-lang/borstest/actions/runs/1)). Failed jobs:
442442
443443
- `Job 42` ([web logs](https://github.com/job-logs/42), [extended logs](https://triage.rust-lang.org/gha-logs/rust-lang/borstest/42))
444444
- `Job 50` ([web logs](https://github.com/job-logs/50), [extended logs](https://triage.rust-lang.org/gha-logs/rust-lang/borstest/50))
@@ -811,7 +811,7 @@ try-job: Bar
811811
)
812812
.await?;
813813
insta::assert_snapshot!(tester.get_comment().await?, @r#"
814-
:sunny: Try build successful ([Workflow1](https://github.com/workflows/Workflow1/2))
814+
:sunny: Try build successful ([Workflow1](https://github.com/rust-lang/borstest/actions/runs/2))
815815
Build commit: merge-1-pr-1 (`merge-1-pr-1`, parent: `main-sha1`)
816816
817817
<!-- homu: {"type":"TryBuildCompleted","merge_sha":"merge-1-pr-1"} -->
@@ -851,8 +851,8 @@ try-job: Bar
851851
tester.post_comment("@bors try cancel").await?;
852852
insta::assert_snapshot!(tester.get_comment().await?, @r"
853853
Try build cancelled. Cancelled workflows:
854-
- https://github.com/workflows/Workflow1/123
855-
- https://github.com/workflows/Workflow1/124
854+
- https://github.com/rust-lang/borstest/actions/runs/123
855+
- https://github.com/rust-lang/borstest/actions/runs/124
856856
");
857857
Ok(())
858858
})
@@ -921,7 +921,7 @@ try-job: Bar
921921
tester.post_comment("@bors try cancel").await?;
922922
insta::assert_snapshot!(tester.get_comment().await?, @r"
923923
Try build cancelled. Cancelled workflows:
924-
- https://github.com/workflows/Workflow1/3
924+
- https://github.com/rust-lang/borstest/actions/runs/3
925925
");
926926
Ok(())
927927
})

src/bors/handlers/workflow.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ mod tests {
553553
tester.get_comment().await?,
554554
@r#"
555555
:sunny: Try build successful
556-
- [Workflow1](https://github.com/workflows/Workflow1/1) :white_check_mark:
557-
- [Workflow1](https://github.com/workflows/Workflow1/2) :white_check_mark:
556+
- [Workflow1](https://github.com/rust-lang/borstest/actions/runs/1) :white_check_mark:
557+
- [Workflow1](https://github.com/rust-lang/borstest/actions/runs/2) :white_check_mark:
558558
Build commit: merge-0-pr-1 (`merge-0-pr-1`, parent: `main-sha1`)
559559
560560
<!-- homu: {"type":"TryBuildCompleted","merge_sha":"merge-0-pr-1"} -->
@@ -583,8 +583,8 @@ mod tests {
583583
tester.get_comment().await?,
584584
@r#"
585585
:sunny: Try build successful
586-
- [Workflow1](https://github.com/workflows/Workflow1/1) :white_check_mark:
587-
- [Workflow1](https://github.com/workflows/Workflow1/2) :white_check_mark:
586+
- [Workflow1](https://github.com/rust-lang/borstest/actions/runs/1) :white_check_mark:
587+
- [Workflow1](https://github.com/rust-lang/borstest/actions/runs/2) :white_check_mark:
588588
Build commit: merge-0-pr-1 (`merge-0-pr-1`, parent: `main-sha1`)
589589
590590
<!-- homu: {"type":"TryBuildCompleted","merge_sha":"merge-0-pr-1"} -->
@@ -610,7 +610,7 @@ mod tests {
610610
tester.workflow_event(WorkflowEvent::failure(w2)).await?;
611611
insta::assert_snapshot!(
612612
tester.get_comment().await?,
613-
@":broken_heart: Test failed ([Workflow1](https://github.com/workflows/Workflow1/1), [Workflow1](https://github.com/workflows/Workflow1/2))"
613+
@":broken_heart: Test failed ([Workflow1](https://github.com/rust-lang/borstest/actions/runs/1), [Workflow1](https://github.com/rust-lang/borstest/actions/runs/2))"
614614
);
615615
Ok(())
616616
})
@@ -750,7 +750,7 @@ auto_build_failed = ["+foo", "+bar", "-baz"]
750750
}).await?;
751751
insta::assert_snapshot!(
752752
tester.get_comment().await?,
753-
@":broken_heart: Test failed ([Workflow1](https://github.com/workflows/Workflow1/1))"
753+
@":broken_heart: Test failed ([Workflow1](https://github.com/rust-lang/borstest/actions/runs/1))"
754754
);
755755

756756
Ok(())

src/bors/merge_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ mod tests {
465465
insta::assert_snapshot!(
466466
tester.get_comment().await?,
467467
@r"
468-
:sunny: Test successful - [Workflow1](https://github.com/workflows/Workflow1/1)
468+
:sunny: Test successful - [Workflow1](https://github.com/rust-lang/borstest/actions/runs/1)
469469
Approved by: `default-user`
470470
Pushing merge-0-pr-1 to `main`...
471471
"

src/tests/mocks/workflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ impl From<WorkflowEvent> for GitHubWorkflowEventPayload {
113113
let WorkflowEvent { event, workflow } = value;
114114

115115
let url: Url = format!(
116-
"https://github.com/workflows/{}/{}",
117-
workflow.name, workflow.run_id
116+
"https://github.com/{}/actions/runs/{}",
117+
workflow.repository, workflow.run_id
118118
)
119119
.parse()
120120
.unwrap();

0 commit comments

Comments
 (0)