Skip to content

Commit 13466d0

Browse files
committed
Auto merge of #11228 - matthiaskrgr:fix_integration_tests2__with_test, r=<try>
test that we correctly detect panics in intergation tests should be merged after #11225 changelog: add test for integration tests
2 parents fc13bf8 + 01b9f9d commit 13466d0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Diff for: .github/workflows/clippy_bors.yml

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ jobs:
217217
- 'rust-itertools/itertools'
218218
- 'rust-lang-nursery/failure'
219219
- 'rust-lang/log'
220+
- 'matthiaskrgr/clippy_ci_panic_test'
220221

221222
runs-on: ubuntu-latest
222223

Diff for: tests/integration.rs

+20
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ 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+
// the repo basically just contains a delay_span_bug that forces rustc/clippy to panic:
78+
/*
79+
#![feature(rustc_attrs)]
80+
#[rustc_error(delay_span_bug_from_inside_query)]
81+
fn main() {}
82+
*/
83+
84+
if stderr.find("error: internal compiler error").is_some() {
85+
eprintln!("we saw that we intentionally panicked, yay");
86+
return;
87+
}
88+
89+
panic!("panic caused by delay_span_bug was NOT detected! Something is broken!");
90+
}
91+
7292
if let Some(backtrace_start) = stderr.find("error: internal compiler error") {
7393
static BACKTRACE_END_MSG: &str = "end of query stack";
7494
let backtrace_end = stderr[backtrace_start..]

0 commit comments

Comments
 (0)