Skip to content

Commit

Permalink
ci: update build-script for nextest
Browse files Browse the repository at this point in the history
  • Loading branch information
mhasel committed May 30, 2024
1 parent 406457a commit a52e7ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[profile.ci.junit]
path = "junit.xml"
40 changes: 14 additions & 26 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,37 +147,25 @@ function run_test() {
#Delete the test results if they exist
rm -rf "$project_location/test_results"
make_dir "$project_location/test_results"
# JUnit test should run on nightly
log "cargo +nightly test $CARGO_OPTIONS --lib -- --format=junit \
-Zunstable-options \
| split -l1 - "$project_location"/test_results/unit_tests \
-d --additional-suffix=.xml
"
cargo +nightly test $CARGO_OPTIONS --lib -- --format=junit \
-Zunstable-options \
| split -l1 - "$project_location"/test_results/unit_tests \
-d --additional-suffix=.xml
# JUnit test should run via cargo-nextest
log "cargo-nextest nextest run $CARGO_OPTIONS --lib --profile ci \
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/unit_tests.xml"
cargo-nextest nextest run $CARGO_OPTIONS --lib --profile ci
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/unit_tests.xml

# Run only the integration tests
#https://stackoverflow.com/questions/62447864/how-can-i-run-only-integration-tests
log "cargo +nightly test $CARGO_OPTIONS --test '*' -- --format=junit \
-Zunstable-options \
| split -l1 - "$project_location"/test_results/integration_tests \
-d --additional-suffix=.xml"
cargo +nightly test $CARGO_OPTIONS --test '*' -- --format=junit \
-Zunstable-options \
| split -l1 - "$project_location"/test_results/integration_tests \
-d --additional-suffix=.xml
log "cargo-nextest nextest run $CARGO_OPTIONS --profile ci --test '*' \
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/integration_tests.xml "
cargo-nextest nextest run $CARGO_OPTIONS --profile ci --test '*'
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/integration_tests.xml

# Run the std integration
log "cargo +nightly test $CARGO_OPTIONS -p iec61131std --test '*' -- --format=junit \
-Zunstable-options \
| split -l1 - "$project_location"/test_results/std_integration_tests \
-d --additional-suffix=.xml"
cargo +nightly test $CARGO_OPTIONS -p iec61131std --test '*' -- --format=junit \
-Zunstable-options \
| split -l1 - "$project_location"/test_results/std_integration_tests \
-d --additional-suffix=.xml
log "cargo-nextest nextest run $CARGO_OPTIONS --profile ci -p iec61131std --test '*' \
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/std_integration_tests.xml"
cargo-nextest nextest run $CARGO_OPTIONS --profile ci -p iec61131std --test '*'
mv "$project_location"/target/nextest/ci/junit.xml "$project_location"/test_results/std_integration_tests.xml

else
cargo test $CARGO_OPTIONS --workspace
fi
Expand Down

0 comments on commit a52e7ca

Please sign in to comment.