use nextest for running tests

This commit is contained in:
Oystein Kristoffer Tveit 2024-05-03 16:11:31 +02:00
parent 9754a94192
commit 3a06c8d2df
2 changed files with 6 additions and 22 deletions

View File

@ -59,37 +59,21 @@ jobs:
toolchain: nightly toolchain: nightly
override: true override: true
components: llvm-tools-preview components: llvm-tools-preview
- name: Install nextest
run: cargo binstall -y nextest
- name: Cache dependencies - name: Cache dependencies
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
- name: Create necessary directories
run: mkdir -p target/test-report
- name: Run tests - name: Run tests
run: | run: |
cargo test --all-features --release --no-fail-fast -- -Zunstable-options --format json --report-time \ cargo nextest run --all-features --release --no-fail-fast
| tee target/test-report/test-report.json
env: env:
RUST_LOG: "trace"
RUSTFLAGS: "-Cinstrument-coverage" RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw" LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
- name: Install markdown-test-report
run: cargo binstall -y markdown-test-report
- name: Generate test report
run: markdown-test-report target/test-report/test-report.json --output target/test-report/test-report.md
- name: Upload test report
uses: https://git.pvv.ntnu.no/oysteikt/rsync-action@main
with:
source: target/test-report/test-report.md
target: mpvipc/${{ gitea.ref_name }}/
username: oysteikt
ssh-key: ${{ secrets.OYSTEIKT_GITEA_WEBDOCS_SSH_KEY }}
host: microbel.pvv.ntnu.no
known-hosts: "microbel.pvv.ntnu.no ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEq0yasKP0mH6PI6ypmuzPzMnbHELo9k+YB5yW534aKudKZS65YsHJKQ9vapOtmegrn5MQbCCgrshf+/XwZcjbM="
- name: Install grcov - name: Install grcov
run: cargo binstall -y grcov run: cargo binstall -y grcov

View File

@ -3,7 +3,7 @@ rm -rf target/coverage || true
mkdir -p target/coverage mkdir -p target/coverage
echo "Running tests" echo "Running tests"
RUST_LOG=mpvipc=trace RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="target/coverage/%p-%m.profraw" cargo test --all-features --release --no-fail-fast RUST_LOG=mpvipc=trace RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="target/coverage/%p-%m.profraw" cargo nextest run --all-features --release --no-fail-fast
echo "Generating coverage report" echo "Generating coverage report"
grcov \ grcov \