Skip to content

refactor(config): parallelize test suite, serialize only stateful autostart tests#61

Merged
StudentWeis merged 3 commits into
mainfrom
refactor/60-parallelize-tests
Apr 27, 2026
Merged

refactor(config): parallelize test suite, serialize only stateful autostart tests#61
StudentWeis merged 3 commits into
mainfrom
refactor/60-parallelize-tests

Conversation

@StudentWeis
Copy link
Copy Markdown
Owner

Summary

scripts/precheck.sh used 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 adds serial_test as a dev-dependency, annotates only the genuinely stateful AutoStartManager tests with #[serial(autostart)], and drops --test-threads=1 so the rest of the suite runs in parallel.

Linked Issue

Closes #60

Changes

  • Cargo.toml: add serial_test = "3.2.0" to [dev-dependencies].
  • src/config/autostart.rs: annotate the three AutoStartManager tests (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.
  • scripts/precheck.sh: replace cargo test -- --test-threads=1 with cargo test.

No other tests needed serialisation: repository/clipboard/updater/app tests already isolate via per-test tempfile dirs, and no test touches process-global env vars or registers a global hotkey.

Testing

  • scripts/precheck.sh passes locally (411 tests, ~0.67s on the test step, vs. previously serial).
  • cargo check --all-targets --all-features / cargo clippy --all-targets --all-features -- -D warnings clean.
  • No new/changed public behaviour — existing tests cover the change.

…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
@StudentWeis StudentWeis merged commit b4fe3a9 into main Apr 27, 2026
8 checks passed
@StudentWeis StudentWeis deleted the refactor/60-parallelize-tests branch April 27, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(config): parallelize test suite, serialize only stateful autostart tests

1 participant