From c3079a98560efd4bd3995aab898e404e14855ce8 Mon Sep 17 00:00:00 2001 From: Philipp Krones Date: Sat, 17 Jun 2023 10:32:31 +0200 Subject: [PATCH 1/3] Fix integration tests It sees like the `integration` test binary was no longer uploaded. I wonder how it was the successfully "run". First attempt to fix this. Also updates the artifacts actions to v3. --- .github/workflows/clippy_bors.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/clippy_bors.yml b/.github/workflows/clippy_bors.yml index 4eb11a3ac857..5869cd0b1a4a 100644 --- a/.github/workflows/clippy_bors.yml +++ b/.github/workflows/clippy_bors.yml @@ -187,16 +187,14 @@ jobs: - name: Extract Binaries run: | DIR=$CARGO_TARGET_DIR/debug - rm $DIR/deps/integration-*.d - mv $DIR/deps/integration-* $DIR/integration + find $DIR/deps/integration-* -executable ! -type d | xargs -I {} mv {} $DIR/integration find $DIR ! -executable -o -type d ! -path $DIR | xargs rm -rf - rm -rf $CARGO_TARGET_DIR/release - name: Upload Binaries - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: - name: target - path: target + name: binaries + path: target/debug integration: needs: integration_build @@ -206,16 +204,13 @@ jobs: matrix: integration: - 'rust-lang/cargo' - # FIXME: re-enable once fmt_macros is renamed in RLS - # - 'rust-lang/rls' - 'rust-lang/chalk' - 'rust-lang/rustfmt' - 'Marwes/combine' - 'Geal/nom' - 'rust-lang/stdarch' - 'serde-rs/serde' - # FIXME: chrono currently cannot be compiled with `--all-targets` - # - 'chronotope/chrono' + - 'chronotope/chrono' - 'hyperium/hyper' - 'rust-random/rand' - 'rust-lang/futures-rs' @@ -239,10 +234,10 @@ jobs: # Download - name: Download target dir - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v3 with: - name: target - path: target + name: binaries + path: target/debug - name: Make Binaries Executable run: chmod +x $CARGO_TARGET_DIR/debug/* From 12b63f5c35532ea265d7ac9198c9668f5e640668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 25 Jul 2023 19:19:59 +0200 Subject: [PATCH 2/3] ci: integration tests: print clippy run output and set LD_LIBRARY_PATH to rustc sysroot --- .github/workflows/clippy_bors.yml | 7 ++++++- tests/integration.rs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clippy_bors.yml b/.github/workflows/clippy_bors.yml index 5869cd0b1a4a..a686198f781b 100644 --- a/.github/workflows/clippy_bors.yml +++ b/.github/workflows/clippy_bors.yml @@ -232,6 +232,11 @@ jobs: - name: Install toolchain run: rustup show active-toolchain + - name: Set LD_LIBRARY_PATH + run: | + SYSROOT=$(rustc --print sysroot) + echo "LD_LIBRARY_PATH=${SYSROOT}/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV + # Download - name: Download target dir uses: actions/download-artifact@v3 @@ -246,7 +251,7 @@ jobs: - name: Test ${{ matrix.integration }} run: | RUSTUP_TOOLCHAIN="$(rustup show active-toolchain | grep -o -E "nightly-[0-9]{4}-[0-9]{2}-[0-9]{2}")" \ - $CARGO_TARGET_DIR/debug/integration + $CARGO_TARGET_DIR/debug/integration --show-output env: INTEGRATION: ${{ matrix.integration }} diff --git a/tests/integration.rs b/tests/integration.rs index a771d8b87c81..e72891c44c2e 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -65,6 +65,10 @@ fn integration_test() { .expect("unable to run clippy"); let stderr = String::from_utf8_lossy(&output.stderr); + + // debug: + eprintln!("{stderr}"); + if let Some(backtrace_start) = stderr.find("error: internal compiler error") { static BACKTRACE_END_MSG: &str = "end of query stack"; let backtrace_end = stderr[backtrace_start..] From 4b982cc2226969d9bf1ec9b2f1bf0bd7927743a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 25 Jul 2023 20:34:18 +0200 Subject: [PATCH 3/3] ci: test that we fail CI if we don't find clippy panicking --- .github/workflows/clippy_bors.yml | 2 ++ tests/integration.rs | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/clippy_bors.yml b/.github/workflows/clippy_bors.yml index a686198f781b..60a894e4747f 100644 --- a/.github/workflows/clippy_bors.yml +++ b/.github/workflows/clippy_bors.yml @@ -217,6 +217,8 @@ jobs: - 'rust-itertools/itertools' - 'rust-lang-nursery/failure' - 'rust-lang/log' + - 'matthiaskrgr/clippy_ci_panic_test' + runs-on: ubuntu-latest diff --git a/tests/integration.rs b/tests/integration.rs index e72891c44c2e..4c53f806bc57 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -69,6 +69,18 @@ fn integration_test() { // debug: eprintln!("{stderr}"); + // this is an internal test to make sure we would correctly panic on a delay_span_bug + if repo_name == "matthiaskrgr/clippy_ci_panic_test" { + // we need to kind of switch around our logic here: + // if we find a panic, everything is fine, if we don't panic, SOMETHING is broken about our testing + + if let Some(backtrace_start) = stderr.find("error: internal compiler error") { + eprintln!("we saw that we intentionally panicked, yay") + } else { + panic!("panic caused by delay_span_bug was NOT detected! Something is broken!") + } + } + if let Some(backtrace_start) = stderr.find("error: internal compiler error") { static BACKTRACE_END_MSG: &str = "end of query stack"; let backtrace_end = stderr[backtrace_start..]