Skip to content

Commit

Permalink
[Cargo] Force the tests to run single-threaded
Browse files Browse the repository at this point in the history
This fixes the issue where some tests could intermittently fail due to multithreaded access of the `config.json` file.
  • Loading branch information
m4heshd committed Apr 29, 2024
1 parent 2b01065 commit 4ab374b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
rustflags = ["-C", "target-feature=+crt-static"]

[alias]
test-backend = 'test -- --test-threads=1'
build-win32 = 'build --profile dist --package ufc-ripper --features=exe_res'
build-linux = 'build --profile dist --package ufc-ripper'
pack-win32 = 'run --release --package pack -- --platform win32'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
toolchain: 1.77.2
# Run tests
- name: Run tests
run: cargo test
run: cargo test-backend
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"dev:backend": "cargo run --color=always --package ufc-ripper",
"dev": "vite",
"test": "npm run build && cargo test",
"test": "npm run build && cargo test-backend",
"build:backend:win32": "npm run build && cargo build-win32",
"build:backend:linux": "npm run build && cargo build-linux",
"build": "vite build",
Expand Down

0 comments on commit 4ab374b

Please sign in to comment.