Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

ci: shard the slowest jobs (CUA-3134) (#6368)

cua-agents[bot]e167fc44a4c2
diff --git a/.github/actions/build-cua-under-test/action.yml b/.github/actions/build-cua-under-test/action.yml
index b7aec977fb..cd570fc09e 100644
--- a/.github/actions/build-cua-under-test/action.yml
+++ b/.github/actions/build-cua-under-test/action.yml
@@ -12,6 +12,10 @@ inputs:
description: "Cargo features of the cua CLI (for example contrib)."
default: ""
+ cache-key:
+ description: "Rust cache key. Parallel builds of one component each pass their own so their caches do not collide."
+ default: "cua-under-test"
+
outputs:
cua:
description: "Path of the cua CLI."
@@ -48,7 +52,7 @@ runs:
libs/cua -> target
libs/cua-spacesd -> target
libs/cua-driver/rust -> target
- key: cua-under-test
+ key: ${{ inputs.cache-key }}
- name: Install build dependencies
shell: bash
run: |
diff --git a/.github/actions/fetch-under-test/action.yml b/.github/actions/fetch-under-test/action.yml
new file mode 100644
index 0000000000..10a7d89176
--- /dev/null
+++ b/.github/actions/fetch-under-test/action.yml
@@ -0,0 +1,56 @@
+name: "Fetch the Cua code under test"
+description: >-
+ Download the binaries built by the `build` matrix of the same workflow run
+ (build-cua-under-test, one job per component) and expose them with the same
+ outputs and paths as build-cua-under-test. The checkout must be the same
+ commit the build jobs used.
+
+inputs:
+ components:
+ description: "Space separated: cua, cua-spacesd, cua-driver."
+ default: "cua cua-spacesd cua-driver"
+
+outputs:
+ cua:
+ description: "Path of the cua CLI."
+ value: ${{ steps.paths.outputs.cua }}
+ cua-spacesd:
+ description: "Path of cua-spacesd (release)."
+ value: ${{ steps.paths.outputs.cua-spacesd }}
+ cua-driver:
+ description: "Path of cua-driver (release)."
+ value: ${{ steps.paths.outputs.cua-driver }}
+ git-sha:
+ description: "The source revision the binaries embed."
+ value: ${{ steps.paths.outputs.git-sha }}
+
+runs:
+ using: composite
+ steps:
+ - if: contains(inputs.components, 'cua-spacesd')
+ uses: actions/download-artifact@v4
+ with:
+ name: under-test-cua-spacesd
+ path: libs/cua-spacesd/target/release
+ - if: contains(inputs.components, 'cua-driver')
+ uses: actions/download-artifact@v4
+ with:
+ name: under-test-cua-driver
+ path: libs/cua-driver/rust/target/release
+ - if: contains(format(' {0} ', inputs.components), ' cua ')
+ uses: actions/download-artifact@v4
+ with:
+ name: under-test-cua
+ path: libs/cua/target/debug
+ - id: paths
+ shell: bash
+ run: |
+ set -euo pipefail
+ echo "git-sha=$(git rev-parse HEAD)" >>"$GITHUB_OUTPUT"
+ for f in libs/cua/target/debug/cua libs/cua-spacesd/target/release/cua-spacesd libs/cua-driver/rust/target/release/cua-driver; do
+ if [ -f "$f" ]; then chmod +x "$f"; fi
+ done
+ # Unfetched components resolve to a path that does not exist.
+ echo "cua=$PWD/libs/cua/target/debug/cua" >>"$GITHUB_OUTPUT"
+ echo "cua-spacesd=$PWD/libs/cua-spacesd/target/release/cua-spacesd" >>"$GITHUB_OUTPUT"
+ echo "cua-driver=$PWD/libs/cua-driver/rust/target/release/cua-driver" >>"$GITHUB_OUTPUT"
diff --git a/.github/scripts/tests/test_ci_reuse_pr_result.py b/.github/scripts/tests/test_ci_reuse_pr_result.py
index cf4f319150..66b61eba9a 100644
--- a/.github/scripts/tests/test_ci_reuse_pr_result.py
+++ b/.github/scripts/tests/test_ci_reuse_pr_result.py
@@ -392,7 +392,6 @@ def literals(expr):
MATRIX_JOBS = {
# job id: legs a pull request runs and which of them are in the reused subset
"rust-lint": ["ubuntu-latest", "windows-latest"],
- "rust": ["ubuntu-latest"],
"spaces-e2e": ["ubuntu-latest"],
"bindings": ["ubuntu-latest"],
"python": ["ubuntu-latest"],
@@ -415,6 +414,23 @@ def test_cua_sdk_matrix_on_main_is_the_full_matrix_minus_the_pull_request_legs(j
assert f"{prefix} ({leg})" in subset
+def test_cua_sdk_rust_linux_leg_is_sharded_behind_the_reused_check_name():
+ wf = load("ci-cua-sdk.yml")
+ # The reuse subset names `rust (ubuntu-latest)`: a plain job with that name
+ # reports the result of the sharded Linux jobs.
+ assert wf["jobs"]["rust-linux-result"]["name"] == "rust (ubuntu-latest)"
+ assert wf["jobs"]["rust-linux-result"]["needs"] == ["reuse", "rust-linux"]
+ assert wf["jobs"]["rust-linux"]["strategy"]["matrix"]["shard"] == [1, 2, 3]
+ assert "--partition hash:${{ matrix.shard }}/3" in str(wf["jobs"]["rust-linux"]["steps"])
+ # Both run exactly when the old Linux leg did: never when the subset is reused on a full run.
+ assert wf["jobs"]["rust-linux"]["if"].split("&&", 3)[3] == wf["jobs"]["rust-linux-result"]["if"].split("&&", 3)[3]
+ assert "needs.reuse.outputs.pr_subset == 'true'" in wf["jobs"]["rust-linux"]["if"]
+ # The macOS and Windows legs stay in `rust`, on full runs only.
+ job = wf["jobs"]["rust"]
+ assert literals(job["strategy"]["matrix"]["os"]) == [["macos-26", "windows-latest"]]
+ assert "ci:full" in job["if"]
+
+
def test_cua_sdk_jobs_in_the_subset_skip_only_when_it_is_reused():
wf = load("ci-cua-sdk.yml")
skip = "needs.reuse.outputs.pr_subset != 'true'"
diff --git a/.github/workflows/ci-cua-sandbox-doctor.yml b/.github/workflows/ci-cua-sandbox-doctor.yml
index 494d2faa43..0c6c5c08ef 100644
--- a/.github/workflows/ci-cua-sandbox-doctor.yml
+++ b/.github/workflows/ci-cua-sandbox-doctor.yml
@@ -22,6 +22,7 @@ on:
- "libs/cua/crates/cua-spacesd-client/**"
- ".github/actions/cua-sandbox/**"
- ".github/actions/build-cua-under-test/**"
+ - ".github/actions/fetch-under-test/**"
- ".github/actions/linux-rust-prep/**"
- ".github/workflows/ci-cua-sandbox-doctor.yml"
# Docs and the docs linter run in ci-cua-sandbox-action.yml only.
@@ -41,6 +42,7 @@ on:
- "libs/cua/crates/cua-spacesd-client/**"
- ".github/actions/cua-sandbox/**"
- ".github/actions/build-cua-under-test/**"
+ - ".github/actions/fetch-under-test/**"
- ".github/actions/linux-rust-prep/**"
- ".github/workflows/ci-cua-sandbox-doctor.yml"
# Docs and the docs linter run in ci-cua-sandbox-action.yml only.
@@ -63,15 +65,46 @@ env:
IMAGE: ghcr.io/trycua/linux:24.04
jobs:
+ # The three builds are independent and the slowest ones dominate, so they
+ # run in parallel jobs and the doctor jobs below pick up the binaries.
+ build:
+ if: ${{ !startsWith(github.head_ref, 'release-please--branches--') }}
+ name: build ${{ matrix.component }}
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+ strategy:
+ fail-fast: true
+ matrix:
+ include:
+ - component: cua
+ binary: libs/cua/target/debug/cua
+ - component: cua-spacesd
+ binary: libs/cua-spacesd/target/release/cua-spacesd
+ - component: cua-driver
+ binary: libs/cua-driver/rust/target/release/cua-driver
+ steps:
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+ - uses: ./.github/actions/build-cua-under-test
+ with:
+ components: ${{ matrix.component }}
+ cache-key: cua-under-test-${{ matrix.component }}
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
+ with:
+ name: under-test-${{ matrix.component }}
+ path: ${{ matrix.binary }}
+ if-no-files-found: error
+ retention-days: 1
+
doctor:
if: ${{ !startsWith(github.head_ref, 'release-please--branches--') }}
name: Image doctor (overlaid cua-spacesd and cua-driver)
+ needs: build
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- id: build
- uses: ./.github/actions/build-cua-under-test
+ uses: ./.github/actions/fetch-under-test
- id: sandbox
uses: ./.github/actions/cua-sandbox
with:
@@ -111,12 +144,13 @@ jobs:
stale:
if: ${{ !startsWith(github.head_ref, 'release-please--branches--') }}
name: The bundled builds are reported stale
+ needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- id: build
- uses: ./.github/actions/build-cua-under-test
+ uses: ./.github/actions/fetch-under-test
with:
components: cua
- uses: ./.github/actions/cua-sandbox
diff --git a/.github/workflows/ci-cua-sdk.yml b/.github/workflows/ci-cua-sdk.yml
index 10d8ef60d0..ff5af6877b 100644
--- a/.github/workflows/ci-cua-sdk.yml
+++ b/.github/workflows/ci-cua-sdk.yml
@@ -185,8 +185,136 @@ jobs:
exit 1
fi
+ # The Linux leg of `rust`, in three shards. Each shard builds (one cache
+ # family, saved by shard 1 only) and runs a third of the tests with
+ # cargo-nextest partitions. Doctests (not run by nextest) and the budget
+ # tests that need to run alone stay in cargo test on shards 1 and 2.
+ rust-linux:
+ if: ${{ !cancelled() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && !startsWith(github.head_ref, 'release-please--branches--') && !((github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) && needs.reuse.outputs.pr_subset == 'true') }}
+ name: rust linux shard ${{ matrix.shard }}/3
+ runs-on: ubuntu-latest
+ needs: reuse
+ timeout-minutes: 60
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3]
+ defaults:
+ run:
+ working-directory: libs/cua
+ shell: bash
+ steps:
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+ # Its debug test binaries outgrow the default cleanup's 43 GB.
+ - uses: ./.github/actions/linux-rust-prep
+ with:
+ free-more: "true"
+ - name: Install protoc
+ uses: ./.github/actions/setup-protoc
+ - name: Install pinned Rust toolchain
+ uses: dtolnay/[email protected]
+ with:
+ components: clippy, rustfmt
+ targets: wasm32-unknown-unknown
+ - uses: ./.github/actions/rust-cache
+ with:
+ workspaces: libs/cua
+ shared-key: libs-cua-test
+ save-if: ${{ matrix.shard != 1 && 'false' || '' }}
+ - uses: ./.github/actions/nextest
+ - name: Test Spaces discovery and post-create directory failures
+ if: matrix.shard == 1
+ run: cargo test --locked -p cua-spaces --test relay --test cloud_discovery -- --test-threads=4
+ - name: Test the mesh, and its scale budgets (offline or unresponsive computers never hold up the rest)
+ if: matrix.shard == 1
+ # The scale scenarios run one at a time: each starts 20 nodes and
+ # asserts wall-clock budgets.
+ run: |
+ cargo test --locked -p cua-mesh --lib --test mesh -- --test-threads=4
+ cargo test --locked -p cua-mesh --test scale -- --test-threads=1 --nocapture
+ - name: Test the Space list at scale and under chaos (budgets)
+ if: matrix.shard == 1
+ # 20 computers x 10 Spaces with computers off, slow, lossy, hung or
+ # half-open: each scenario asserts wall-clock budgets, so they run
+ # one at a time.
+ run: cargo test --locked -p cua-spaces --test scale -- --test-threads=1 --nocapture
+ # One retry; a test that passes only on the retry is reported and gets a
+ # `flaky` issue (.github/flaky/). The packages below are split by test
+ # name hash, so a shard runs about a third of every crate's tests.
+ - name: Test (embedded, daemon over UDS and loopback, CLI, cluster, Cua Spaces extensions)
+ run: >-
+ "$GITHUB_WORKSPACE/.github/scripts/flaky/flaky.sh" run --suite "sdk-rust-ubuntu-shard-${{ matrix.shard }}" --format junit
+ --results target/nextest/ci/junit.xml --
+ cargo nextest run --locked --no-fail-fast --config-file "$GITHUB_WORKSPACE/.github/flaky/nextest.toml" --profile ci
+ --partition hash:${{ matrix.shard }}/3
+ -p cua-sdk -p cua-daemon -p cua-cli -p cua-spacesd-client
+ -p cua-cluster -p cua-spaces-cluster
+ -p cua-teleport -p cua-teleport-bundle -p cua-chromium-storage -p cua-volume
+ -p cua-spaces-ext -p cua-spaces-ffi -p cua-spaces-cli --test-threads 4
+ env:
+ # Teleport send acts only on fake hosts in tests; anything that
+ # reaches the real host fails closed.
+ CUA_ENV_TEST_SANDBOX: "1"
+ # Test threads get 8 MiB, like the CLI's runtime: unoptimized
+ # frames are large and the CLI tests drive whole commands.
+ RUST_MIN_STACK: "8388608"
+ - uses: ./.github/actions/flaky-upload
+ if: always()
+ with:
+ suite: sdk-rust-ubuntu-shard-${{ matrix.shard }}
+ - name: Doctests (the packages above)
+ if: matrix.shard == 2
+ run: >
+ cargo test --locked --no-fail-fast --doc -p cua-sdk -p cua-daemon -p cua-cli -p cua-spacesd-client
+ -p cua-cluster -p cua-spaces-cluster
+ -p cua-teleport -p cua-teleport-bundle -p cua-chromium-storage -p cua-volume
+ -p cua-spaces-ext -p cua-spaces-ffi -p cua-spaces-cli
+ env:
+ CUA_ENV_TEST_SANDBOX: "1"
+ RUST_MIN_STACK: "8388608"
+ # The agent harness crate and its runner's own node tests
+ # (runner/test/*.test.mjs through tests/runner_node.rs: durable runs,
+ # journal shipping, the 0.8.0 journal upgrade). Agent onboarding: the
+ # connection-state matrix against fake harness homes, and the telemetry
+ # vocabulary its sign-in import adds to.
+ - name: Test (cua-agent-setup and cua-telemetry)
+ if: matrix.shard == 2
+ run: cargo test --locked --no-fail-fast -p cua-agent-setup -p cua-telemetry -- --test-threads=4
+ - name: Test (cua-agents and its runner)
+ if: matrix.shard == 2
+ run: cargo test --locked --no-fail-fast -p cua-agents -- --test-threads=4
+ - name: Test (shared media crates and clients)
+ if: matrix.shard == 2
+ run: >
+ cargo test --locked --no-fail-fast -p cua-media-protocol -p cua-media-transport -p cua-media-client -p cua-viewer -p cua-logging
+ --features cua-media-client/media-decode,cua-media-transport/quic -- --test-threads=4
+ - name: Test (cua-media-codec)
+ if: matrix.shard == 2
+ run: cargo test --locked --no-fail-fast -p cua-media-codec -- --test-threads=4
+ - name: Disk left after the build
+ if: always()
+ run: df -h / && du -sh target
+
+ # The check that stood for the whole Linux leg before it was sharded
+ # (named in the reuse subset above).
+ rust-linux-result:
+ if: ${{ !cancelled() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && !startsWith(github.head_ref, 'release-please--branches--') && !((github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) && needs.reuse.outputs.pr_subset == 'true') }}
+ name: rust (ubuntu-latest)
+ runs-on: ubuntu-latest
+ needs: [reuse, rust-linux]
+ timeout-minutes: 5
+ steps:
+ - name: All shards passed
+ env:
+ RESULT: ${{ needs.rust-linux.result }}
+ run: |
+ echo "shards: $RESULT"
+ test "$RESULT" = success
+
+ # macOS and Windows legs (full runs only). The Linux leg is sharded: see
+ # rust-linux and the `rust (ubuntu-latest)` job below.
rust:
- if: ${{ !cancelled() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && !startsWith(github.head_ref, 'release-please--branches--') }}
+ if: ${{ !cancelled() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && !startsWith(github.head_ref, 'release-please--branches--') && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) }}
name: rust (${{ matrix.os }})
# The matrix keeps the standard labels (they name the job); the larger
# runners are mapped here.
@@ -197,7 +325,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: ${{ fromJSON((github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:full')) && (needs.reuse.outputs.pr_subset == 'true' && '["macos-26","windows-latest"]' || '["ubuntu-latest","macos-26","windows-latest"]') || '["ubuntu-latest"]') }}
+ os: ${{ fromJSON('["macos-26","windows-latest"]') }}
defaults:
run:
working-directory: libs/cua
diff --git a/.github/workflows/ci-rust-windows.yml b/.github/workflows/ci-rust-windows.yml
index 7cd32639fb..e8f90dbd3d 100644
--- a/.github/workflows/ci-rust-windows.yml
+++ b/.github/workflows/ci-rust-windows.yml
@@ -60,10 +60,16 @@ env:
DO_NOT_TRACK: "1"
jobs:
- unit:
+ # Three shards of the same job. Each builds (the Rust cache key is shared)
+ # and runs a third of the test steps; `unit` below keeps the check name.
+ shard:
if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!startsWith(github.head_ref, 'release-please--branches--')) }}
- name: Rust Windows unit and compile
+ name: Rust Windows shard ${{ matrix.shard }}/3
runs-on: windows-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3]
# The suite below has been running within a hair of this budget for months:
# the last green run on `main` (359fad56) took 28m31s of 30m. The tests this
# branch adds push it past the line, and the failure mode is silent -- every
@@ -96,9 +102,11 @@ jobs:
# tests; interactive behavior belongs in e2e-rust-windows.yml.
run: cargo test -p cua-driver -p cua-driver-e2e -p cua-driver-core -p cua-driver-sdk -p cua-driver-testkit -p cursor-overlay -p cursor-theme-cli -p platform-windows -p cua-driver-uia --all-targets --no-run --locked
- name: Run complete desktop-independent core tests
+ if: matrix.shard == 1
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver-core --lib --test recording_shutdown_errors --locked
- name: Run driver state isolation regressions
+ if: matrix.shard == 2
working-directory: libs/cua-driver/rust
env:
CUA_TEST_REQUIRE_DRIVER_BIN: "1"
@@ -106,6 +114,7 @@ jobs:
cargo test -p cua-driver --test testkit_host_state_isolation_test --locked
if ($LASTEXITCODE -ne 0) { throw "driver state isolation tests failed with exit $LASTEXITCODE" }
- name: Run extension manager security regressions
+ if: matrix.shard == 1
working-directory: libs/cua-driver/rust
run: |
$tests = @(
@@ -126,6 +135,7 @@ jobs:
# Run the whole inline suite so new platform-windows test modules cannot
# be silently left out by a hand-maintained module filter list.
- name: Run platform-windows unit tests
+ if: matrix.shard == 1
working-directory: libs/cua-driver/rust
env:
# The hosted runner's clipboard is disposable; opt in to the native
@@ -133,22 +143,28 @@ jobs:
CUA_TEST_ALLOW_CLIPBOARD: "1"
run: cargo test --locked -p platform-windows --lib
- name: Run MCP proxy lifecycle regressions
+ if: matrix.shard == 1
working-directory: libs/cua-driver/rust
run: "cargo test -p cua-driver --bin cua-driver proxy::tests:: --locked"
- name: Run real MCP proxy recovery regression
+ if: matrix.shard == 1
working-directory: libs/cua-driver/rust
env:
CUA_PROXY_RECOVERY_IDLE_SECONDS: ${{ inputs.proxy_idle_seconds || 1 }}
run: cargo test -p cua-driver --test protocol_proxy_recovery_test --locked -- --nocapture
- name: Test sentinel setup barrier
+ if: matrix.shard == 1
run: node --test libs/cua-driver/tests/fixtures/apps/cross-platform/electron/preload.test.js
- name: Run named-pipe readiness regression
+ if: matrix.shard == 2
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver-testkit stalled_pipe_attempt_is_bounded_and_does_not_block_the_next_probe --lib --locked
- name: Run named-pipe instance recovery and status pid-file regressions
+ if: matrix.shard == 2
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver --test named_pipe_instance_recovery_test --test status_pid_file_cli_test --locked -- --nocapture
- name: Run cross-platform cursor renderer unit tests
+ if: matrix.shard == 2
working-directory: libs/cua-driver/rust
run: |
cargo test -p cursor-overlay --lib --locked
@@ -156,8 +172,10 @@ jobs:
cargo test -p cursor-theme-cli --locked
if ($LASTEXITCODE -ne 0) { throw "cursor theme compiler tests failed with exit $LASTEXITCODE" }
- name: Validate Windows Computer History uninstall ordering
+ if: matrix.shard == 3
run: .\libs\cua-driver\scripts\tests\uninstall-windows-history-regression.ps1
- name: Run autostart registration and self-elevation tests
+ if: matrix.shard == 2
# The elevation tests drive the shipped PowerShell against a stubbed
# Start-Process, so they prove the exit-code contract (a declined UAC
# prompt must not exit 0 — trycua/cua#3179) without any real UAC
@@ -165,21 +183,25 @@ jobs:
working-directory: libs/cua-driver/rust
run: "cargo test -p cua-driver --bin cua-driver autostart::tests:: --locked"
- name: Prove unknown app launch stays bounded and responsive
+ if: matrix.shard == 2
working-directory: libs/cua-driver/rust
env:
CUA_TEST_REQUIRE_DRIVER_BIN: "1"
run: "cargo test -p cua-driver --test protocol_tools_call_test launch_unknown_app_is_bounded_and_keeps_mcp_session_responsive --locked -- --exact --nocapture"
- name: Validate desktop AppsFolder launch with Microsoft Edge
+ if: matrix.shard == 2
working-directory: libs/cua-driver/rust
env:
CUA_TEST_REQUIRE_DRIVER_BIN: "1"
run: "cargo test -p cua-driver --test protocol_tools_call_test launch_edge_from_apps_folder_registration --locked -- --ignored --exact --nocapture"
- name: Prove an elevated Driver launches apps with a standard-user token
+ if: matrix.shard == 3
working-directory: libs/cua-driver/rust
env:
CUA_TEST_REQUIRE_DRIVER_BIN: "1"
run: cargo test -p cua-driver --test launch_app_standard_user_test --locked -- --ignored --nocapture
- name: Run transport-independent authorization and SDK tests
+ if: matrix.shard == 3
working-directory: libs/cua-driver/rust
run: |
cargo test -p cua-driver-core session_authorization::tests:: --lib --locked
@@ -198,11 +220,11 @@ jobs:
cargo test -p cua-driver-uia --lib authorization_tests:: --locked
if ($LASTEXITCODE -ne 0) { throw "UIAccess authorization tests failed with exit $LASTEXITCODE" }
- name: Run full SDK unit suite in an interactive runner session
- if: steps.runner-session.outputs.session_id != '0'
+ if: matrix.shard == 3 && steps.runner-session.outputs.session_id != '0'
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver-sdk --lib --locked -- --test-threads=1
- name: Prove Session 0 refusal
- if: steps.runner-session.outputs.session_id == '0'
+ if: matrix.shard == 3 && steps.runner-session.outputs.session_id == '0'
working-directory: libs/cua-driver/rust
shell: pwsh
run: |
@@ -210,6 +232,7 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "Session 0 refusal test failed with exit $LASTEXITCODE" }
if (-not ($sessionZeroLog -match 'test result: ok\. 1 passed')) { throw "Session 0 refusal filter matched no test" }
- name: Prove metadata commands remain desktop-free
+ if: matrix.shard == 3
working-directory: libs/cua-driver/rust
run: |
cargo run -p cua-driver --locked -- list-tools | Out-Null
@@ -219,6 +242,21 @@ jobs:
cargo run -p cua-driver --locked -- dump-docs --type cli | Out-Null
if ($LASTEXITCODE -ne 0) { throw "dump-docs failed with exit $LASTEXITCODE" }
- name: Run Windows protocol schema contract
- if: steps.runner-session.outputs.session_id != '0'
+ if: matrix.shard == 3 && steps.runner-session.outputs.session_id != '0'
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver --test protocol_schema_test --locked
+
+ # The one check that stood for the whole suite before it was sharded.
+ unit:
+ if: ${{ !cancelled() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!startsWith(github.head_ref, 'release-please--branches--')) }}
+ name: Rust Windows unit and compile
+ runs-on: ubuntu-latest
+ needs: shard
+ timeout-minutes: 5
+ steps:
+ - name: All shards passed
+ env:
+ RESULT: ${{ needs.shard.result }}
+ run: |
+ echo "shards: $RESULT"
+ test "$RESULT" = success
diff --git a/nix/cua-driver/tests/rust-unit.nix b/nix/cua-driver/tests/rust-unit.nix
index 634074d5a7..b41556a2dd 100644
--- a/nix/cua-driver/tests/rust-unit.nix
+++ b/nix/cua-driver/tests/rust-unit.nix
@@ -64,6 +64,11 @@ pkgs.rustPlatform.buildRustPackage {
libxkbcommon
];
+ # The check phase compiles every test target itself and installPhase only
+ # touches $out, so the build phase's separate release build of the
+ # workspace (about 15 minutes) produced nothing this check uses.
+ dontBuild = true;
+
# Focus unit tests launch private Xvfb servers. The ignored desktop
# matrix is run by the manual Linux e2e workflow and is not hidden in Nix.
doCheck = true;