From a52e7ca22ae2a52208c63d9773e26824ee3f2381 Mon Sep 17 00:00:00 2001 From: Michael Haselberger Date: Mon, 27 May 2024 11:29:45 +0200 Subject: [PATCH] ci: update build-script for nextest --- .config/nextest.toml | 2 ++ scripts/build.sh | 40 ++++++++++++++-------------------------- 2 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000000..8e434bbadb --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,2 @@ +[profile.ci.junit] +path = "junit.xml" \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index 8d21a54183..14ece3a910 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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