fix: force single test thread for Rust tests to eliminate race conditions
All checks were successful
Test / frontend-typecheck (pull_request) Successful in 1m9s
Test / frontend-tests (pull_request) Successful in 1m8s
Test / rust-fmt-check (pull_request) Successful in 2m49s
Test / rust-clippy (pull_request) Successful in 19m2s
Test / rust-tests (pull_request) Successful in 20m25s
All checks were successful
Test / frontend-typecheck (pull_request) Successful in 1m9s
Test / frontend-tests (pull_request) Successful in 1m8s
Test / rust-fmt-check (pull_request) Successful in 2m49s
Test / rust-clippy (pull_request) Successful in 19m2s
Test / rust-tests (pull_request) Successful in 20m25s
- Add --test-threads=1 flag to all Rust test commands - Update .gitea/workflows/test.yml to use serial test execution - Update AGENTS.md to reflect the serial test requirement Environment variable modifications in Rust tests cause race conditions when tests run in parallel because std::env is shared global state.
This commit is contained in:
parent
042335f380
commit
c49b8ebfc0
@ -84,7 +84,7 @@ jobs:
|
||||
fi
|
||||
git checkout FETCH_HEAD
|
||||
- run: apt-get update -qq && apt-get install -y -qq libwebkit2gtk-4.1-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf pkg-config perl
|
||||
- run: cargo test --manifest-path src-tauri/Cargo.toml
|
||||
- run: cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1
|
||||
|
||||
frontend-typecheck:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
| Frontend production build | `npm run build` |
|
||||
| Rust fmt check | `cargo fmt --manifest-path src-tauri/Cargo.toml --check` |
|
||||
| Rust clippy | `cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings` |
|
||||
| Rust tests | `cargo test --manifest-path src-tauri/Cargo.toml` |
|
||||
| Rust single test module | `cargo test --manifest-path src-tauri/Cargo.toml pii::detector` |
|
||||
| Rust single test | `cargo test --manifest-path src-tauri/Cargo.toml test_detect_ipv4` |
|
||||
| Rust tests | `cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1` |
|
||||
| Rust single test module | `cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1 pii::detector` |
|
||||
| Rust single test | `cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1 test_detect_ipv4` |
|
||||
| Frontend test (single run) | `npm run test:run` |
|
||||
| Frontend test (watch) | `npm run test` |
|
||||
| Frontend coverage | `npm run test:coverage` |
|
||||
|
||||
Loading…
Reference in New Issue
Block a user