build(just): test-partition-check, test-windows (the partitioned subset) and test-windows-full (the whole Windows suite by hand)

This commit is contained in:
LGUG2Z committed 2026-11-05 15:51:50 -08:00
1 parent 56afe5b286
commit f05d7fe737
3 files changed
+69 -1

No files matched your search

+20 -1
View File
@@ -39,6 +39,7 @@ workspace of the repository; none of them writes to the source tree.
| `tools/fast-check [--list] [--range \| --since REV]` | only the checks the touched paths need; warm in seconds (Windows clippy 8-9 s, KDE 1-3 s, macOS 2-3 s) |
| `tools/e2e-needed [--since REV]` | does this diff change the Windows e2e binaries (`NO` carries a previous passing e2e over) |
| `tools/kde-closure-check` | the Linux source filter list (`nix/linux/root-crates.json`) matches the Linux cargo closure |
| `tools/test-partition check \| packages CLASS \| expr CLASS` | which package is tested where (`tools/test-partition.json`); `just test-partition-check` also runs its self-test |
| `tools/mac-check.sh` | macOS type-check on Linux (fake C compiler `tools/cc-fake.sh`) |
| `tools/trim-target`, `tools/gate-lock`, `tools/lite-env` | disk trimming, a heavy-gate lock, debug-info-off builds |
@@ -58,7 +59,7 @@ shared by all of them):
```sh
nix build -L --no-link .#checks.x86_64-linux.windows-clippy
nix build -L --no-link .#checks.x86_64-linux.windows-nextest-build # cross-compiles the Windows crates' test executables (48), runs none
nix build -L --no-link .#checks.x86_64-linux.windows-nextest-build # cross-compiles the test executables of the windows and os_sensitive packages (tools/test-partition.json), runs none
nix build -L --no-link .#checks.x86_64-linux.windows-fmt .#checks.x86_64-linux.windows-toml-fmt .#checks.x86_64-linux.windows-deny
nix build -L --no-link .#checks.x86_64-linux.windows-e2e-tests # the Python of the e2e (pytest), no guest needed
```
@@ -211,6 +212,24 @@ the printed line. `docs/dev/bar-e2e.md` describes the `bar` scenario.
A change to the Windows daemon or bar needs these before it is considered landed (commit types BEHAVIOUR):
`commands`, plus the scenario of the cluster named in the revision body (see backend-switch.md for the table).
### The full Windows suite by hand
CI runs, on Windows, only the packages that need Windows: the `windows` and `os_sensitive` classes of
`tools/test-partition.json` (the neutral packages run on Linux and macOS, `crates/komorebi-macos-core` among them). The
whole suite that ran on Windows before the partition is still there, to run by hand:
```sh
just test-windows-full # on a Windows machine, native: cargo test --workspace (less the other platforms' crates) and the recorder
just test-windows # on a Windows machine: only the windows and os_sensitive packages, with nextest (what CI runs)
nix build -L --no-link .#checkSets.windows-test-full # cross-builds the test executables of every Windows crate, runs none
E2E_GOLDEN=golden KOMOREBI_E2E_STATE=state-nextest nix run .#windows-nextest-full -- OUT # the whole suite in the guest
```
`windows-nextest-full` and its build `windows-nextest-full-build` (the set `windows-test-full`) are not in
`defaultCheckSets` of `nix/checks.nix`, so no pull request builds them; `windows-nextest` and `windows-nextest-build`
are the trimmed default. Both derive their package list from the same `tools/test-partition.json`. The recipes of the
justfile that need the partition call `bash tools/test-partition`, so on Windows they want Git for Windows' bash and `jq`.
## 5. What runs where (summary)
| Change touches | Run |
+25
View File
@@ -71,6 +71,31 @@ lint:
nix shell --inputs-from . nixpkgs#actionlint nixpkgs#shellcheck --command actionlint .github/workflows/*.yaml
nix shell --inputs-from . nixpkgs#shellcheck --command shellcheck scripts/linux/wsl2-probe.sh
# tools/test-partition needs bash, cargo and jq
# the classification of the packages by where their tests run matches the workspace, and the checker catches a broken one
[unix]
test-partition-check:
tools/test-partition check
tools/test-partition --self-test
[windows]
test-partition-check:
bash tools/test-partition check
bash tools/test-partition --self-test
# The neutral packages run on Linux and macOS; `just test-windows-full` runs them all too.
# the windows and os_sensitive packages of tools/test-partition.json with nextest, as the Windows CI job does
[windows]
test-windows:
$packages = (bash tools/test-partition packages windows) + ' ' + (bash tools/test-partition packages os_sensitive); cargo nextest run --locked --no-fail-fast @($packages -split ' ')
# The same commands as the test step of .github/workflows/windows.yaml before the partition; run it by hand on Windows.
# every test of the Windows workspace, the neutral packages and the recorder included
[windows]
test-windows-full:
cargo test --workspace --exclude komorebi-recorder --exclude komorebi-linux --exclude komorebi-macos --exclude komorebi-hotkeys --exclude schemars-nixgen
cargo test -p komorebi-recorder
# the KWin bridge of the KDE daemon (JavaScript): its types by tsc, its tests by node against a fake KWin
check-js:
cd crates/komorebi-linux/src/kwin && tsc -p tsconfig.json
+24
View File
@@ -15,6 +15,7 @@ the xwin cross toolchain), so it needs no Windows host. `shellcheck` and `bash -
| `cc-fake.sh` | the fake C compiler `mac-check.sh` and `fast-check` use for `aarch64-apple-darwin` |
| `kde-closure-check` | fails when `nix/linux/root-crates.json` (the Linux source filter) and the Linux cargo closure differ |
| `e2e-needed` | says whether a diff touches anything the Windows e2e binaries are built from |
| `test-partition` | which package is tested where: `check`, `packages CLASS`, `expr CLASS`, `--self-test` (`tools/test-partition.json` is the list) |
| `trim-target` | deletes stale test executables from the persistent target directories |
| `gate-lock` | a host-wide FIFO lock for heavy gates (optional) |
| `lite-env` | source it to build with debug info off (optional) |
@@ -110,3 +111,26 @@ held), `heavy` and `timing` queue FIFO. It cannot stop work that does not use it
`. tools/lite-env` sets `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0`, `CARGO_INCREMENTAL=0` (unless
already set) and `CARGO_BUILD_JOBS=3`: same code and tests, far smaller test binaries and less disk write.
Panic backtraces lose line numbers. Use a separate `CARGO_TARGET_DIR` (the first build is cold). Not for nix builds.
## test-partition
`tools/test-partition.json` classifies every package of the workspace by where its tests run; the CI jobs, the
justfile and the Nix check sets (`nix/windows/flake-module.nix`) read it, so there is one list. Needs bash, cargo and jq.
| class | meaning | where its tests run |
|---|---|---|
| `neutral` | no platform code (no `[target.'cfg(..)'.dependencies]`, no dependency on `komorebi-windows`, `-macos`, `-linux`) | Linux (and macOS) |
| `os_sensitive` | neutral in intent, but touches the OS (sockets, pipes, paths, the registry) | Linux, macOS and Windows |
| `windows`, `linux`, `macos` | the platform's own crates | that platform |
| `mixed` | has tests of several platforms in one package (`komorebi-client`, `komorebi-bar`, `komorebi-recorder`) | each platform's job selects its subset (below) |
| `tool` | dev tools and the e2e guest programs | their own checks |
| `none` | no tests | nowhere |
`tools/test-partition check` fails when a member is in no class or in two, when a name is not a member, and when a
`neutral` package is not neutral. `packages CLASS` prints `-p a -p b`; `expr CLASS` prints the nextest filterset
`package(a) | package(b)`. `expr recorder-macos` is the filterset of the recorder tests that run on macOS (the macOS
flavoured modules `sources::oslog`, `av`, `capture::sck`, `platform`, `power`, `system_state`: 36 tests); run it with
`cargo nextest run -p komorebi-recorder -E "$(tools/test-partition expr recorder-macos)"`. `komorebi-bar` has one
Windows-only test and `komorebi-client` Linux-only ones: their jobs name the package with `-p`, the partition says
only that the package is in no platform's default list. `tools/test-partition --self-test` (`just test-partition-check`)
runs `check` on the tree and on deliberately broken copies of the classification.