Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We currently have ~140 different test projects, with [the fastest platform taking almost 10 minutes to run the whole UI test suite](https://github.com/LukeMathWalker/pavex/actions/runs/10775293351/job/29887140633). That's not sustainable. This PR significantly restructures `pavex_test_runner`, the custom test harness used to write UI tests for Pavex. The main obstacle is `cargo`'s locking system—each test needs to compile some crates (the generated app, sometimes an integration test) as well as generate some JSON documentation via `rustdoc`. All these activities compete for the lock. This PR rearchitects `pavex_test_runner` to minimise lock contention and maximise core usage. In particular: - All JSON docs are generated upfront, in batch, ensuring that each test hits the SQLite cache rather than invoking `cargo` directly, thus avoid contention; - All UI tests now live in the same (separate) workspace, under `ui_tests`. They share a single target folder and their features are unified via a dedicated workspace hack crate. This ensures that we get full cache re-use across tests. - All compilation jobs (e.g. generated apps or integration tests) are batched to maximise core utilisation The speed-up has been substantial. In CI, we now run UI tests on Linux in [~7m](https://github.com/LukeMathWalker/pavex/actions/runs/11052805801/job/30706076683) compared to the [~11m](https://github.com/LukeMathWalker/pavex/actions/runs/10775293351/job/29887139838) we were seeing on `main`. The difference is even more extreme on Windows: from [16m](https://github.com/LukeMathWalker/pavex/actions/runs/10775293351/job/29887141009) to [9m](https://github.com/LukeMathWalker/pavex/actions/runs/11052805801/job/30706078013). We also scored further wins there, by carving out some particularly slow tests, saving 5 minutes on executing unit tests. Some leftover work to be done in followup PRs: - Fix all warnings in UI test code - Ensure that all `test_config.toml` files are only using valid keys - Enforce programmatically the crate naming structure (`{prefix}_{hash}`) to avoid divergence over time - Add utilities to generate the scaffolding for a new test
- Loading branch information