Skip to content

Commit b3b59d7

Browse files
authored
ci: update build-script for nextest (PLC-lang#1230)
1 parent 38b5b3c commit b3b59d7

File tree

2 files changed

+16
-26
lines changed

2 files changed

+16
-26
lines changed

.config/nextest.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[profile.ci.junit]
2+
path = "junit.xml"

scripts/build.sh

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -147,37 +147,25 @@ function run_test() {
147147
#Delete the test results if they exist
148148
rm -rf "$project_location/test_results"
149149
make_dir "$project_location/test_results"
150-
# JUnit test should run on nightly
151-
log "cargo +nightly test $CARGO_OPTIONS --lib -- --format=junit \
152-
-Zunstable-options \
153-
| split -l1 - "$project_location"/test_results/unit_tests \
154-
-d --additional-suffix=.xml
155-
"
156-
cargo +nightly test $CARGO_OPTIONS --lib -- --format=junit \
157-
-Zunstable-options \
158-
| split -l1 - "$project_location"/test_results/unit_tests \
159-
-d --additional-suffix=.xml
150+
# JUnit test should run via cargo-nextest
151+
log "cargo-nextest nextest run $CARGO_OPTIONS --lib --profile ci \
152+
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/unit_tests.xml"
153+
cargo-nextest nextest run $CARGO_OPTIONS --lib --profile ci
154+
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/unit_tests.xml
160155

161156
# Run only the integration tests
162157
#https://stackoverflow.com/questions/62447864/how-can-i-run-only-integration-tests
163-
log "cargo +nightly test $CARGO_OPTIONS --test '*' -- --format=junit \
164-
-Zunstable-options \
165-
| split -l1 - "$project_location"/test_results/integration_tests \
166-
-d --additional-suffix=.xml"
167-
cargo +nightly test $CARGO_OPTIONS --test '*' -- --format=junit \
168-
-Zunstable-options \
169-
| split -l1 - "$project_location"/test_results/integration_tests \
170-
-d --additional-suffix=.xml
158+
log "cargo-nextest nextest run $CARGO_OPTIONS --profile ci --test '*' \
159+
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/integration_tests.xml "
160+
cargo-nextest nextest run $CARGO_OPTIONS --profile ci --test '*'
161+
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/integration_tests.xml
171162

172163
# Run the std integration
173-
log "cargo +nightly test $CARGO_OPTIONS -p iec61131std --test '*' -- --format=junit \
174-
-Zunstable-options \
175-
| split -l1 - "$project_location"/test_results/std_integration_tests \
176-
-d --additional-suffix=.xml"
177-
cargo +nightly test $CARGO_OPTIONS -p iec61131std --test '*' -- --format=junit \
178-
-Zunstable-options \
179-
| split -l1 - "$project_location"/test_results/std_integration_tests \
180-
-d --additional-suffix=.xml
164+
log "cargo-nextest nextest run $CARGO_OPTIONS --profile ci -p iec61131std --test '*' \
165+
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/std_integration_tests.xml"
166+
cargo-nextest nextest run $CARGO_OPTIONS --profile ci -p iec61131std --test '*'
167+
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/std_integration_tests.xml
168+
181169
else
182170
cargo test $CARGO_OPTIONS --workspace
183171
fi

0 commit comments

Comments
 (0)