Skip to content

Commit 4b982cc

Browse files
committed
ci: test that we fail CI if we don't find clippy panicking
1 parent 12b63f5 commit 4b982cc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/clippy_bors.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ jobs:
217217
- 'rust-itertools/itertools'
218218
- 'rust-lang-nursery/failure'
219219
- 'rust-lang/log'
220+
- 'matthiaskrgr/clippy_ci_panic_test'
221+
220222

221223
runs-on: ubuntu-latest
222224

tests/integration.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ fn integration_test() {
6969
// debug:
7070
eprintln!("{stderr}");
7171

72+
// this is an internal test to make sure we would correctly panic on a delay_span_bug
73+
if repo_name == "matthiaskrgr/clippy_ci_panic_test" {
74+
// we need to kind of switch around our logic here:
75+
// if we find a panic, everything is fine, if we don't panic, SOMETHING is broken about our testing
76+
77+
if let Some(backtrace_start) = stderr.find("error: internal compiler error") {
78+
eprintln!("we saw that we intentionally panicked, yay")
79+
} else {
80+
panic!("panic caused by delay_span_bug was NOT detected! Something is broken!")
81+
}
82+
}
83+
7284
if let Some(backtrace_start) = stderr.find("error: internal compiler error") {
7385
static BACKTRACE_END_MSG: &str = "end of query stack";
7486
let backtrace_end = stderr[backtrace_start..]

0 commit comments

Comments
 (0)