Skip to content

Commit 145ae49

Browse files
committed
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.
1 parent 6b6436b commit 145ae49

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

.config/nextest.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[profile.with-xml.junit]
2+
path = "junit.xml"

.github/workflows/ci.yml

+4-11
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ jobs:
8282

8383
test-fixtures-windows:
8484
runs-on: windows-latest
85-
defaults:
86-
run:
87-
shell: bash # Includes `-o pipefail`.
8885
steps:
8986
- uses: actions/checkout@v4
9087
- uses: dtolnay/rust-toolchain@stable
@@ -96,22 +93,18 @@ jobs:
9693
id: nextest
9794
env:
9895
GIX_TEST_IGNORE_ARCHIVES: 1
99-
run: |
100-
cargo nextest --color=always run --workspace --no-fail-fast |& tee nextest.log
96+
run: cargo nextest --profile=with-xml run --workspace --no-fail-fast
10197
continue-on-error: true
10298
- name: Check how many tests failed
10399
if: steps.nextest.outcome == 'failure'
104100
env:
105-
LC_ALL: C.utf8
106101
# FIXME: Change to 15 after verifying that the last step can fail.
107102
# See https://github.com/GitoxideLabs/gitoxide/issues/1358.
108103
EXPECTED_FAILURE_COUNT: 13
109104
run: |
110-
set -x
111-
sed -Ei 's/\x1B\[[[:digit:];]*m//g' nextest.log # Remove ANSI color codes.
112-
pattern='\n-{10,}\r?\n[ \t]+Summary\b[^\n]+[ \t]\K\d+(?= failed\b)'
113-
count="$(grep -zoP "$pattern" nextest.log)"
114-
((count <= EXPECTED_FAILURE_COUNT))
105+
[xml]$junit = Get-Content -Path 'target/nextest/with-xml/junit.xml'
106+
if ($junit.testsuites.errors -ne 0) { exit 1 }
107+
if ($junit.testsuites.failures -gt $env:EXPECTED_FAILURE_COUNT) { exit 1 }
115108
116109
test-32bit:
117110
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)