From ab91a4cc6d4d8ecb327688c74086c5bd7c543fbf Mon Sep 17 00:00:00 2001 From: Rain Date: Wed, 11 Dec 2024 19:44:45 +0000 Subject: [PATCH] [ci] upload JUnit reports as artifacts Allows for easier inspection. --- .github/workflows/ci.yml | 16 +++++++++++++++- nextest-runner/src/config/scripts.rs | 6 +++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b213b7289f0..65a876d42f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,8 +92,9 @@ jobs: run: cargo test --doc - name: Test with locally built nextest run: cargo local-nt run --profile ci + - name: Upload results - # Run this step even if the test step ahead fails + # Run this step even if the test step fails if: "!cancelled()" uses: trunk-io/analytics-uploader@main with: @@ -104,6 +105,19 @@ jobs: # Provide your Trunk API token as a GitHub secret. token: ${{ secrets.TRUNK_API_TOKEN }} continue-on-error: true + + - name: Upload JUnit report + # Run this step even if the test step fails. Upload it right now because + # we're most interested in the JUnit report generated by the local + # version of nextest, not the latest release. + if: "!cancelled()" + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + with: + name: junit-${{ matrix.os }}-${{ matrix.rust-version }}.xml + path: | + target/nextest/ci/junit.xml + if-no-files-found: error + - name: Test with latest nextest release run: cargo nextest run --profile ci - name: Test without double-spawning diff --git a/nextest-runner/src/config/scripts.rs b/nextest-runner/src/config/scripts.rs index 6dc50cb59fa..499046a4fef 100644 --- a/nextest-runner/src/config/scripts.rs +++ b/nextest-runner/src/config/scripts.rs @@ -539,8 +539,8 @@ impl ScriptConfig { pub struct ScriptJunitConfig { /// Whether to store successful output. /// - /// Defaults to false. - #[serde(default)] + /// Defaults to true. + #[serde(default = "default_true")] pub store_success_output: bool, /// Whether to store failing output. @@ -553,7 +553,7 @@ pub struct ScriptJunitConfig { impl Default for ScriptJunitConfig { fn default() -> Self { Self { - store_success_output: false, + store_success_output: true, store_failure_output: true, } }