mirror of
https://github.com/Byron/gitoxide
synced 2025-10-05 16:42:40 +02:00
Use XML nextest output instead of ad-hoc parsing
This eliminates the piping, tricky parsing, and special-casing to preserve colorization, and runs the tests and the XML parsing in the default `pwsh` shell (since this is a Windows job), using PowerShell facilities to parse the XML. This also checks that there are no *errors*, in addition to (still) checking that there are no more *failures* than expected. In the preceding commit, five additional tests, not currently noted in #1358, failed: FAIL [ 0.010s] gix-credentials::credentials program::from_custom_definition::empty FAIL [ 0.008s] gix-credentials::credentials program::from_custom_definition::name FAIL [ 0.010s] gix-credentials::credentials program::from_custom_definition::name_with_args FAIL [ 0.009s] gix-credentials::credentials program::from_custom_definition::name_with_special_args FAIL [ 0.014s] gix-discover::discover upwards::from_dir_with_dot_dot In addition, one test noted in #1358 does not always fail on CI, because it is a performance test and the CI runner is fast enough so that it usually passes: FAIL [ 181.270s] gix-ref-tests::refs packed::iter::performance Let's see if running the tests more similarly to the way they are run on Windows without `GIX_TEST_IGNORE_ARCHIVES`, i.e. without piping and with the Windows default of `pwsh` as the shell, affects any of those new/CI-specific failures.
This commit is contained in:
2
.config/nextest.toml
Normal file
2
.config/nextest.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[profile.with-xml.junit]
|
||||
path = "junit.xml"
|
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@@ -82,9 +82,6 @@ jobs:
|
||||
|
||||
test-fixtures-windows:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash # Includes `-o pipefail`.
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
@@ -96,22 +93,18 @@ jobs:
|
||||
id: nextest
|
||||
env:
|
||||
GIX_TEST_IGNORE_ARCHIVES: 1
|
||||
run: |
|
||||
cargo nextest --color=always run --workspace --no-fail-fast |& tee nextest.log
|
||||
run: cargo nextest --profile=with-xml run --workspace --no-fail-fast
|
||||
continue-on-error: true
|
||||
- name: Check how many tests failed
|
||||
if: steps.nextest.outcome == 'failure'
|
||||
env:
|
||||
LC_ALL: C.utf8
|
||||
# FIXME: Change to 15 after verifying that the last step can fail.
|
||||
# See https://github.com/GitoxideLabs/gitoxide/issues/1358.
|
||||
EXPECTED_FAILURE_COUNT: 13
|
||||
run: |
|
||||
set -x
|
||||
sed -Ei 's/\x1B\[[[:digit:];]*m//g' nextest.log # Remove ANSI color codes.
|
||||
pattern='\n-{10,}\r?\n[ \t]+Summary\b[^\n]+[ \t]\K\d+(?= failed\b)'
|
||||
count="$(grep -zoP "$pattern" nextest.log)"
|
||||
((count <= EXPECTED_FAILURE_COUNT))
|
||||
[xml]$junit = Get-Content -Path 'target/nextest/with-xml/junit.xml'
|
||||
if ($junit.testsuites.errors -ne 0) { exit 1 }
|
||||
if ($junit.testsuites.failures -gt $env:EXPECTED_FAILURE_COUNT) { exit 1 }
|
||||
|
||||
test-32bit:
|
||||
runs-on: ubuntu-latest
|
||||
|
Reference in New Issue
Block a user