Skip to content

Commit a4f3fcb

Browse files
committed
Reenable tests reports in CI using junit
1 parent bf2d0c0 commit a4f3fcb

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.config/nextest.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## cargo nextest configuration file
2+
3+
[profile.ci]
4+
# Print out output for failing tests as soon as they fail, and also at the end
5+
# of the run (for easy scrollability).
6+
failure-output = "immediate-final"
7+
# Do not cancel the test run on the first failure.
8+
fail-fast = false
9+
10+
[profile.ci.junit]
11+
path = "tests-result.junit.xml"
12+
report-name = "mithril-tests"

.github/workflows/ci.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,22 @@ jobs:
125125
cargo-tools: cargo-nextest cargo2junit
126126

127127
- name: Build tests
128-
shell: bash
129128
run: cargo nextest run --no-run
130129

131130
- name: Run tests
131+
run: cargo nextest run --profile ci ${{ matrix.test-args }}
132+
133+
- name: Rename junit file to include runner info
132134
shell: bash
133-
run: |
134-
set -o pipefail && \
135-
cargo nextest run --no-fail-fast ${{ matrix.test-args }}
136-
# TODO: Previous command that uses unstable options which are not supported anymore in stable toolchain
137-
#cargo test --no-fail-fast ${{ matrix.test-args }} \
138-
# -- -Z unstable-options --format json --report-time \
139-
# | tee >(cargo2junit > test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml)
135+
run: mv target/nextest/ci/tests-result.junit.xml test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml
140136

141137
- name: Upload Tests Results
142138
uses: actions/upload-artifact@v3
143139
if: success() || failure()
144140
with:
145141
name: test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}
146142
path: |
147-
./**/test-results-*.xml
143+
./test-results-*.xml
148144
149145
check:
150146
runs-on: ubuntu-22.04
@@ -236,9 +232,7 @@ jobs:
236232
if-no-files-found: error
237233

238234
publish-tests-results:
239-
# TODO: reactivate when cargo test errors export to json works in stable version
240-
#if: success() || failure()
241-
if: false
235+
if: success() || failure()
242236
runs-on: ubuntu-22.04
243237
needs:
244238
- test

0 commit comments

Comments
 (0)