refactor(config): parallelize test suite, serialize only stateful autostart tests#61
Merged
Merged
Conversation
…ostart tests Add `serial_test` as a dev-dependency and annotate the three `AutoStartManager` tests in `src/config/autostart.rs` with `#[serial(autostart)]`. Those tests touch OS-level auto-launch state (macOS LaunchAgents, Linux .desktop entries, Windows registry) and can race when run in parallel. All other tests are already isolated via per-test `tempfile` directories or are pure logic, so `--test-threads=1` is no longer needed in `scripts/precheck.sh`. Local precheck now runs 411 tests in ~0.67s instead of serialising the whole suite. Refs #60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/precheck.shused to force the entire test suite through--test-threads=1, even though only a handful of tests actually share OS-level global state. This PR addsserial_testas a dev-dependency, annotates only the genuinely statefulAutoStartManagertests with#[serial(autostart)], and drops--test-threads=1so the rest of the suite runs in parallel.Linked Issue
Closes #60
Changes
serial_test = "3.2.0"to[dev-dependencies].AutoStartManagertests (test_autostart_manager_creation,test_get_app_path,test_sync_state) with#[serial(autostart)]; they touch OS-level auto-launch state (macOS LaunchAgents, Linux.desktop, Windows registry) and must not race.cargo test -- --test-threads=1withcargo test.No other tests needed serialisation: repository/clipboard/updater/app tests already isolate via per-test
tempfiledirs, and no test touches process-global env vars or registers a global hotkey.Testing
scripts/precheck.shpasses locally (411 tests, ~0.67s on theteststep, vs. previously serial).cargo check --all-targets --all-features/cargo clippy --all-targets --all-features -- -D warningsclean.