Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

ci(test): reuse native runtimes and Node SDK builds across tests (#3189)

kekxy58c68e338b2d
diff --git a/.github/actions/restore-debug-runtime/action.yml b/.github/actions/restore-debug-runtime/action.yml
new file mode 100644
index 000000000..79c4cb01c
--- /dev/null
+++ b/.github/actions/restore-debug-runtime/action.yml
@@ -0,0 +1,24 @@
+name: Restore native debug runtime
+description: Use the runtime assembled by this Test run for subsequent VM tests.
+inputs:
+ name:
+ description: Artifact name from the successful build job.
+ required: true
+runs:
+ using: composite
+ steps:
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: ${{ inputs.name }}
+ path: ${{ runner.temp }}
+ - shell: bash
+ run: |
+ runtime=$(mktemp -d "$RUNNER_TEMP/boxlite-runtime.XXXXXXXX")
+ tar --zstd -xf "$RUNNER_TEMP/runtime.tar.zst" -C "$runtime"
+ for tool in boxlite-shim boxlite-guest guest-mke2fs guest-resize2fs; do
+ if [[ ! -s "$runtime/$tool" || ! -x "$runtime/$tool" ]]; then
+ echo "::error::Missing runtime executable: $tool"
+ exit 1
+ fi
+ done
+ printf 'BOXLITE_RUNTIME_DIR=%s\nSETUP_DONE=1\n' "$runtime" >> "$GITHUB_ENV"
diff --git a/.github/actions/run-in-manylinux/action.yml b/.github/actions/run-in-manylinux/action.yml
index c39d2e304..8fc1bce3d 100644
--- a/.github/actions/run-in-manylinux/action.yml
+++ b/.github/actions/run-in-manylinux/action.yml
@@ -119,6 +119,7 @@ runs:
"${SCCACHE_DOCKER_ARGS[@]}" \
-w /work \
-e CARGO_HOME=/work/.cargo-manylinux \
+ -e npm_config_fetch_retries \
-e "BOXLITE_CI_TARGET=$TARGET" \
"quay.io/pypa/manylinux_2_28_$image_arch" \
bash /tmp/build.sh
diff --git a/.github/actions/setup-boxlite-runner/action.yml b/.github/actions/setup-boxlite-runner/action.yml
index 2af4cd297..ec9f5b0b9 100644
--- a/.github/actions/setup-boxlite-runner/action.yml
+++ b/.github/actions/setup-boxlite-runner/action.yml
@@ -12,10 +12,10 @@ runs:
- name: Install workflow tools
shell: bash
run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends make ripgrep xz-utils zstd
+ sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update
+ sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends make ripgrep xz-utils zstd
- name: Install native build prerequisites
if: inputs.native-build == 'true'
shell: bash
- run: sudo apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev patchelf python3 jq
+ run: sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends build-essential pkg-config libssl-dev patchelf python3 jq
diff --git a/.github/actions/setup-infra/action.yml b/.github/actions/setup-infra/action.yml
index 20b333da8..87028d651 100644
--- a/.github/actions/setup-infra/action.yml
+++ b/.github/actions/setup-infra/action.yml
@@ -68,6 +68,8 @@ runs:
if: steps.modules.outputs.cache-hit != 'true'
shell: bash
working-directory: apps/infra
+ env:
+ npm_config_fetch_retries: '3'
run: npm ci
# A caller may check out another commit after this action returns.
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index dc76f574c..8f79df0d5 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -24,7 +24,7 @@ The connection needs permission to register workers and quota for the requested
| `boxlite-2vcpu-8gbmem-30gbdisk` | Dashboard tests and API client drift |
| `boxlite-4vcpu-8gbmem-30gbdisk` | Go CodeQL autobuild |
| `boxlite-4vcpu-16gbmem-30gbdisk` | Go SDK release checks, Node SDK release tests and Node release packaging |
-| `boxlite-4vcpu-16gbmem-64gbdisk` | JavaScript/TypeScript and Rust CodeQL, Clippy, REST volume lifecycle E2E, Nix CLI build and boot, Linux x64 C SDK, Node addon, Python wheel and runtime/CLI builds, standalone guest artifacts and the non-publishing multiarch Box image build |
+| `boxlite-4vcpu-16gbmem-64gbdisk` | JavaScript/TypeScript and Rust CodeQL, Clippy, the shared Linux x64 debug runtime build, REST volume lifecycle E2E, Nix CLI build and boot, Linux x64 C SDK, Node addon, Python wheel and runtime/CLI builds, standalone guest artifacts and the non-publishing multiarch Box image build |
| GitHub-hosted Ubuntu | API tests, Go SDK coverage, Rust coverage, selected-ref C SDK builds, protected publishing and runner recovery |
Each Node build packs its platform archive. The Node packaging job collects those archives, and `mbuild-release` attaches the verified release files on GitHub-hosted Ubuntu.
@@ -165,9 +165,11 @@ covers upper layers when the trunk is `main`; every layer needs `Test (conclusio
Adding the trigger does not retroactively start missing runs for PRs already in a stack.
On ready PRs that change the runner, the Linux x64 Go job enables KVM and
-requires the runner SIGTERM test to execute. It merges that coverage with the
-ordinary Go test profile. Other hosts run the process test when they can
-initialize a native runtime.
+requires the runner SIGTERM test to execute during hardware qualification.
+Other hosts run the process test when they can initialize a native runtime.
+
+Changing only `sdks/python/pyproject.toml` selects the infrastructure checks
+for Linux wheel packaging, including on draft PRs.
Draft PRs defer the Rust, Python, Node and Go SDK coverage matrices, including Go
vet and golangci-lint, which reuse the Go job's native build. The Lint and Format
@@ -208,10 +210,9 @@ so SSH guest tests can create private user/mount namespaces. This temporarily di
Ubuntu's AppArmor user-namespace restriction, as the Nix job does for its jailer.
Namespace setup failures remain test errors.
-`make coverage:bindings:external` runs `make test:unit:scripts` before collecting
-native SDK profiles. The infra job also runs `make test:unit:scripts` whenever
-`tests/scripts/` or a script it drives (`scripts/ci/`, `scripts/test/coverage-bindings.sh`)
-changes. A relative `CARGO_TARGET_DIR` is resolved from the repository
+Locally, `make coverage:bindings:external` runs `make test:unit:scripts` before collecting
+native SDK profiles. In CI the infra job owns those script tests whenever the scripts or native coverage are selected.
+A relative `CARGO_TARGET_DIR` is resolved from the repository
root once, so Python and Node builds share the report's object directory.
Linux x64 also runs the native KVM hardware tests and adds their profiles before
@@ -271,7 +272,54 @@ groups, require `codecov/patch` from the Codecov app in the main ruleset alongsi
`Test (conclusion)`. Deploy the workflow before enabling that requirement so
existing documentation-only PRs do not wait for a status they cannot publish.
-Go vet and golangci-lint run after Linux x64 Go coverage, reusing its native SDK build.
+### Shared test builds
+
+PRs and merge groups build the inputs for the selected suites once per workflow run.
+
+| Artifact | Built on | Consumed by |
+| --- | --- | --- |
+| Static Linux guest and filesystem tools | Linux x64 or ARM64 | Native runtime builds of the same architecture, including macOS ARM64 |
+| Debug runtime with links resolved | Linux x64 | Linux x64 Go tests, Rust file-copy and REST volume tests |
+| Symbol-adjusted Go test-support archive | Linux x64 when Go is selected | Linux x64 Go coverage and analyzers |
+| CLI and `volumes_rest` nextest archive | Linux x64 when Rust is selected | REST volume lifecycle on a separate runner |
+
+Rust-only changes need the x64 runtime. Go changes build native inputs for Linux x64, Linux ARM64 and macOS ARM64.
+
+Linux ARM64 and macOS ARM64 Go jobs download the same ARM64 guest and build their host runtime and Go archive on the test runner.
+Rerunning either Go job rebuilds those local inputs and reuses the guest artifact.
+
+If the x64 guest fails, both ARM64 hosts can still build and test using the shared ARM64 guest.
+The required Test conclusion includes each producer and test job.
+
+When Rust is selected, the unit matrix and the Linux x64 guest build can start together.
+
+```text
+Path selection ┬─ Rust Tests (Linux x64, Linux ARM64, macOS ARM64) ──────────→ Codecov (rust-unit)
+ └─ Linux x64 guest → Linux x64 runtime → VM file-copy tests → Codecov (rust-unit)
+```
+
+Each Rust job compiles its instrumented tests and uploads its own LCOV report.
+
+Script regressions run once in the infrastructure job.
+
+Each producer owns a target-specific artifact name within the run. A failed consumer downloads the successful producer's artifact, retained for seven days.
+
+After expiry, rerun the producers and consumers together. A new merge-group checkout starts a fresh run.
+
+The guest build used by release packages and the staged runner image retries pinned native downloads up to three times.
+Concurrent builds sharing `BOXLITE_CACHE` verify firmware in separate temporary files before publishing the archive under its SHA-256.
+
+Linux release containers inherit the workflow's download retry settings for npm, pip and uv.
+Go module and Git downloads retry the fetch; extraction, checksums, tests and publication keep their own failure status.
+
+In `build-node.yml`, the Linux x64 build compiles TypeScript once and packs the main npm package.
+Each Node/platform smoke job downloads that build's `dist` and imports it beside the matching native addon.
+After the matrix passes, the packaging job collects the staged npm tarballs for release.
+
+Linux x64 runs each full Go suite once with the default device permissions. It defers the named native metadata, configured-box SSH usage and runner SIGTERM tests to a KVM step.
+That step reuses the Go build, adds its results to the SDK and runner coverage profiles, and restores the original device permissions.
+The SSH usage drain must return an empty batch without starting the box.
+Go vet and golangci-lint then reuse its native SDK build.
Go module-download caches hash the repository's nested `go.mod` and `go.sum` files;
there is no root `go.sum`, and the SDK needs its `go.mod` included even without a
checksum file. The Go build cache is not restored because it cannot detect changes
@@ -280,8 +328,7 @@ Formatting-only jobs disable module caching. Go test jobs initialize
submodules before Rust cache setup and retain build state for both the root Cargo
workspace and vendored libkrun. They retain workspace compilation outputs, while
still invoking `make coverage:go` to rebuild changed code and current Git metadata.
-On Linux x64, a second Go coverage pass enables KVM and exercises nested runtime metadata and the local SSH usage drain. The drain must return an empty batch for a configured Box and leave its PID at zero. Both Go coverage passes contribute to the patch report.
-Finished native libraries are not reused without Cargo's freshness checks.
+The Go job builds its CGO archive with Cargo’s freshness checks.
The Go lint job retains formatting checks. SDK and API test filters exclude Markdown and select
the Make recipes they execute; the changes job still parses every Make include with `make -n help`.
Client drift and VM E2E triggers also exclude Markdown-only changes.
diff --git a/.github/workflows/build-c.yml b/.github/workflows/build-c.yml
index 15158204d..298092328 100644
--- a/.github/workflows/build-c.yml
+++ b/.github/workflows/build-c.yml
@@ -58,7 +58,7 @@ jobs:
# open pull request — same-repo or fork — isn't on any of them, so it isn't here yet;
# fetch it directly by SHA. (Unlike a ref name, a bare SHA is only a "want" GitHub can
# refuse, so this is a fallback, not the first attempt.)
- git cat-file -e "$candidate^{commit}" 2>/dev/null || git fetch origin "$candidate"
+ git cat-file -e "$candidate^{commit}" 2>/dev/null || sh scripts/build/retry-fetch.sh git fetch origin "$candidate"
git cat-file -e "$candidate^{commit}"
echo "sha=$candidate" >> "$GITHUB_OUTPUT"
@@ -93,8 +93,8 @@ jobs:
- name: Install BoxLite worker build tools
if: matrix.os == 'ubuntu-latest' && runner.environment == 'self-hosted'
run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends make ripgrep xz-utils zstd \
+ sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update
+ sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends make ripgrep xz-utils zstd \
build-essential pkg-config libssl-dev patchelf python3 jq
# This job builds a caller-selected commit, and a `uses: ./...` action is resolved from the
diff --git a/.github/workflows/build-go.yml b/.github/workflows/build-go.yml
index d69a2fc98..54eeb99c7 100644
--- a/.github/workflows/build-go.yml
+++ b/.github/workflows/build-go.yml
@@ -21,7 +21,7 @@ jobs:
with:
persist-credentials: false
- name: Install configuration tools
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends jq
+ run: sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends jq
- uses: ./.github/actions/ci-config
id: config
@@ -47,8 +47,8 @@ jobs:
- name: Install BoxLite runner tools
if: runner.environment == 'self-hosted'
run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends gcc libc6-dev xz-utils zstd
+ sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update
+ sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends gcc libc6-dev xz-utils zstd
- uses: ./.github/actions/setup-go
with:
diff --git a/.github/workflows/build-node.yml b/.github/workflows/build-node.yml
index 3ee2e81ae..96f5a9265 100644
--- a/.github/workflows/build-node.yml
+++ b/.github/workflows/build-node.yml
@@ -12,6 +12,7 @@ on:
type: string
env:
+ npm_config_fetch_retries: '3'
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
@@ -176,6 +177,21 @@ jobs:
jq -n --arg sha "$(git rev-parse HEAD)" --argjson run "$GITHUB_RUN_ID" --argjson attempt "$GITHUB_RUN_ATTEMPT" \
'{sha:$sha,run:$run,attempt:$attempt}' > "$dest/producer.json"
+ - name: Extract the compiled SDK from the main npm package
+ if: matrix.target == 'linux-x64-gnu'
+ working-directory: sdks/node
+ run: tar -xzf packages/boxlite-ai-boxlite-[0-9]*.tgz --strip-components=1 package/dist
+
+ - name: Upload the compiled SDK for smoke tests
+ if: matrix.target == 'linux-x64-gnu'
+ uses: actions/upload-artifact@v4
+ with:
+ name: node-sdk-dist
+ path: sdks/node/dist
+ if-no-files-found: error
+ overwrite: true
+ retention-days: ${{ needs.config.outputs.artifact-retention-days }}
+
- name: Stage platform npm packages
uses: actions/upload-artifact@v4
with:
@@ -255,11 +271,15 @@ jobs:
TARGET: ${{ matrix.platform.target }}
run: tar -xvf "sdks/node/artifacts-$TARGET.tar" -C sdks/node
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: node-sdk-dist
+ path: sdks/node/dist
+
- name: Test package
run: |
cd sdks/node
npm install --ignore-scripts
- npm run build
node -e "import('./dist/index.js').then(m => console.log('BoxLite loaded:', Object.keys(m)))"
# ============================================================================
@@ -276,7 +296,7 @@ jobs:
ref: ${{ inputs.ref || github.sha }}
- name: Install packaging tools
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends jq
+ run: sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends jq
- name: Collect the packages built by each platform
uses: actions/download-artifact@v4
diff --git a/.github/workflows/build-runner-binary.yml b/.github/workflows/build-runner-binary.yml
index 70f026dff..664c9b997 100644
--- a/.github/workflows/build-runner-binary.yml
+++ b/.github/workflows/build-runner-binary.yml
@@ -53,7 +53,7 @@ jobs:
# open pull request — same-repo or fork — isn't on any of them, so it isn't here yet;
# fetch it directly by SHA. (Unlike a ref name, a bare SHA is only a "want" GitHub can
# refuse, so this is a fallback, not the first attempt.)
- git cat-file -e "$candidate^{commit}" 2>/dev/null || git fetch origin "$candidate"
+ git cat-file -e "$candidate^{commit}" 2>/dev/null || sh scripts/build/retry-fetch.sh git fetch origin "$candidate"
git cat-file -e "$candidate^{commit}"
echo "sha=$candidate" >> "$GITHUB_OUTPUT"
@@ -71,13 +71,23 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.resolve-ref.outputs.sha }}
+ - name: Check out the workflow's download helpers
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.sha }}
+ path: .ci-tools
+ sparse-checkout-cone-mode: false
+ sparse-checkout: |
+ /scripts/build/download-archive.sh
+ /scripts/build/retry-fetch.sh
+ persist-credentials: false
- uses: ./.github/actions/setup-go
with:
go-version: ${{ needs.resolve-ref.outputs.go-version }}
- name: Install system dependencies
- run: sudo apt-get update && sudo apt-get install -y libx11-dev libxtst-dev libxinerama-dev
+ run: sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && sudo apt-get install -y -o Acquire::Retries=3 libx11-dev libxtst-dev libxinerama-dev
- name: Resolve artifact identity
id: artifact
@@ -124,7 +134,8 @@ jobs:
ARCHIVE="boxlite-c-v${VERSION}-linux-x64-gnu.tar.gz"
URL="https://github.com/${GH_REPO}/releases/download/v${VERSION}/${ARCHIVE}"
echo "Downloading $URL"
- curl -fsSL "$URL" | tar xz -C /tmp/
+ sh .ci-tools/scripts/build/download-archive.sh "$URL" "$RUNNER_TEMP/$ARCHIVE"
+ tar xzf "$RUNNER_TEMP/$ARCHIVE" -C /tmp/
cp "/tmp/boxlite-c-v${VERSION}-linux-x64-gnu/lib/libboxlite.a" sdks/go/libboxlite.a
- name: Download commit libboxlite.a
@@ -176,9 +187,9 @@ jobs:
- name: Download Go dependencies
if: steps.cache.outputs.hit != 'true'
run: |
- go -C apps/runner mod download
- go -C apps/libs/common-go mod download
- go -C apps/libs/api-client-go mod download
+ for module in apps/runner apps/libs/common-go apps/libs/api-client-go; do
+ sh .ci-tools/scripts/build/retry-fetch.sh go -C "$module" mod download
+ done
- name: Build runner
if: steps.cache.outputs.hit != 'true'
diff --git a/.github/workflows/build-runtime.yml b/.github/workflows/build-runtime.yml
index f7f353172..8381092ad 100644
--- a/.github/workflows/build-runtime.yml
+++ b/.github/workflows/build-runtime.yml
@@ -190,7 +190,7 @@ jobs:
steps:
- name: Install packaging tools
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends jq
+ run: sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends jq
- name: Checkout (for scripts/release/install.sh.template)
uses: actions/checkout@v4
diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml
index ddf95d4af..9d6651269 100644
--- a/.github/workflows/build-wheels.yml
+++ b/.github/workflows/build-wheels.yml
@@ -12,6 +12,8 @@ on:
type: string
env:
+ PIP_RETRIES: '3'
+ UV_HTTP_RETRIES: '3'
SKIP_INSTALL_NODEJS: '1'
CARGO_INCREMENTAL: '0'
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index f10e3fbfa..f4743a495 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -72,7 +72,7 @@ jobs:
if: matrix.language == 'go'
- name: Install Go autobuild dependencies
if: matrix.language == 'go'
- run: sudo apt-get install -y --no-install-recommends gcc libc6-dev
+ run: sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends gcc libc6-dev
- uses: ./.github/actions/setup-go
if: matrix.language == 'go'
with:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 756226e99..36f4dd551 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -36,6 +36,10 @@ concurrency:
group: lint-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+env:
+ PIP_RETRIES: '3'
+ npm_config_fetch_retries: '3'
+
jobs:
changes:
runs-on: boxlite
@@ -131,7 +135,7 @@ jobs:
if: runner.environment == 'self-hosted'
- name: Install native build dependencies
if: runner.environment == 'self-hosted'
- run: sudo apt-get install -y --no-install-recommends build-essential libssl-dev pkg-config
+ run: sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends build-essential libssl-dev pkg-config
- uses: ./.github/actions/setup-rust
with:
@@ -150,8 +154,8 @@ jobs:
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
- sudo apt-get update
- sudo apt-get install -y musl-tools protobuf-compiler
+ sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update
+ sudo apt-get install -y -o Acquire::Retries=3 musl-tools protobuf-compiler
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
@@ -235,8 +239,8 @@ jobs:
- name: Install clang tools
run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends clang-format clang-tidy libc6-dev make
+ sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update
+ sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends clang-format clang-tidy libc6-dev make
- name: Run C lint
run: make lint:c
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index a13308ff8..9696fbb1a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -94,6 +94,11 @@ concurrency:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
+ CARGO_NET_RETRY: '3'
+ npm_config_fetch_retries: '3'
+ UV_HTTP_RETRIES: '3'
+ PIP_RETRIES: '3'
+ YARN_HTTP_RETRY: '3'
jobs:
# Detect which files changed to conditionally run tests
@@ -104,7 +109,11 @@ jobs:
pull-requests: read
outputs:
platforms: ${{ steps.config.outputs.platforms }}
+ linux-x64: ${{ steps.native.outputs.linux-x64-gnu }}
+ linux-arm64: ${{ steps.native.outputs.linux-arm64-gnu }}
+ darwin-arm64: ${{ steps.native.outputs.darwin-arm64 }}
rust-toolchain: ${{ steps.config.outputs.rust-toolchain }}
+ artifact-retention-days: ${{ steps.config.outputs.artifact-retention-days }}
python-test-matrix: ${{ steps.config.outputs.python-test-matrix }}
node-test-matrix: ${{ steps.config.outputs.node-test-matrix }}
# Keep file selection separate: deferred SDK coverage is not an empty diff.
@@ -164,6 +173,7 @@ jobs:
- 'sdks/python/tests/**/!(*.md)'
- 'sdks/go/**/!(*.md)'
- 'scripts/test/coverage-bindings.sh'
+ - '.github/actions/restore-debug-runtime/**/!(*.md)'
- 'tests/scripts/**/!(*.md)'
- 'sdks/node/src/**/!(*.md)'
- 'sdks/node/build.rs'
@@ -254,6 +264,7 @@ jobs:
- '.github/actions/ci-config/**/!(*.md)'
- '.github/workflows/test.yml'
go:
+ - '.github/actions/restore-debug-runtime/**/!(*.md)'
- '.github/actions/setup-boxlite-runner/**/!(*.md)'
- 'sdks/go/**/!(*.md)'
- 'src/deps/libgvproxy-sys/**/!(*.md)'
@@ -323,6 +334,7 @@ jobs:
setup:
- '.gitmodules'
- 'scripts/setup/setup-submodules.sh'
+ - 'scripts/build/retry-fetch.sh'
- 'scripts/test/test-setup-submodules.sh'
- 'make/setup.mk'
- 'make/test.mk'
@@ -330,6 +342,7 @@ jobs:
infra:
- 'apps/infra/**/!(*.md)'
- '.github/**/!(*.md)'
+ - 'sdks/python/pyproject.toml'
- 'Makefile'
- 'make/test.mk'
- 'make/coverage.mk'
@@ -337,15 +350,30 @@ jobs:
# tests/scripts and the scripts it drives.
- 'tests/scripts/**'
- 'scripts/ci/**/!(*.md)'
+ - 'scripts/build/download-archive.sh'
+ - 'scripts/build/retry-fetch.sh'
+ - 'scripts/build/install-apk.sh'
+ - 'scripts/build/build-libseccomp.sh'
+ - 'scripts/setup/setup-*.sh'
+ - 'apps/{api,proxy,image-service,otel-collector,runner}/Dockerfile'
+ - 'apps/runner/packaging/dev-artifact.Dockerfile'
+ - 'scripts/util.sh'
- 'scripts/test/coverage-bindings.sh'
# The infra suite asserts Codecov's ignore list covers every test
# source, so a change to it has to run that suite.
- 'codecov.yml'
+ - name: Read per-platform test matrices
+ id: native
+ env:
+ PLATFORMS: ${{ steps.config.outputs.platforms }}
+ run: |
+ jq -r '.[] | "\(.target)=\([.] | tojson)"' <<< "$PLATFORMS" >> "$GITHUB_OUTPUT"
+
infra:
name: Workflow and infrastructure checks
needs: changes
- if: ${{ needs.changes.outputs.infra == 'true' }}
+ if: ${{ needs.changes.outputs.infra == 'true' || (needs.changes.outputs['sdk-tests-enabled'] == 'true' && needs.changes.outputs.rust == 'true') }}
runs-on: boxlite
timeout-minutes: 10
permissions:
@@ -355,7 +383,7 @@ jobs:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-boxlite-runner
- name: Install CI script test dependencies
- run: sudo apt-get install -y --no-install-recommends gcc libc6-dev patchelf python3-venv
+ run: sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends gcc libc6-dev patchelf python3-venv
- uses: ./.github/actions/setup-rust
with:
cache: 'false'
@@ -365,8 +393,10 @@ jobs:
cache: npm
cache-dependency-path: apps/infra/package-lock.json
- name: Type-check and test infrastructure scripts and workflows with coverage
+ if: needs.changes.outputs.infra == 'true'
run: make coverage:infra
- name: Upload infrastructure coverage to Codecov
+ if: needs.changes.outputs.infra == 'true'
uses: codecov/codecov-action@v5
with:
files: target/coverage/infra/lcov.info
@@ -377,19 +407,161 @@ jobs:
- name: Test CI and coverage scripts against fake tools
run: make test:unit:scripts
+ # Each host waits for its own artifacts. The two ARM64 hosts share one guest.
+ build-test-guest:
+ name: Build Linux guest (linux-x64-gnu)
+ needs: changes
+ if: &native-x64-selected ${{ needs.changes.outputs.sdk-tests-enabled == 'true' && (needs.changes.outputs.rust == 'true' || needs.changes.outputs.go == 'true') }}
+ runs-on: &native-runner ${{ matrix.platform.os == 'ubuntu-latest' && 'boxlite-4vcpu-16gbmem-64gbdisk' || matrix.platform.os }}
+ strategy: &linux-x64-platform
+ matrix:
+ platform: ${{ fromJSON(needs.changes.outputs.linux-x64) }}
+ timeout-minutes: 45
+ permissions: &read-contents
+ contents: read
+ steps: &guest-build-steps
+ - uses: actions/checkout@v5
+ with:
+ persist-credentials: false
+ - uses: ./.github/actions/setup-boxlite-runner
+ if: runner.environment == 'self-hosted'
+ with:
+ native-build: 'true'
+ - uses: ./.github/actions/setup-go
+ - run: make setup:submodules
+ - uses: ./.github/actions/setup-rust
+ with:
+ toolchain: ${{ needs.changes.outputs.rust-toolchain }}
+ - run: make setup:build
+ - uses: ./.github/actions/sccache
+ - run: make guest PROFILE=debug
+ - name: Pack static guest executables
+ run: tar -czf "$RUNNER_TEMP/guest.tar.gz" -C "target/$(scripts/util.sh --target)/debug" boxlite-guest mke2fs resize2fs
+ - uses: actions/upload-artifact@v4
+ with:
+ name: test-guest-${{ runner.arch }}
+ path: ${{ runner.temp }}/guest.tar.gz
+ if-no-files-found: error
+ overwrite: true
+ compression-level: 0
+ retention-days: ${{ needs.changes.outputs.artifact-retention-days }}
+
+ build-test-guest-arm64:
+ name: Build Linux guest (linux-arm64-gnu)
+ needs: changes
+ if: &go-selected ${{ needs.changes.outputs.sdk-tests-enabled == 'true' && needs.changes.outputs.go == 'true' }}
+ runs-on: *native-runner
+ strategy: &linux-arm64-platform
+ matrix:
+ platform: ${{ fromJSON(needs.changes.outputs.linux-arm64) }}
+ timeout-minutes: 45
+ permissions: *read-contents
+ steps: *guest-build-steps
+
+ build-test-runtime:
+ name: Build native test inputs (linux-x64-gnu)
+ needs: [changes, build-test-guest]
+ if: *native-x64-selected
+ runs-on: *native-runner
+ strategy: *linux-x64-platform
+ timeout-minutes: 60
+ env: &firmware-cache
+ BOXLITE_CACHE: ${{ github.workspace }}/target/native
+ permissions: *read-contents
+ steps:
+ - &checkout-native
+ uses: actions/checkout@v5
+ with:
+ persist-credentials: false
+ - uses: ./.github/actions/setup-boxlite-runner
+ if: runner.environment == 'self-hosted'
+ with:
+ native-build: 'true'
+ - &setup-native-go
+ uses: ./.github/actions/setup-go
+ - &native-submodules
+ run: make setup:submodules
+ - &setup-native-rust
+ uses: ./.github/actions/setup-rust
+ with:
+ toolchain: ${{ needs.changes.outputs.rust-toolchain }}
+ cache-workspaces: |
+ . -> target
+ src/deps/libkrun-sys/vendor/libkrun -> target
+ cache-workspace-crates: 'true'
+ - &setup-native-build
+ run: make setup:build
+ - &native-sccache
+ uses: ./.github/actions/sccache
+ - &download-test-guest
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: test-guest-${{ runner.arch }}
+ path: ${{ runner.temp }}
+ - &assemble-test-runtime
+ name: Assemble runtime from the matching Linux guest
+ run: |
+ guest="target/$(scripts/util.sh --target)/debug"
+ mkdir -p "$guest"
+ tar -xzf "$RUNNER_TEMP/guest.tar.gz" -C "$guest" boxlite-guest mke2fs resize2fs
+ SKIP_GUEST_BUILD=1 make runtime:debug
+ - name: Pack standalone runtime files
+ id: pack
+ run: |
+ # The stable runtime directory links into multiple Cargo target trees.
+ tar --zstd -chf "$RUNNER_TEMP/runtime.tar.zst" -C target/debug/runtime .
+ - uses: actions/upload-artifact@v4
+ with:
+ name: test-runtime-${{ matrix.platform.target }}
+ overwrite: true
+ path: ${{ runner.temp }}/runtime.tar.zst
+ if-no-files-found: error
+ compression-level: 0
+ retention-days: ${{ needs.changes.outputs.artifact-retention-days }}
+
+ - name: Build symbol-adjusted Go test library
+ if: needs.changes.outputs.go == 'true'
+ run: &build-go-archive make build:go:archive GO_CARGO_FEATURES="--features test-support"
+ - name: Compress Go test library
+ if: needs.changes.outputs.go == 'true'
+ run: zstd -T0 -q target/debug/libboxlite.a -o "$RUNNER_TEMP/libboxlite.a.zst"
+ - uses: actions/upload-artifact@v4
+ if: needs.changes.outputs.go == 'true'
+ with:
+ name: test-go-${{ matrix.platform.target }}
+ path: ${{ runner.temp }}/libboxlite.a.zst
+ if-no-files-found: error
+ overwrite: true
+ compression-level: 0
+ retention-days: ${{ needs.changes.outputs.artifact-retention-days }}
+ - uses: taiki-e/install-action@nextest
+ if: needs.changes.outputs.rust == 'true' && matrix.platform.target == 'linux-x64-gnu'
+ - name: Archive REST volume test and CLI
+ if: needs.changes.outputs.rust == 'true' && matrix.platform.target == 'linux-x64-gnu'
+ run: make build:test:rest
+ - uses: actions/upload-artifact@v4
+ if: needs.changes.outputs.rust == 'true' && matrix.platform.target == 'linux-x64-gnu'
+ with:
+ name: test-rest-linux-x64-gnu
+ path: target/volumes-rest.tar.zst
+ if-no-files-found: error
+ overwrite: true
+ compression-level: 0
+ retention-days: ${{ needs.changes.outputs.artifact-retention-days }}
+
# Merge core, shared, REST, CLI, native VMM and Linux guest coverage.
# Codecov gates changed lines at 90% and reports total coverage separately.
rust:
name: Rust Tests (${{ matrix.platform.target }})
needs: changes
- if: ${{ needs.changes.outputs.sdk-tests-enabled == 'true' && needs.changes.outputs.rust == 'true' }}
+ if: &rust-selected ${{ needs.changes.outputs.sdk-tests-enabled == 'true' && needs.changes.outputs.rust == 'true' }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
- platform: ${{ fromJson(needs.changes.outputs.platforms) }}
+ platform: ${{ fromJSON(needs.changes.outputs.platforms) }}
- permissions:
+ permissions: &coverage-permissions
contents: read
id-token: write
steps:
@@ -405,7 +577,7 @@ jobs:
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
- run: sudo apt-get update && sudo apt-get install -y jq libseccomp-dev protobuf-compiler util-linux
+ run: sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && sudo apt-get install -y -o Acquire::Retries=3 jq libseccomp-dev protobuf-compiler util-linux
# SSH guest tests need user/mount namespaces; Ubuntu's AppArmor blocks
# them by default. This setting lasts only for the disposable runner.
@@ -426,7 +598,7 @@ jobs:
- name: Check out vendored libkrun
# net::socket_path's vendor-pin unit test reads the libkrun source.
# The libkrun build itself stays stubbed below.
- run: git submodule update --init --depth 1 -- src/deps/libkrun-sys/vendor/libkrun
+ run: sh scripts/build/retry-fetch.sh git submodule update --init --depth 1 -- src/deps/libkrun-sys/vendor/libkrun
- name: Run Rust unit tests with coverage
# The core crate's dev-dependency boxlite-test-utils re-enables its
@@ -450,7 +622,7 @@ jobs:
if: matrix.platform.target == 'linux-x64-gnu' && needs.changes.outputs.vmm == 'true' && steps.vmm-kernel.outputs.cache-hit != 'true'
timeout-minutes: 20
run: |
- sudo apt-get install -y build-essential bc bison flex curl xz-utils libelf-dev \
+ sudo apt-get install -y -o Acquire::Retries=3 build-essential bc bison flex curl xz-utils libelf-dev \
gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu
make vmm:boot:host
@@ -466,7 +638,7 @@ jobs:
- name: Prepare real-guest test toolchain
if: matrix.platform.target == 'linux-x64-gnu'
run: |
- sudo apt-get install -y musl-tools gperf
+ sudo apt-get install -y -o Acquire::Retries=3 musl-tools gperf
rustup target add x86_64-unknown-linux-musl
- name: Run real-kernel boot tests with coverage
@@ -489,16 +661,9 @@ jobs:
if: matrix.platform.target == 'linux-x64-gnu'
env:
BOXLITE_DEPS_STUB: '1'
+ CI_SCRIPT_TESTS_SEPARATE: '1'
run: make coverage:bindings:external
- - name: Measure file-copy workflows with a real guest
- if: matrix.platform.target == 'linux-x64-gnu' && needs.changes.outputs.rust == 'true'
- timeout-minutes: 20
- run: |
- make setup:submodules
- make setup:build
- make coverage:copy:vm
-
- name: Run OpenAPI reference-server unit tests
# Keyed on BoxliteError's Display text (src/shared/src/errors.rs, in this
# filter), so a new variant must add its row there before the reference
@@ -509,7 +674,8 @@ jobs:
if: runner.os == 'Linux'
run: make test:guest-perms
- - name: Upload coverage to Codecov
+ - &upload-rust-coverage
+ name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: target/coverage/lcov.info
@@ -528,11 +694,43 @@ jobs:
disable_search: true
fail_ci_if_error: true
+ rust-copy-vm:
+ name: Rust VM file-copy coverage (Linux x64)
+ needs: [changes, build-test-runtime]
+ if: *rust-selected
+ runs-on: ${{ matrix.platform.os }}
+ strategy: *linux-x64-platform
+ timeout-minutes: 45
+ permissions: *coverage-permissions
+ steps:
+ - uses: actions/checkout@v5
+ with:
+ persist-credentials: false
+ - run: make setup:submodules
+ - uses: ./.github/actions/setup-rust
+ with:
+ toolchain: ${{ needs.changes.outputs.rust-toolchain }}
+ - uses: ./.github/actions/setup-go
+ - run: make setup:build
+ - run: sudo apt-get install -y -o Acquire::Retries=3 libseccomp-dev
+ - uses: taiki-e/install-action@nextest
+ - uses: taiki-e/install-action@cargo-llvm-cov
+ - name: Enable KVM and unprivileged user namespaces
+ run: |
+ sudo chmod a+rw /dev/kvm
+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
+ - uses: ./.github/actions/restore-debug-runtime
+ with:
+ name: test-runtime-linux-x64-gnu
+ - name: Measure file-copy workflows with a real guest
+ run: make coverage:copy:vm
+ - *upload-rust-coverage
+
# The volume REST lifecycle needs a real server process and its runtime
# artifacts, but not a VM or persistent E2E runner.
serve-rest-e2e:
name: REST Server E2E (Linux)
- needs: changes
+ needs: [changes, build-test-runtime]
if: ${{ needs.changes.outputs.sdk-tests-enabled == 'true' && needs.changes.outputs.rust == 'true' }}
runs-on: boxlite-4vcpu-16gbmem-64gbdisk
timeout-minutes: 45
@@ -548,14 +746,6 @@ jobs:
with:
native-build: 'true'
- - uses: ./.github/actions/setup-go
- with:
- cache: 'false'
-
- - uses: ./.github/actions/setup-rust
- with:
- toolchain: ${{ needs.changes.outputs.rust-toolchain }}
-
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
@@ -570,14 +760,18 @@ jobs:
- name: Enable KVM access for the runtime warm-up
run: sudo chmod a+rw /dev/kvm
- - name: Prepare runtime dependencies
- run: |
- make setup:submodules
- make setup:build
+ - uses: ./.github/actions/restore-debug-runtime
+ with:
+ name: test-runtime-linux-x64-gnu
+
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: test-rest-linux-x64-gnu
+ path: target
- name: Run volume REST lifecycle E2E
timeout-minutes: 20
- run: make test:e2e:serve:volume
+ run: make test:rest:archive
# Python SDK unit tests
python:
@@ -704,7 +898,7 @@ jobs:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-boxlite-runner
- name: Install Go race detector dependencies
- run: sudo apt-get install -y --no-install-recommends gcc libc6-dev
+ run: sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends gcc libc6-dev
- uses: ./.github/actions/setup-go
- name: Run Secret Server PostgreSQL integration tests
env:
@@ -721,72 +915,64 @@ jobs:
# Go SDK unit tests
go:
- name: Go Tests (${{ matrix.platform.target }})
- needs: changes
- if: ${{ needs.changes.outputs.sdk-tests-enabled == 'true' && needs.changes.outputs.go == 'true' }}
+ name: Go Tests (linux-x64-gnu)
+ needs: [changes, build-test-runtime]
+ if: *go-selected
runs-on: ${{ matrix.platform.os }}
- strategy:
- fail-fast: false
- matrix:
- platform: ${{ fromJson(needs.changes.outputs.platforms) }}
+ strategy: *linux-x64-platform
- permissions:
- contents: read
- id-token: write
+ permissions: *coverage-permissions
steps:
- name: Checkout code
uses: actions/checkout@v5
- uses: ./.github/actions/setup-go
- - name: Check out native dependency workspaces
- # Cargo's cache action reads the nested workspace metadata during setup.
- run: make setup:submodules
-
- - uses: ./.github/actions/setup-rust
+ - uses: ./.github/actions/restore-debug-runtime
with:
- toolchain: ${{ needs.changes.outputs.rust-toolchain }}
- cache-workspaces: |
- . -> target
- src/deps/libkrun-sys/vendor/libkrun -> target
- cache-workspace-crates: 'true'
-
- - name: Install build dependencies
- run: make setup:build
+ name: test-runtime-${{ matrix.platform.target }}
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
+ with:
+ name: test-go-${{ matrix.platform.target }}
+ path: ${{ runner.temp }}
+ - name: Restore native Go library
+ run: |
+ mkdir -p target/debug
+ zstd -dq "$RUNNER_TEMP/libboxlite.a.zst" -o target/debug/libboxlite.a
- - uses: ./.github/actions/sccache
+ - &fetch-go-deps
+ name: Fetch Go test dependencies
+ run: |
+ for module in sdks/go src/deps/libgvproxy-sys/gvproxy-bridge apps/runner apps/image-service apps/secret-server; do
+ if [[ "$module" == apps/secret-server ]]; then
+ GOWORK=off sh scripts/build/retry-fetch.sh go -C "$module" mod download
+ else
+ sh scripts/build/retry-fetch.sh go -C "$module" mod download
+ fi
+ done
- - name: Run Go SDK, networking and app tests with coverage
+ - &run-go-coverage
+ name: Run Go SDK, networking and app tests with coverage
+ env:
+ GO_TEST_ARCHIVE_READY: '1'
+ GO_SDK_COVERAGE_TAGS: ${{ matrix.platform.target == 'linux-x64-gnu' && 'boxlite_runner,boxlite_ssh_usage_test' || 'boxlite_runner' }}
+ GO_COVERAGE_DEFER_KVM: ${{ matrix.platform.target == 'linux-x64-gnu' && '1' || '' }}
run: make coverage:go
- - name: Qualify native runtime metadata, SSH usage, and runner shutdown with KVM coverage
- id: nested-runtime-coverage
+ - name: Run native metadata, SSH usage and runner shutdown tests with KVM
if: matrix.platform.target == 'linux-x64-gnu'
timeout-minutes: 5
env:
BOXLITE_REQUIRE_NESTED_RUNTIME_TESTS: '1'
BOXLITE_REQUIRE_RUNNER_SHUTDOWN_TEST: '1'
run: |
- mkdir -p target/coverage/full-go
- for module in go-sdk gvproxy runner image-service secret-server; do
- cp "target/coverage/$module.out" "target/coverage/full-go/$module.out"
- done
+ mode=$(stat -c '%a' /dev/kvm)
+ trap 'sudo chmod "$mode" /dev/kvm' EXIT
sudo chmod a+rw /dev/kvm
make _ensure-kvm
- make coverage:go GO_SDK_COVERAGE_TAGS=boxlite_runner,boxlite_integration GOTEST_FILTER="-count=1 -run 'NestedVirtualization|SSHUsageConfiguredLocal|TestRunnerDrainsPollOnSIGTERM'"
- # Both passes instrument this checkout with the same atomic mode.
- # Keep the complete suite's blocks as well as the hardware pass.
- for module in go-sdk gvproxy runner image-service secret-server; do
- report="target/coverage/$module.out"
- full="target/coverage/full-go/$module.out"
- if [[ "$(head -n 1 "$report")" != 'mode: atomic' || "$(head -n 1 "$full")" != 'mode: atomic' ]]; then
- echo "Expected atomic coverage profiles for $module" >&2
- exit 1
- fi
- tail -n +2 "$full" >> "$report"
- done
+ make _coverage-go-kvm
- # coverage:go has already built the native library needed by both analyzers.
+ # Both analyzers link the same library as coverage.
- name: Run Go vet
if: matrix.platform.target == 'linux-x64-gnu'
run: make lint:go
@@ -798,7 +984,8 @@ jobs:
working-directory: sdks/go
args: --timeout=5m --build-tags boxlite_dev
- - name: Upload Go coverage to Codecov
+ - &upload-go-coverage
+ name: Upload Go coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: target/coverage/go-sdk.out,target/coverage/gvproxy.out,target/coverage/runner.out,target/coverage/image-service.out,target/coverage/secret-server.out
@@ -807,6 +994,43 @@ jobs:
disable_search: true
fail_ci_if_error: true
+ go-linux-arm64:
+ name: Go Tests (linux-arm64-gnu)
+ needs: [changes, build-test-guest-arm64]
+ if: *go-selected
+ runs-on: ${{ matrix.platform.os }}
+ strategy: *linux-arm64-platform
+ permissions: *coverage-permissions
+ env: *firmware-cache
+ steps: &arm-go-steps
+ - *checkout-native
+ - *setup-native-go
+ - *native-submodules
+ - *setup-native-rust
+ - *setup-native-build
+ - *native-sccache
+ - *download-test-guest
+ - *assemble-test-runtime
+ - name: Build symbol-adjusted Go test library
+ run: *build-go-archive
+ - name: Use the local debug runtime for Go tests
+ run: printf 'BOXLITE_RUNTIME_DIR=%s\nSETUP_DONE=1\n' "$GITHUB_WORKSPACE/target/debug/runtime" >> "$GITHUB_ENV"
+ - *fetch-go-deps
+ - *run-go-coverage
+ - *upload-go-coverage
+
+ go-darwin-arm64:
+ name: Go Tests (darwin-arm64)
+ needs: [changes, build-test-guest-arm64]
+ if: *go-selected
+ runs-on: ${{ matrix.platform.os }}
+ strategy:
+ matrix:
+ platform: ${{ fromJSON(needs.changes.outputs.darwin-arm64) }}
+ permissions: *coverage-permissions
+ env: *firmware-cache
+ steps: *arm-go-steps
+
guest_artifacts:
name: Guest Artifacts (${{ matrix.os }} / ${{ matrix.target }} / ${{ matrix.profile }})
needs: changes
@@ -991,7 +1215,7 @@ jobs:
- name: Install app dependencies
run: "yarn install --immutable"
- name: Install isolated Redis test dependency
- run: sudo apt-get update && sudo apt-get install -y redis-server
+ run: sudo apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && sudo apt-get install -y -o Acquire::Retries=3 redis-server
- name: Run API unit tests
run: "yarn nx run api:test --coverage --skip-nx-cache"
- name: Run shared and standalone CI Listener tests
@@ -1024,7 +1248,7 @@ jobs:
persist-credentials: ${{ false }}
- uses: ./.github/actions/setup-boxlite-runner
- name: Install native Node build dependencies
- run: sudo apt-get install -y --no-install-recommends build-essential python3
+ run: sudo apt-get install -y -o Acquire::Retries=3 --no-install-recommends build-essential python3
- uses: actions/setup-node@v4
with:
node-version: '22'
@@ -1121,7 +1345,27 @@ jobs:
# NOTE: keep `needs` in sync with the jobs above when adding/removing jobs.
test-conclusion:
name: Test (conclusion)
- needs: [changes, infra, rust, serve-rest-e2e, python, node, go, secret-server-postgres, setup, api, dashboard, plugins, guest_artifacts, coverage-empty]
+ needs:
+ - changes
+ - infra
+ - build-test-guest
+ - build-test-guest-arm64
+ - build-test-runtime
+ - rust
+ - rust-copy-vm
+ - serve-rest-e2e
+ - python
+ - node
+ - go
+ - go-linux-arm64
+ - go-darwin-arm64
+ - secret-server-postgres
+ - setup
+ - api
+ - dashboard
+ - plugins
+ - guest_artifacts
+ - coverage-empty
if: ${{ !cancelled() }}
runs-on: boxlite
permissions: {}
diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile
index deff849c5..6d961f382 100644
--- a/apps/api/Dockerfile
+++ b/apps/api/Dockerfile
@@ -9,9 +9,9 @@ ENV CI=true
# toolchain the fallback cannot succeed, so one lost download fails the whole `yarn install`
# rather than degrading into a slower build. The shipped image starts from its own node:24-slim
# below and copies only node_modules, so none of this reaches it.
-RUN apt-get update && apt-get install -y --no-install-recommends bash curl python3 make g++ && \
+RUN apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && apt-get install -y -o Acquire::Retries=3 --no-install-recommends bash curl python3 make g++ && \
rm -rf /var/lib/apt/lists/*
-RUN npm install -g corepack && corepack enable
+RUN npm --fetch-retries=3 install -g corepack && corepack enable
WORKDIR /boxlite/apps
@@ -23,7 +23,7 @@ RUN --mount=type=secret,id=cloud_app_release_key make build RELEASE_KEY=/run/sec
FROM base AS deps
COPY apps/package.json apps/yarn.lock apps/.yarnrc.yml ./
-RUN yarn install --immutable
+RUN YARN_HTTP_RETRY=3 yarn install --immutable
FROM base AS runtime-deps
ENV NODE_ENV=production
@@ -61,7 +61,7 @@ FROM node:24-slim AS boxlite
ENV CI=true
ENV NODE_ENV=production
-RUN apt-get update && apt-get install -y --no-install-recommends bash curl && \
+RUN apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update && apt-get install -y -o Acquire::Retries=3 --no-install-recommends bash curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /boxlite/apps
diff --git a/apps/image-service/Dockerfile b/apps/image-service/Dockerfile
index 45ec8a6bd..179e3f989 100644
--- a/apps/image-service/Dockerfile
+++ b/apps/image-service/Dockerfile
@@ -2,19 +2,19 @@ FROM node:22-alpine AS build
ENV CI=true
-RUN npm install -g corepack && corepack enable
+RUN npm --fetch-retries=3 install -g corepack && corepack enable
COPY --from=golang:1.25.4-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
-RUN apk add --no-cache git
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh git
WORKDIR /boxlite/apps
# Yarn caching layer
COPY apps/package.json apps/yarn.lock apps/.yarnrc.yml ./
-RUN yarn install --immutable
+RUN YARN_HTTP_RETRY=3 yarn install --immutable
# Nx config
COPY apps/nx.json ./
@@ -29,7 +29,10 @@ RUN head -1 go.work > go.work.tmp && printf '\nuse (\n\t./image-service\n\t./lib
ENV NX_DAEMON=false
ENV GOWORK=/boxlite/apps/go.work
-RUN go -C image-service mod download && go -C libs/common-go mod download && go -C libs/api-client-go mod download
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts \
+ for module in image-service libs/common-go libs/api-client-go; do \
+ sh /build-scripts/retry-fetch.sh go -C "$module" mod download || exit $?; \
+ done
# Go source
COPY apps/image-service/ image-service/
@@ -42,7 +45,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
FROM alpine:3.22 AS registry-proxy
-RUN apk add --no-cache curl
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh curl
WORKDIR /usr/local/bin
diff --git a/apps/infra/deployment/composite-actions.test.ts b/apps/infra/deployment/composite-actions.test.ts
index 5720d2c54..faa8aac8b 100644
--- a/apps/infra/deployment/composite-actions.test.ts
+++ b/apps/infra/deployment/composite-actions.test.ts
@@ -275,6 +275,8 @@ for (const cached of [true, false]) {
const args = readFileSync(join(dir, 'args'), 'utf8').trim().split('\n')
assert.ok(args.includes(`${dir}:/work`), 'workspace mount must remain a single argument')
assert.ok(args.includes('quay.io/pypa/manylinux_2_28_aarch64'))
+ assert.ok(args.some((arg, index) => arg === '-e' && args[index + 1] === 'npm_config_fetch_retries'),
+ 'forward the host npm download retry setting to the Linux SDK build')
assert.equal(args.includes('SCCACHE_DIR=/cache/sccache'), cached)
assert.equal(args.includes('SCCACHE_GHA_ENABLED=false'), cached)
assert.equal(args.includes('RUSTC_WRAPPER=sccache'), cached)
diff --git a/apps/infra/deployment/draft-ci.test.ts b/apps/infra/deployment/draft-ci.test.ts
index 8bc919480..2ca935d3b 100644
--- a/apps/infra/deployment/draft-ci.test.ts
+++ b/apps/infra/deployment/draft-ci.test.ts
@@ -29,7 +29,7 @@ function context(event: string, draft = false, selected = true) {
String(evaluate(spec[suite], { github, steps: { filter: { outputs: filter } } }))]))
outputs['sdk-tests-enabled'] = String(evaluate(spec['sdk-tests-enabled'] ?? 'true', { github }))
outputs.infra = String(selected)
- return { github, needs: { changes: { result: 'success', outputs } } }
+ return { github, cancelled: () => false, needs: { changes: { result: 'success', outputs } } }
}
test('joining a native stack starts the required Test workflow', () => {
@@ -60,6 +60,52 @@ for (const [event, draft, expected] of [
})
}
+test('Go and Rust selection follows the artifacts each suite uses', () => {
+ const jobs = workflow().jobs
+ const ctx = context('pull_request')
+ ctx.needs.changes.outputs.rust = 'false'
+ const native = Object.entries<any>(jobs).filter(([id]) => id.startsWith('build-test-') || id === 'go' || id.startsWith('go-'))
+ for (const [id, job] of native) {
+ assert.equal(evaluate(job.if, ctx), true, id)
+ assert.equal(evaluate(job.if, context('pull_request', true)), false, id)
+ }
+ ctx.needs.changes.outputs.rust = 'true'
+ ctx.needs.changes.outputs.go = 'false'
+ for (const [id, job] of native) {
+ assert.equal(evaluate(job.if, ctx), ['build-test-guest', 'build-test-runtime'].includes(id), id)
+ }
+})
+
+test('a failed native producer blocks only tests that need its artifacts', () => {
+ const jobs = workflow().jobs
+ const jobId = (name: string, target: string) => {
+ const match = Object.keys(jobs).find(id =>
+ jobs[id].name?.replace('${{ matrix.platform.target }}', target) === `${name} (${target})`)
+ assert.ok(match, `${name} (${target})`)
+ return match
+ }
+ const waitsFor = (id: string, failed: string): boolean =>
+ id === failed || [jobs[id].needs ?? []].flat().some(parent => waitsFor(parent, failed))
+ const x64 = 'linux-x64-gnu'
+ const linuxArm = 'linux-arm64-gnu'
+ const macArm = 'darwin-arm64'
+ const targets = [x64, linuxArm, macArm]
+ for (const [producer, target, blockedGo] of [
+ ['Build Linux guest', x64, [x64]],
+ ['Build Linux guest', linuxArm, [linuxArm, macArm]],
+ ['Build native test inputs', x64, [x64]],
+ ['Go Tests', linuxArm, [linuxArm]],
+ ['Go Tests', macArm, [macArm]],
+ ] as const) {
+ const failed = jobId(producer, target)
+ assert.deepEqual(targets.filter(t => waitsFor(jobId('Go Tests', t), failed)), blockedGo, failed)
+ assert.equal(waitsFor('rust', failed), false, failed)
+ assert.equal(waitsFor('rust-copy-vm', failed), target === x64, failed)
+ assert.equal(waitsFor('serve-rest-e2e', failed), target === x64, failed)
+ assert.ok(waitsFor('test-conclusion', failed), failed)
+ }
+})
+
test('returning to draft cancels the same PR run instead of leaving the SDK matrix active', () => {
const concurrency = workflow().concurrency
const draft = context('pull_request', true)
@@ -93,6 +139,11 @@ test('workflow and infrastructure changes run hosted regressions even on drafts'
for (const path of ['apps/infra/deployment/draft-ci.test.ts', '.github/workflows/test.yml', '.github/actions/setup-go/action.yml', '.github/ci-config.json', 'Makefile', 'make/test.mk', 'make/coverage.mk', 'make/changes.mk']) {
assert.equal(matches(path), true, path)
}
+ assert.ok(infra.steps.some((step: any) => step.run === 'make test:unit:scripts'))
+ for (const path of ['scripts/build/download-archive.sh', 'scripts/build/build-libseccomp.sh', 'scripts/build/retry-fetch.sh',
+ 'scripts/build/install-apk.sh', 'scripts/setup/setup-common.sh', 'apps/proxy/Dockerfile', 'scripts/util.sh']) {
+ assert.equal(matches(path), true, path)
+ }
for (const path of ['docs/README.md', '.github/workflows/README.md', 'sdks/go/options.go']) {
assert.equal(matches(path), false, path)
}
diff --git a/apps/infra/deployment/native-cache.test.ts b/apps/infra/deployment/native-cache.test.ts
index 23f9e4f87..fdd6fbcbf 100644
--- a/apps/infra/deployment/native-cache.test.ts
+++ b/apps/infra/deployment/native-cache.test.ts
@@ -18,7 +18,7 @@ const picomatch: (patterns: string[]) => (path: string) => boolean = require('pi
const root = resolve(dirname(fileURLToPath(import.meta.url)), '../../..')
const yaml = (path: string): any => loadYaml(readFileSync(join(root, path), 'utf8'))
const action = (name: string) => yaml(`.github/actions/${name}/action.yml`)
-const goJob = () => yaml('.github/workflows/test.yml').jobs.go
+const nativeBuild = () => yaml('.github/workflows/test.yml').jobs['build-test-runtime']
const moduleCache = () => action('setup-go').runs.steps.find((step: any) => step.uses?.startsWith('actions/cache@'))
const evaluate = (value: string, context: any): string => value.replace(/\$\{\{\s*(.*?)\s*\}\}/g,
(_match, expression: string) => String(runInNewContext(
@@ -90,7 +90,7 @@ test('the module cache resolves only GOMODCACHE through the actual action shell'
})
test('Go native builds cache both the outer Cargo workspace and libkrun workspace', () => {
- const caller = goJob().steps.find((step: any) => step.uses === './.github/actions/setup-rust')
+ const caller = nativeBuild().steps.find((step: any) => step.uses === './.github/actions/setup-rust')
const manifest = action('setup-rust')
const inputs = Object.fromEntries(Object.entries<any>(manifest.inputs).map(([name, spec]) =>
[name, caller.with?.[name] ?? spec.default ?? '']))
@@ -103,13 +103,15 @@ test('Go native builds cache both the outer Cargo workspace and libkrun workspac
})
test('libkrun is checked out before Rust caching reads its workspace metadata', () => {
- const steps = goJob().steps
+ const steps = nativeBuild().steps
const checkout = steps.findIndex((step: any) => step.uses?.startsWith('actions/checkout@'))
const submodules = steps.findIndex((step: any) => step.run === 'make setup:submodules')
const rust = steps.findIndex((step: any) => step.uses === './.github/actions/setup-rust')
assert.ok(checkout >= 0 && checkout < submodules && submodules < rust,
'cache metadata needs the pinned libkrun checkout before setup-rust')
- assert.ok(steps.some((step: any) => step.run === 'make coverage:go'), 'every run must still rebuild as needed and execute coverage')
+ assert.ok(steps.some((step: any) => step.run?.includes('make build:go:archive')))
+ assert.ok(yaml('.github/workflows/test.yml').jobs.go.steps.some((step: any) =>
+ step.run === 'make coverage:go' && step.env.GO_TEST_ARCHIVE_READY === '1'))
})
// A module whose `go` directive exceeds the installed toolchain makes GOTOOLCHAIN
diff --git a/apps/infra/deployment/nested-runtime-coverage.test.ts b/apps/infra/deployment/nested-runtime-coverage.test.ts
index b0c2225e9..14e36680e 100644
--- a/apps/infra/deployment/nested-runtime-coverage.test.ts
+++ b/apps/infra/deployment/nested-runtime-coverage.test.ts
@@ -2,9 +2,7 @@
// Copyright (c) 2026 BoxLite AI
import assert from 'node:assert/strict'
-import { spawnSync } from 'node:child_process'
-import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
-import { tmpdir } from 'node:os'
+import { readFileSync } from 'node:fs'
import { dirname, join, resolve } from 'node:path'
import test from 'node:test'
import { fileURLToPath } from 'node:url'
@@ -14,71 +12,25 @@ import { load as loadYaml } from 'js-yaml'
const root = resolve(dirname(fileURLToPath(import.meta.url)), '../../..')
const workflow: any = loadYaml(readFileSync(join(root, '.github/workflows/test.yml'), 'utf8'))
const steps = workflow.jobs.go.steps
-const qualify = steps.find((step: any) => step.id === 'nested-runtime-coverage')
-const modules = ['go-sdk', 'gvproxy', 'runner', 'image-service', 'secret-server']
-test('nested metadata qualification runs after full coverage and only on Linux x64', () => {
- assert.ok(qualify)
- assert.ok(steps.indexOf(qualify) > steps.findIndex((step: any) => step.run === 'make coverage:go'))
- assert.ok(steps.indexOf(qualify) < steps.findIndex((step: any) => step.uses?.startsWith('codecov/codecov-action@')))
+test('only named native tests get KVM after the full Go coverage pass', () => {
+ const passes = steps.filter((step: any) => step.run?.includes('make coverage:go'))
+ assert.equal(passes.length, 1, 'a second coverage pass rebuilds all five modules')
+ const [coverage] = passes
+ const qualify = steps.find((step: any) => step.run?.includes('make _ensure-kvm'))
+ assert.ok(qualify && steps.indexOf(qualify) > steps.indexOf(coverage), 'the ordinary Runner tests must run before granting KVM access')
+ assert.match(qualify.run, /sudo chmod a\+rw \/dev\/kvm\s+make _ensure-kvm/)
+ assert.equal(qualify['continue-on-error'], undefined)
+ assert.equal(coverage.run, 'make coverage:go')
+ assert.match(qualify.run, /make _coverage-go-kvm/)
+ assert.equal(qualify.env.BOXLITE_REQUIRE_NESTED_RUNTIME_TESTS, '1')
+ assert.equal(qualify.env.BOXLITE_REQUIRE_RUNNER_SHUTDOWN_TEST, '1')
+ const deferred = coverage.env.GO_COVERAGE_DEFER_KVM.replace(/^\$\{\{\s*|\s*\}\}$/g, '')
+ const tags = coverage.env.GO_SDK_COVERAGE_TAGS.replace(/^\$\{\{\s*|\s*\}\}$/g, '')
for (const target of ['linux-x64-gnu', 'linux-arm64-gnu', 'darwin-arm64']) {
- assert.equal(runInNewContext(qualify.if, { matrix: { platform: { target } } }, { timeout: 1000 }), target === 'linux-x64-gnu')
+ const context = { matrix: { platform: { target } } }
+ assert.equal(runInNewContext(qualify.if, context), target === 'linux-x64-gnu')
+ assert.equal(runInNewContext(tags, context), target === 'linux-x64-gnu' ? 'boxlite_runner,boxlite_ssh_usage_test' : 'boxlite_runner')
+ assert.equal(runInNewContext(deferred, context) === '1', target === 'linux-x64-gnu')
}
})
-
-for (const [name, available, focusedMode, fullMode] of [
- ['preserves both successful passes', true, 'atomic', 'atomic'],
- ['fails when KVM is unavailable', false, 'atomic', 'atomic'],
- ['rejects a non-atomic focused profile', true, 'set', 'atomic'],
- ['rejects a non-atomic full profile', true, 'atomic', 'count'],
-] as const) {
- test(`nested metadata coverage ${name}`, () => {
- const directory = mkdtempSync(join(tmpdir(), 'boxlite-nested-coverage-'))
- try {
- const bin = join(directory, 'bin')
- mkdirSync(bin)
- mkdirSync(join(directory, 'target/coverage'), { recursive: true })
- for (const module of modules) {
- writeFileSync(join(directory, `target/coverage/${module}.out`), `mode: ${fullMode}\nexample/${module}/source.go:1.1,1.2 1 3\n`)
- }
- writeFileSync(join(bin, 'sudo'), '#!/usr/bin/env bash\nprintf "%s\\n" "$*" > sudo.log\n', { mode: 0o755 })
- writeFileSync(join(bin, 'make'), `#!/usr/bin/env bash
-set -euo pipefail
-printf '%s\\n' "$*" >> make.log
-if [[ "$1" == '_ensure-kvm' ]]; then
- [[ "$NESTED_TEST_KVM_AVAILABLE" == 'true' ]]
- exit
-fi
-[[ "$1" == 'coverage:go' ]]
-[[ "$2" == 'GO_SDK_COVERAGE_TAGS=boxlite_runner,boxlite_integration' ]]
-[[ "$3" == "GOTEST_FILTER=-count=1 -run 'NestedVirtualization|SSHUsageConfiguredLocal|TestRunnerDrainsPollOnSIGTERM'" ]]
-[[ "$BOXLITE_REQUIRE_NESTED_RUNTIME_TESTS" == '1' ]]
-[[ "$BOXLITE_REQUIRE_RUNNER_SHUTDOWN_TEST" == '1' ]]
-for module in go-sdk gvproxy runner image-service secret-server; do
- printf 'mode: %s\\nexample/%s/source.go:2.1,2.2 1 5\\n' "$NESTED_TEST_FOCUSED_MODE" "$module" > "target/coverage/$module.out"
-done
-`, { mode: 0o755 })
- const result = spawnSync('bash', ['-eo', 'pipefail', '-c', qualify.run], {
- cwd: directory,
- env: { ...process.env, ...qualify.env, PATH: `${bin}:${process.env.PATH}`, NESTED_TEST_KVM_AVAILABLE: String(available), NESTED_TEST_FOCUSED_MODE: focusedMode },
- encoding: 'utf8', timeout: 10_000,
- })
- assert.equal(result.error, undefined)
- const succeeds = available && focusedMode === 'atomic' && fullMode === 'atomic'
- assert.equal(result.status === 0, succeeds, result.stderr)
- assert.equal(readFileSync(join(directory, 'sudo.log'), 'utf8'), 'chmod a+rw /dev/kvm\n')
- const calls = readFileSync(join(directory, 'make.log'), 'utf8')
- assert.equal(calls.includes('coverage:go'), available)
- for (const module of modules) {
- const original = `mode: ${fullMode}\nexample/${module}/source.go:1.1,1.2 1 3\n`
- assert.equal(readFileSync(join(directory, `target/coverage/full-go/${module}.out`), 'utf8'), original)
- if (succeeds) {
- assert.equal(readFileSync(join(directory, `target/coverage/${module}.out`), 'utf8'),
- `mode: atomic\nexample/${module}/source.go:2.1,2.2 1 5\nexample/${module}/source.go:1.1,1.2 1 3\n`)
- }
- }
- } finally {
- rmSync(directory, { recursive: true, force: true })
- }
- })
-}
diff --git a/apps/infra/deployment/release-safety.test.ts b/apps/infra/deployment/release-safety.test.ts
index f34b80fa5..9f561c905 100644
--- a/apps/infra/deployment/release-safety.test.ts
+++ b/apps/infra/deployment/release-safety.test.ts
@@ -1309,14 +1309,15 @@ test('commit Runner builds consume the C SDK artifact from the same reusable run
// fallback still parses.
const cValidateRun = cWorkflow.jobs['resolve-ref'].steps.find((step: any) => step.name === 'Validate build commit')?.run
assert.ok(cValidateRun, 'build-c.yml lost its Validate build commit step')
- assert.match(cValidateRun, /^\s*git cat-file -e "\$candidate\^\{commit\}" 2>\/dev\/null \|\| git fetch origin "\$candidate"/m)
+ const fetchMissing = /^\s*git cat-file -e "\$candidate\^\{commit\}" 2>\/dev\/null \|\| sh scripts\/build\/retry-fetch\.sh git fetch origin "\$candidate"/m
+ assert.match(cValidateRun, fetchMissing)
const runnerValidateRun = runnerWorkflow.jobs['resolve-ref'].steps.find(
(step: any) => step.name === 'Validate build commit',
)?.run
assert.ok(runnerValidateRun, 'build-runner-binary.yml lost its Validate build commit step')
assert.match(
runnerValidateRun,
- /^\s*git cat-file -e "\$candidate\^\{commit\}" 2>\/dev\/null \|\| git fetch origin "\$candidate"/m,
+ fetchMissing,
)
// The upload/download names are the handshake between the two runs: build-c publishes
diff --git a/apps/infra/deployment/test-build-artifacts.test.ts b/apps/infra/deployment/test-build-artifacts.test.ts
new file mode 100644
index 000000000..389167144
--- /dev/null
+++ b/apps/infra/deployment/test-build-artifacts.test.ts
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 BoxLite AI
+
+import assert from 'node:assert/strict'
+import { execFileSync, spawnSync } from 'node:child_process'
+import { lstatSync, mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { dirname, join, resolve } from 'node:path'
+import test from 'node:test'
+import { fileURLToPath } from 'node:url'
+import { data, Evaluator, Lexer, Parser } from '@actions/expressions'
+import { load } from 'js-yaml'
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '../../..')
+const yaml = (path: string): any => load(readFileSync(join(root, '.github', path), 'utf8'))
+
+test('Go tests wait for matching native inputs and the Rust matrix starts after selection', (t) => {
+ const jobs = yaml('workflows/test.yml').jobs
+ const { platforms } = JSON.parse(readFileSync(join(root, '.github/ci-config.json'), 'utf8'))
+ const goJobs = Object.entries<any>(jobs).filter(([, job]) => job.name?.startsWith('Go Tests'))
+ const select = jobs.changes.steps.find((s: any) => s.id === 'native').run
+ const work = mkdtempSync(join(tmpdir(), 'native-matrix-'))
+ t.after(() => rmSync(work, { recursive: true, force: true }))
+ const file = join(work, 'output')
+ execFileSync('bash', ['-e', '-c', select], { env: { ...process.env, GITHUB_OUTPUT: file, PLATFORMS: JSON.stringify(platforms) } })
+ const outputs = Object.fromEntries(readFileSync(file, 'utf8').trim().split('\n').map(line => line.split('=')))
+ function evaluate(expression: string, context: object) {
+ const ast = new Parser(new Lexer(expression.slice(3, -2)).lex().tokens, Object.keys(context), []).parse()
+ return new Evaluator(ast, JSON.parse(JSON.stringify(context), data.reviver)).evaluate()
+ }
+ const native = Object.fromEntries(Object.entries<string>(jobs.changes.outputs)
+ .filter(([, value]) => value.includes('steps.native.outputs.'))
+ .map(([key, value]) => [key, evaluate(value, { steps: { native: { outputs } } }).coerceString()]))
+ const platform = (id: string) => {
+ const matrix = evaluate(jobs[id].strategy.matrix.platform, { needs: { changes: { outputs: native } } }) as data.Array
+ assert.equal(matrix.values().length, 1, id + ' must have one platform per dependency')
+ return (matrix.values()[0] as data.Dictionary).get('target')?.coerceString()
+ }
+ const targets = []
+ for (const [id, job] of goJobs) {
+ const target = platform(id)
+ targets.push(target)
+ const x64 = target === 'linux-x64-gnu'
+ const guest = x64 ? 'build-test-guest' : 'build-test-guest-arm64'
+ assert.deepEqual(job.needs, ['changes', x64 ? 'build-test-runtime' : guest], target)
+ assert.equal(jobs[guest].needs, 'changes')
+ assert.equal(platform(guest), target === 'darwin-arm64' ? 'linux-arm64-gnu' : target)
+ for (const required of [id, guest]) assert.ok(jobs['test-conclusion'].needs.includes(required), required)
+ if (!x64) {
+ const transfers = job.steps.filter((step: any) => /actions\/(upload|download)-artifact@/.test(step.uses ?? ''))
+ const sharedGuest = jobs[guest].steps.find((step: any) => step.uses?.startsWith('actions/upload-artifact@'))
+ assert.deepEqual(transfers.map((step: any) => step.with.name), [sharedGuest.with.name])
+ const assemble = job.steps.findIndex((step: any) => step.run?.includes('SKIP_GUEST_BUILD=1 make runtime:debug'))
+ const archive = job.steps.findIndex((step: any) => step.run?.includes('make build:go:archive'))
+ const coverage = job.steps.findIndex((step: any) => step.run === 'make coverage:go' && step.env.GO_TEST_ARCHIVE_READY === '1')
+ assert.ok(job.steps.indexOf(transfers[0]) < assemble && assemble < archive && archive < coverage, id)
+ }
+ }
+ assert.deepEqual(targets.sort(), platforms.map((p: any) => p.target).sort())
+ const rust = jobs.rust
+ assert.equal(rust.needs, 'changes')
+ const config = { outputs: { platforms: JSON.stringify(platforms) } }
+ const configured = evaluate(jobs.changes.outputs.platforms, { steps: { config } }).coerceString()
+ const matrix = evaluate(rust.strategy.matrix.platform, { needs: { changes: { outputs: { platforms: configured } } } }) as data.Array
+ assert.deepEqual(matrix.values().map(p => (p as data.Dictionary).get('target')?.coerceString()).sort(), targets.sort())
+ assert.equal(rust.strategy['fail-fast'], false)
+ assert.ok(jobs['test-conclusion'].needs.includes('rust'))
+})
+
+test('real VM suites share the runtime from their build job', () => {
+ const jobs = yaml('workflows/test.yml').jobs
+ const producer = jobs['build-test-runtime']
+ const upload = producer.steps.find((s: any) => s.with?.path?.endsWith('/runtime.tar.zst'))
+ assert.ok(producer.needs.includes('build-test-guest'))
+ assert.equal(jobs['build-test-guest'].steps.find((s: any) => s.uses?.startsWith('actions/upload-artifact')).with.name,
+ producer.steps.find((s: any) => s.uses?.startsWith('actions/download-artifact')).with.name)
+ for (const job of ['rust-copy-vm', 'go', 'serve-rest-e2e']) {
+ assert.ok(jobs[job], job)
+ const restore = jobs[job].steps.find((s: any) => s.uses === './.github/actions/restore-debug-runtime')
+ assert.ok(restore, job + ' still assembles its own x64 runtime')
+ assert.ok(jobs[job].needs.includes('build-test-runtime'))
+ assert.equal(restore.with.name, job === 'go' ? upload.with.name : upload.with.name.replace('${{ matrix.platform.target }}', 'linux-x64-gnu'))
+ }
+ const copy = jobs['rust-copy-vm']
+ const run = copy.steps.findIndex((s: any) => s.run === 'make coverage:copy:vm')
+ const uploadCoverage = copy.steps.findIndex((s: any) => s.uses?.startsWith('codecov/') &&
+ s.with.files === 'target/coverage/lcov.info' && s.with.flags === 'rust-unit' && s.with.fail_ci_if_error)
+ assert.ok(run > copy.steps.findIndex((s: any) => s.uses === './.github/actions/restore-debug-runtime') && uploadCoverage > run)
+ assert.equal(copy.if, jobs.rust.if)
+ assert.ok(!jobs.rust.steps.some((s: any) => s.run?.includes('make coverage:copy:vm') || s.uses === './.github/actions/restore-debug-runtime'))
+ assert.ok(jobs['test-conclusion'].needs.includes('rust-copy-vm'))
+ assert.ok(jobs['test-conclusion'].needs.includes('build-test-runtime'))
+ assert.ok(jobs['test-conclusion'].needs.includes('build-test-guest'))
+ for (const [consumer, name] of [['go', 'test-go-${{ matrix.platform.target }}'], ['serve-rest-e2e', 'test-rest-linux-x64-gnu']]) {
+ assert.ok(producer.steps.some((s: any) => s.uses?.startsWith('actions/upload-artifact') && s.with.name === name))
+ assert.ok(jobs[consumer].steps.some((s: any) => s.uses?.startsWith('actions/download-artifact') && s.with.name === name))
+ assert.ok(!jobs[consumer].steps.some((s: any) => s.uses === './.github/actions/setup-rust' || /make (setup:build|runtime:debug)/.test(s.run ?? '')))
+ }
+})
+
+test('runtime transfer preserves linked binaries after the build tree disappears', (t) => {
+ const build = yaml('workflows/test.yml').jobs['build-test-runtime']
+ const pack = build.steps.find((s: any) => s.id === 'pack').run
+ const unpack = yaml('actions/restore-debug-runtime/action.yml').runs.steps.find((s: any) => s.run).run
+ const work = mkdtempSync(join(tmpdir(), 'test-runtime-'))
+ t.after(() => rmSync(work, { recursive: true, force: true }))
+ const runtime = join(work, 'target/debug/runtime')
+ mkdirSync(runtime, { recursive: true })
+ writeFileSync(join(work, 'guest'), 'guest bytes', { mode: 0o755 })
+ for (const name of ['boxlite-shim', 'boxlite-guest', 'guest-mke2fs', 'guest-resize2fs']) {
+ symlinkSync('../../../guest', join(runtime, name))
+ }
+ const env = { ...process.env, RUNNER_TEMP: work, GITHUB_ENV: join(work, 'env'), GITHUB_OUTPUT: join(work, 'output'), GITHUB_RUN_ATTEMPT: '1' }
+ const run = (script: string) => execFileSync('bash', ['-eo', 'pipefail', '-c', script], { cwd: work, env, stdio: 'pipe' })
+ run(pack)
+ rmSync(join(work, 'target'), { recursive: true })
+ rmSync(join(work, 'guest'))
+ run(unpack)
+ const directory = readFileSync(env.GITHUB_ENV, 'utf8').match(/^BOXLITE_RUNTIME_DIR=(.+)$/m)?.[1]
+ assert.ok(directory)
+ const guest = join(directory, 'boxlite-guest')
+ assert.equal(readFileSync(guest, 'utf8'), 'guest bytes')
+ assert.ok(lstatSync(guest).isFile() && (lstatSync(guest).mode & 0o111) !== 0)
+ assert.match(readFileSync(env.GITHUB_ENV, 'utf8'), /^SETUP_DONE=1$/m)
+ assert.throws(() => run(pack), 'a missing runtime directory must fail the producer')
+ mkdirSync(runtime, { recursive: true })
+ writeFileSync(join(runtime, 'boxlite-guest'), 'partial runtime')
+ run(pack)
+ assert.throws(() => run(unpack), 'a partial archive must fail before consumers skip setup')
+})
+
+test('Node smoke tests reuse the TypeScript in the packed or restored Linux x64 npm package', (t) => {
+ const jobs = yaml('workflows/build-node.yml').jobs
+ const steps = Object.values<any>(jobs).flatMap(job => job.steps ?? [])
+ const compilers = steps.filter(step => /^\s*npm run build\s*$/m.test(step.run ?? ''))
+ assert.equal(compilers.length, 1, 'only the main npm package should compile TypeScript')
+ assert.ok(jobs.build.steps.includes(compilers[0]))
+ assert.match(compilers[0].run, /npm pack --pack-destination/)
+
+ const download = jobs.test.steps.find((s: any) => s.uses?.startsWith('actions/download-artifact') && s.with.path === 'sdks/node/dist')
+ assert.ok(jobs.test.needs.includes('build') && download)
+ const upload = jobs.build.steps.find((s: any) => s.uses?.startsWith('actions/upload-artifact') && s.with.name === download.with.name)
+ assert.ok(upload)
+ assert.equal(upload.if, "matrix.target == 'linux-x64-gnu'")
+ const extract = jobs.build.steps.find((s: any) => s.run?.includes('package/dist'))
+ assert.ok(extract, 'a restored npm package must supply the smoke test files even when packing is skipped')
+ assert.equal(extract.if, upload.if)
+ assert.ok(jobs.build.steps.indexOf(compilers[0]) < jobs.build.steps.indexOf(extract))
+ assert.ok(jobs.build.steps.indexOf(extract) < jobs.build.steps.indexOf(upload))
+ const work = mkdtempSync(join(tmpdir(), 'node-package-dist-'))
+ t.after(() => rmSync(work, { recursive: true, force: true }))
+ const sdk = join(work, extract['working-directory'])
+ mkdirSync(join(sdk, 'packages'), { recursive: true })
+ symlinkSync(join(root, 'sdks/node/package.json'), join(sdk, 'package.json'))
+ mkdirSync(join(sdk, 'dist'))
+ writeFileSync(join(sdk, 'dist/index.js'), 'compiled SDK')
+ execFileSync('npm', ['pack', '--ignore-scripts', '--pack-destination', 'packages'], { cwd: sdk, stdio: 'pipe' })
+ rmSync(join(sdk, 'dist'), { recursive: true })
+ execFileSync('bash', ['-eu', '-c', extract.run], { cwd: sdk })
+ assert.equal(readFileSync(join(work, upload.with.path, 'index.js'), 'utf8'), 'compiled SDK')
+})
+
+test('release Runner retries only the failed module download up to three times', (t) => {
+ const steps = Object.values<any>(yaml('workflows/build-runner-binary.yml').jobs).flatMap(job => job.steps)
+ const download = steps.find(s => s.name === 'Download Go dependencies').run
+ const work = mkdtempSync(join(tmpdir(), 'go-download-'))
+ t.after(() => rmSync(work, { recursive: true, force: true }))
+ symlinkSync(root, join(work, '.ci-tools'))
+ writeFileSync(join(work, 'sleep'), '#!/bin/sh\nexit 0\n', { mode: 0o755 })
+ writeFileSync(join(work, 'go'), `#!/bin/sh
+echo "$2" >> "$LOG"
+case "$2" in
+ apps/runner) [ "$(wc -l < "$LOG")" -gt "$FAILURES" ] || exit 22 ;;
+esac
+`, { mode: 0o755 })
+ for (const failures of [0, 3, 4]) {
+ const log = join(work, 'log-' + failures)
+ const run = spawnSync('bash', ['-eu', '-c', download], {
+ cwd: work, env: { ...process.env, PATH: work + ':' + process.env.PATH, LOG: log, FAILURES: String(failures) },
+ })
+ const modules = readFileSync(log, 'utf8').trim().split('\n')
+ assert.equal(modules.filter(m => m === 'apps/runner').length, Math.min(failures + 1, 4))
+ assert.deepEqual(modules.filter(m => m !== 'apps/runner'), failures < 4 ? ['apps/libs/common-go', 'apps/libs/api-client-go'] : [])
+ assert.equal(run.status, failures < 4 ? 0 : 22)
+ }
+})
diff --git a/apps/infra/deployment/workflow-checks.test.ts b/apps/infra/deployment/workflow-checks.test.ts
index f957b3821..2c8458e13 100644
--- a/apps/infra/deployment/workflow-checks.test.ts
+++ b/apps/infra/deployment/workflow-checks.test.ts
@@ -179,6 +179,10 @@ test('SDK test documentation does not rebuild SDKs: sdks/python/tests/README.md'
assert.deepEqual(testSuites(['sdks/python/tests/README.md']), [])
})
+test('changing only the Python packaging configuration selects the Python and infra suites', () => {
+ assert.deepEqual(testSuites(['sdks/python/pyproject.toml']), ['python', 'infra'])
+})
+
// The infra job runs the script tests on any tests/scripts change; that
// directory's prose still builds no SDK.
test('script test documentation selects only the infra suite: tests/scripts/README.md', () => {
@@ -746,6 +750,15 @@ test('invalid image selections fail before any Docker invocation', () => {
}
})
+test('Linux wheel containers receive the release workflow download retries', () => {
+ const project = parseToml(readFileSync(join(REPO_ROOT, 'sdks/python/pyproject.toml'), 'utf8')) as any
+ const pass = project.tool.cibuildwheel.linux['environment-pass'] as string[]
+ for (const name of ['PIP_RETRIES', 'UV_HTTP_RETRIES']) {
+ assert.equal(workflow('build-wheels.yml').env[name], '3')
+ assert.ok(pass.includes(name), `wheel container must inherit ${name}`)
+ }
+})
+
for (const sharedCache of [true, false]) {
for (const source of ['host', 'pip', 'unavailable'] as const) {
test(`wheel cache setup: shared=${sharedCache}, source=${source}`, () => {
diff --git a/apps/infra/scripts/release-workflow.test.mjs b/apps/infra/scripts/release-workflow.test.mjs
index e04d05895..9705b89bf 100644
--- a/apps/infra/scripts/release-workflow.test.mjs
+++ b/apps/infra/scripts/release-workflow.test.mjs
@@ -123,8 +123,10 @@ test('only a full retry can restore, while fresh and selected jobs build and upl
assert.equal(cache.with.dependency, save.with.dependency)
assert.match(cache.if, /build_plan != ''/)
assert.match(save.if, /steps.cache.outputs.hit != 'true'/)
- for (const step of producer.steps.filter(step => step.uses?.startsWith('actions/upload-artifact@')))
- assert.equal(step.if, undefined, 'publish current-attempt artifacts on either build or restore')
+ for (const step of producer.steps.filter(step => step.uses?.startsWith('actions/upload-artifact@'))) {
+ const platform = step.with.name === 'node-sdk-dist' ? "matrix.target == 'linux-x64-gnu'" : undefined
+ assert.equal(step.if, platform, 'publish every applicable artifact on both fresh builds and cache hits')
+ }
assert.ok(producer.steps.some(step => step.name?.startsWith('Build cache receipt ') && step.if))
}
})
diff --git a/apps/otel-collector/Dockerfile b/apps/otel-collector/Dockerfile
index 609b5e7b6..cb6dcd903 100644
--- a/apps/otel-collector/Dockerfile
+++ b/apps/otel-collector/Dockerfile
@@ -2,19 +2,19 @@ FROM node:22-alpine AS build
ENV CI=true
-RUN npm install -g corepack && corepack enable
+RUN npm --fetch-retries=3 install -g corepack && corepack enable
COPY --from=golang:1.25.4-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
-RUN apk add --no-cache git
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh git
WORKDIR /boxlite/apps
# Yarn caching layer
COPY apps/package.json apps/yarn.lock apps/.yarnrc.yml ./
-RUN yarn install --immutable
+RUN YARN_HTTP_RETRY=3 yarn install --immutable
# Nx config
COPY apps/nx.json ./
@@ -29,9 +29,10 @@ RUN head -1 go.work > go.work.tmp && printf '\nuse (\n\t./otel-collector/exporte
ENV NX_DAEMON=false
ENV GOWORK=/boxlite/apps/go.work
-RUN go -C otel-collector/exporter mod download && \
- go -C libs/api-client-go mod download && \
- go -C libs/common-go mod download
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts \
+ for module in otel-collector/exporter libs/api-client-go libs/common-go; do \
+ sh /build-scripts/retry-fetch.sh go -C "$module" mod download || exit $?; \
+ done
# Go source
COPY apps/otel-collector/ otel-collector/
@@ -43,7 +44,7 @@ RUN yarn nx build otel-collector --configuration=production --nxBail=true
FROM alpine:3.22 AS otel-collector
-RUN apk add --no-cache curl
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh curl
WORKDIR /usr/local/bin
diff --git a/apps/proxy/Dockerfile b/apps/proxy/Dockerfile
index 8cbfea77e..3b16f3156 100644
--- a/apps/proxy/Dockerfile
+++ b/apps/proxy/Dockerfile
@@ -2,19 +2,19 @@ FROM node:22-alpine AS build
ENV CI=true
-RUN npm install -g corepack && corepack enable
+RUN npm --fetch-retries=3 install -g corepack && corepack enable
COPY --from=golang:1.25.4-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
-RUN apk add --no-cache git
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh git
WORKDIR /boxlite/apps
# Yarn caching layer
COPY apps/package.json apps/yarn.lock apps/.yarnrc.yml ./
-RUN yarn install --immutable
+RUN YARN_HTTP_RETRY=3 yarn install --immutable
# Nx config
COPY apps/nx.json ./
@@ -29,7 +29,10 @@ RUN head -1 go.work > go.work.tmp && printf '\nuse (\n\t./proxy\n\t./libs/common
ENV NX_DAEMON=false
ENV GOWORK=/boxlite/apps/go.work
-RUN go -C proxy mod download && go -C libs/common-go mod download && go -C libs/api-client-go mod download
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts \
+ for module in proxy libs/common-go libs/api-client-go; do \
+ sh /build-scripts/retry-fetch.sh go -C "$module" mod download || exit $?; \
+ done
# Go source
COPY apps/proxy/ proxy/
@@ -42,7 +45,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
FROM alpine:3.22 AS proxy
-RUN apk add --no-cache curl
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh curl
WORKDIR /usr/local/bin
diff --git a/apps/runner/Dockerfile b/apps/runner/Dockerfile
index 70ebf3a14..6119d702b 100644
--- a/apps/runner/Dockerfile
+++ b/apps/runner/Dockerfile
@@ -2,19 +2,19 @@ FROM node:22-alpine AS build
ENV CI=true
-RUN npm install -g corepack && corepack enable
+RUN npm --fetch-retries=3 install -g corepack && corepack enable
COPY --from=golang:1.25.4-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
-RUN apk add --no-cache git build-base
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh git build-base
WORKDIR /boxlite
# Yarn caching layer
COPY apps/package.json apps/yarn.lock apps/.yarnrc.yml ./
-RUN yarn install --immutable
+RUN YARN_HTTP_RETRY=3 yarn install --immutable
# Nx config
COPY apps/nx.json ./
@@ -31,9 +31,10 @@ RUN head -1 apps/go.work > apps/go.work.tmp && printf '\nuse (\n\t./runner\n\t./
ENV NX_DAEMON=false
-RUN go -C apps/runner mod download \
- && go -C apps/libs/common-go mod download \
- && go -C apps/libs/api-client-go mod download
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts \
+ for module in apps/runner apps/libs/common-go apps/libs/api-client-go; do \
+ sh /build-scripts/retry-fetch.sh go -C "$module" mod download || exit $?; \
+ done
# BoxLite static library and headers
COPY sdks/go/ sdks/go/
@@ -55,7 +56,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
# Runtime — lightweight Linux with KVM support
FROM alpine:3.22 AS runner
-RUN apk add --no-cache curl
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts sh /build-scripts/install-apk.sh curl
WORKDIR /usr/local/bin
diff --git a/apps/runner/packaging/dev-artifact.Dockerfile b/apps/runner/packaging/dev-artifact.Dockerfile
index 9359102b3..70753bd2d 100644
--- a/apps/runner/packaging/dev-artifact.Dockerfile
+++ b/apps/runner/packaging/dev-artifact.Dockerfile
@@ -11,8 +11,8 @@ ENV CI=true
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH=/root/.cargo/bin:/usr/local/go/bin:${PATH}
-RUN apt-get update \
- && apt-get install -y --no-install-recommends ca-certificates curl git make libx11-dev libxtst-dev libxinerama-dev \
+RUN apt-get -o Acquire::Retries=3 -o APT::Update::Error-Mode=any update \
+ && apt-get install -y -o Acquire::Retries=3 --no-install-recommends ca-certificates curl git make libx11-dev libxtst-dev libxinerama-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /work
@@ -49,10 +49,11 @@ RUN SKIP_GUEST_BUILD=1 make runtime \
# Keep the production Runner's deliberately small Go workspace rather than making its build depend
# on every Go module in apps/.
-RUN printf 'go 1.25.4\n\nuse (\n\t./runner\n\t./libs/common-go\n\t./libs/api-client-go\n\t../sdks/go\n)\n' > apps/go.work \
- && go -C apps/runner mod download \
- && go -C apps/libs/common-go mod download \
- && go -C apps/libs/api-client-go mod download
+RUN printf 'go 1.25.4\n\nuse (\n\t./runner\n\t./libs/common-go\n\t./libs/api-client-go\n\t../sdks/go\n)\n' > apps/go.work
+RUN --mount=type=bind,source=scripts/build,target=/build-scripts \
+ for module in apps/runner apps/libs/common-go apps/libs/api-client-go; do \
+ sh /build-scripts/retry-fetch.sh go -C "$module" mod download || exit $?; \
+ done
ARG BUILD_REF
ARG VERSION
diff --git a/apps/runner/pkg/boxlite/nested_virtualization_test.go b/apps/runner/pkg/boxlite/nested_virtualization_test.go
index 70753ba2f..a9422badf 100644
--- a/apps/runner/pkg/boxlite/nested_virtualization_test.go
+++ b/apps/runner/pkg/boxlite/nested_virtualization_test.go
@@ -4,6 +4,7 @@ package boxlite
import (
"os"
+ "strings"
"testing"
sdk "github.com/boxlite-ai/boxlite/sdks/go"
@@ -48,14 +49,24 @@ func TestNestedVirtualizationRunnerCreateAndReplay(t *testing.T) {
}
func TestNestedVirtualizationRunnerRejectsInvalidFeatures(t *testing.T) {
- for _, value := range []string{"unknown", "nested-virtualization,", ",nested-virtualization", "nested-virtualization\x00"} {
- client, err := NewClient(t.Context(), ClientConfig{HomeDir: t.TempDir(), ExperimentalFeatures: value})
- if client != nil {
- client.Close()
- }
- if err == nil {
- t.Errorf("accepted invalid experimental features %q", value)
- }
+ for _, tc := range []struct {
+ name, features, wantError string
+ }{
+ {"unknown name", "unknown", "unknown feature 'unknown'"},
+ {"trailing comma", "nested-virtualization,", "experimental feature names cannot be empty"},
+ {"leading comma", ",nested-virtualization", "experimental feature names cannot be empty"},
+ {"embedded NUL", "nested-virtualization\x00", "experimental feature names cannot contain NUL"},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ client, err := NewClient(t.Context(), ClientConfig{HomeDir: t.TempDir(), ExperimentalFeatures: tc.features})
+ if client != nil {
+ client.Close()
+ t.Fatalf("NewClient(%q) returned a client", tc.features)
+ }
+ if err == nil || !strings.Contains(err.Error(), tc.wantError) {
+ t.Fatalf("NewClient(%q): got %v, want error containing %q", tc.features, err, tc.wantError)
+ }
+ })
}
}
diff --git a/docs/contributing/development/building.md b/docs/contributing/development/building.md
index 139f7590f..068975619 100644
--- a/docs/contributing/development/building.md
+++ b/docs/contributing/development/building.md
@@ -129,3 +129,13 @@ scripts/
The Build Runtime workflow packages Cargo's runtime in the build environment,
including inside manylinux on Linux. It resolves links there and leaves a
`boxlite-runtime-v<version>-<target>.tar.gz` archive for the runner to upload.
+
+Firmware, prebuilt runtime, libseccomp and kernel-header downloads retry a failed
+transfer up to three times, waiting 1, 2 and 4 seconds between attempts. Each
+attempt starts at the original URL so it can follow a fresh release redirect.
+Firmware, libseccomp and kernel headers must match their pinned SHA-256 before
+extraction. A checksum mismatch stops the build immediately.
+
+An unset or empty `BOXLITE_CACHE` keeps downloaded firmware in the caller's build output directory.
+The build hashes archive contents directly. Cache paths can contain backslashes
+and, on Linux, non-UTF-8 bytes.
diff --git a/make/coverage.mk b/make/coverage.mk
index 0234e596a..317c270e3 100644
--- a/make/coverage.mk
+++ b/make/coverage.mk
@@ -59,7 +59,7 @@ coverage\:bindings:
# Language tests exercise the exported bindings that Rust lib tests cannot see.
# Keep their profiles separate from the core collector and upload both reports.
-coverage\:bindings\:external: test\:unit\:scripts
+coverage\:bindings\:external: $(if $(filter 1,$(CI_SCRIPT_TESTS_SEPARATE)),,test\:unit\:scripts)
@bash $(SCRIPT_DIR)/test/coverage-bindings.sh
# Render collected profiles, including partial results from a failed test run.
@@ -90,23 +90,43 @@ coverage\:vmm\:boot: _ensure-kvm _ensure-vmm-kernel $(VMM_BALLOON_INIT) $(VMM_DI
GO_SDK_COVERAGE_TAGS ?= boxlite_runner
+# These tests need a real local runtime. CI defers them until KVM is available.
+GO_SDK_KVM_TESTS := ^Test(NestedVirtualizationCreate(Authorization|PersistsAcrossRuntimeReopen)|SSHUsageConfiguredLocalBoxReturnsOwnedEmptyBatchWithoutBoot)$$
+GO_RUNNER_KVM_TESTS := ^Test(NestedVirtualization(RunnerCreateAndReplay|UnavailableFallsBackOnCreate|RunnerCombinesKernelAndNesting)|RunnerDrainsPollOnSIGTERM)$$
# Go's reports include every package, including packages with no tests.
coverage\:go:
+ifeq ($(GO_TEST_ARCHIVE_READY),1)
+ @test -s "$(GO_DEBUG_DIR)/libboxlite.a"
+else
@$(MAKE) dev:go GO_CARGO_FEATURES="--features test-support"
+endif
@mkdir -p target/coverage
@rc=0; \
(cd sdks/go && $(GO_DEV_ENV) go test -a -count=1 -tags $(GO_DEV_TAGS),boxlite_agent_test,$(GO_SDK_COVERAGE_TAGS) -covermode=atomic -coverpkg=./... \
- -coverprofile="$(PROJECT_ROOT)/target/coverage/go-sdk.out" $(GOTEST_FILTER) ./...) || rc=$$?; \
+ -coverprofile="$(PROJECT_ROOT)/target/coverage/go-sdk.out" $(if $(filter 1,$(GO_COVERAGE_DEFER_KVM)),-skip '$(GO_SDK_KVM_TESTS)') $(GOTEST_FILTER) ./...) || rc=$$?; \
(cd src/deps/libgvproxy-sys/gvproxy-bridge && go test -covermode=atomic -coverpkg=./... \
-coverprofile="$(PROJECT_ROOT)/target/coverage/gvproxy.out" $(GOTEST_FILTER) ./...) || rc=$$?; \
(cd apps/runner && $(GO_DEV_ENV) GOFLAGS=-tags=$(GO_DEV_TAGS),boxlite_runner go test -covermode=atomic -coverpkg=./... \
- -coverprofile="$(PROJECT_ROOT)/target/coverage/runner.out" $(GOTEST_FILTER) ./...) || rc=$$?; \
+ -coverprofile="$(PROJECT_ROOT)/target/coverage/runner.out" $(if $(filter 1,$(GO_COVERAGE_DEFER_KVM)),-skip '$(GO_RUNNER_KVM_TESTS)') $(GOTEST_FILTER) ./...) || rc=$$?; \
(cd apps/image-service && go test -covermode=atomic -coverpkg=./... \
-coverprofile="$(PROJECT_ROOT)/target/coverage/image-service.out" $(GOTEST_FILTER) ./...) || rc=$$?; \
(cd apps/secret-server && GOWORK=off go test -race -covermode=atomic -coverpkg=./... \
-coverprofile="$(PROJECT_ROOT)/target/coverage/secret-server.out" $(GOTEST_FILTER) ./...) || rc=$$?; \
exit $$rc
+# The ordinary coverage step has already built the native SDK and Go packages.
+PHONY_TARGETS += _coverage-go-kvm
+_coverage-go-kvm:
+ @cd sdks/go && $(GO_DEV_ENV) go test -count=1 -tags $(GO_DEV_TAGS),boxlite_agent_test,boxlite_runner,boxlite_ssh_usage_test -covermode=atomic -coverpkg=./... \
+ -coverprofile="$(PROJECT_ROOT)/target/coverage/go-sdk-kvm.out" -run '$(GO_SDK_KVM_TESTS)' .
+ @cd apps/runner && $(GO_DEV_ENV) GOFLAGS=-tags=$(GO_DEV_TAGS),boxlite_runner go test -count=1 -covermode=atomic -coverpkg=./... \
+ -coverprofile="$(PROJECT_ROOT)/target/coverage/runner-kvm.out" -run '$(GO_RUNNER_KVM_TESTS)' ./cmd/runner ./pkg/boxlite
+ @set -e; for module in go-sdk runner; do \
+ full="$(PROJECT_ROOT)/target/coverage/$$module.out"; focused="$(PROJECT_ROOT)/target/coverage/$$module-kvm.out"; \
+ test "$$(head -n 1 "$$full")" = 'mode: atomic' && test "$$(head -n 1 "$$focused")" = 'mode: atomic' || exit 1; \
+ tail -n +2 "$$focused" >> "$$full"; \
+ done
+
PHONY_TARGETS += coverage\:apps\:secret-server\:integration
coverage\:apps\:secret-server\:integration: _require-secret-test-database
@mkdir -p "$(PROJECT_ROOT)/target/coverage"
diff --git a/make/dev.mk b/make/dev.mk
index d6dc3941b..32ddabc69 100644
--- a/make/dev.mk
+++ b/make/dev.mk
@@ -58,12 +58,15 @@ endif
# Build Go SDK locally (debug mode, static linking)
dev\:go: $(if $(SETUP_DONE),,runtime\:debug)
- @echo "🔨 Building Go SDK (debug)..."
- @cargo build -p boxlite-c $(GO_CARGO_FEATURES)
- @bash $(SCRIPT_DIR)/build/fix-go-symbols.sh "$(GO_DEBUG_DIR)/libboxlite.a"
+ @$(MAKE) build:go:archive
@cd sdks/go && $(GO_DEV_ENV) go build -tags $(GO_DEV_TAGS) ./...
@echo "✅ Go SDK built. You can now run: cd sdks/go && go test -tags boxlite_dev -v ./..."
+PHONY_TARGETS += build\:go\:archive
+build\:go\:archive:
+ @cargo build -p boxlite-c $(GO_CARGO_FEATURES)
+ @bash $(SCRIPT_DIR)/build/fix-go-symbols.sh "$(GO_DEBUG_DIR)/libboxlite.a"
+
# Native REST acceptance clients. SETUP_DONE=1 with BOXLITE_DEPS_STUB=1
# uses the same cloud-only build mode as e2e-cloud; no local VM is needed.
build\:e2e\:drivers: dev\:go
diff --git a/make/test.mk b/make/test.mk
index 00cbfa1f0..4689b72bf 100644
--- a/make/test.mk
+++ b/make/test.mk
@@ -873,6 +873,13 @@ test\:e2e\:serve\:volume:
@echo "🧪 Starting boxlite serve and exercising volume REST CRUD..."
@$(MAKE) test:integration:cli FILTER=volume_crud_over_rest
+PHONY_TARGETS += build\:test\:rest test\:rest\:archive
+build\:test\:rest:
+ @cargo nextest archive -p boxlite-cli --test volumes_rest --archive-file target/volumes-rest.tar.zst
+
+test\:rest\:archive:
+ @cargo-nextest nextest run --archive-file target/volumes-rest.tar.zst --workspace-remap "$(PROJECT_ROOT)" --profile vm --no-tests=fail -E 'test(=volume_crud_over_rest)'
+
# Validate acceptance-client invocation without a running cloud or VM.
test\:e2e\:drivers:
@cargo test --locked -p boxlite-e2e-rust $(CARGOTEST_FILTER)
diff --git a/scripts/build/build-libseccomp.sh b/scripts/build/build-libseccomp.sh
index 0107d52cd..0eefb57ea 100755
--- a/scripts/build/build-libseccomp.sh
+++ b/scripts/build/build-libseccomp.sh
@@ -85,11 +85,7 @@ ensure_libseccomp_for_target() {
local url="https://github.com/seccomp/libseccomp/releases/download/v$LIBSECCOMP_VERSION/libseccomp-$LIBSECCOMP_VERSION.tar.gz"
echo " → downloading $url"
- if command -v curl >/dev/null 2>&1; then
- curl -fsSL "$url" -o "$tarball"
- else
- wget -q "$url" -O "$tarball"
- fi
+ sh "$_BUILD_LIBSECCOMP_DIR/download-archive.sh" "$url" "$tarball" || return $?
# Verify integrity
local actual_sha256
diff --git a/scripts/build/build-vmm-boot.sh b/scripts/build/build-vmm-boot.sh
index 1a9582a96..88852694d 100755
--- a/scripts/build/build-vmm-boot.sh
+++ b/scripts/build/build-vmm-boot.sh
@@ -81,7 +81,7 @@ extract_kernel() {
if [[ ! -f $tarball ]]; then
# Download beside the cache entry so the final move is an atomic rename.
partial="$cache/.linux-$KERNEL_VERSION.tar.xz.part.$$"
- curl --fail --location --no-progress-meter --show-error --retry 3 \
+ curl --fail --location --no-progress-meter --show-error --retry 3 --retry-all-errors \
--connect-timeout 30 --max-time 600 --retry-max-time 900 \
"https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-$KERNEL_VERSION.tar.xz" \
--output "$partial"
diff --git a/scripts/build/download-archive.sh b/scripts/build/download-archive.sh
new file mode 100644
index 000000000..b53390425
--- /dev/null
+++ b/scripts/build/download-archive.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Download one build input. Cargo callers require curl; guest builds also support wget.
+set -eu
+
+url=$1
+dest=$2
+if [ "${3:-}" = curl ] || command -v curl >/dev/null 2>&1; then
+ set -- curl -fsSL --retry 0 -o - -- "$url"
+else
+ set -- wget -q -t 1 -O - -- "$url"
+fi
+
+command -v "$1" >/dev/null || { echo "Missing downloader: $1" >&2; exit 127; }
+scratch=$(mktemp -d "$dest.part.XXXXXX")
+partial=$scratch/archive
+trap 'rm -f "$partial"; rmdir "$scratch"' 0
+trap 'exit 1' HUP INT TERM
+
+# Start from the original URL on every attempt, including after a failed redirect.
+for delay in 1 2 4 0; do
+ if "$@" > "$partial"; then
+ mv -f "$partial" "$dest"
+ exit 0
+ else
+ status=$?
+ fi
+ [ "$delay" -gt 0 ] || exit "$status"
+ printf 'Download of %s failed (exit %s); retrying in %ss\n' "${dest##*/}" "$status" "$delay" >&2
+ sleep "$delay"
+done
diff --git a/scripts/build/install-apk.sh b/scripts/build/install-apk.sh
new file mode 100644
index 000000000..28797a942
--- /dev/null
+++ b/scripts/build/install-apk.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Populate apk's cache with retries, then run package installation once, offline.
+set -eu
+retry=$(dirname "$0")/retry-fetch.sh
+cache=$(mktemp -d)
+trap 'rm -rf "$cache"' 0
+sh "$retry" apk --cache-dir "$cache" update
+sh "$retry" apk --cache-dir "$cache" cache download "$@"
+apk --cache-dir "$cache" --no-network add "$@"
diff --git a/scripts/build/retry-fetch.sh b/scripts/build/retry-fetch.sh
new file mode 100644
index 000000000..f1def746b
--- /dev/null
+++ b/scripts/build/retry-fetch.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Run an idempotent fetch with up to three retries. Do not log credentials in arguments.
+set -eu
+command -v "$1" >/dev/null || exit 127
+for delay in 1 2 4 0; do
+ if "$@"; then exit 0; else status=$?; fi
+ [ "$delay" -gt 0 ] || exit "$status"
+ printf '%s failed (exit %s); retrying in %ss\n' "${1##*/}" "$status" "$delay" >&2
+ sleep "$delay"
+done
diff --git a/scripts/setup/setup-common.sh b/scripts/setup/setup-common.sh
index f51ed7185..89da39f0f 100755
--- a/scripts/setup/setup-common.sh
+++ b/scripts/setup/setup-common.sh
@@ -69,11 +69,22 @@ check_rust() {
fi
}
+# Buffer complete responses before passing downloaded text to a shell or parser.
+fetch_setup_text() (
+ local tmpfile
+ tmpfile=$(mktemp) || exit 1
+ trap 'rm -f "$tmpfile"' EXIT
+ sh "$SCRIPT_DIR/build/retry-fetch.sh" curl --retry 0 -fsSL "$@" -o "$tmpfile" || exit $?
+ cat "$tmpfile"
+)
+
# Install Rust
install_rust() {
echo ""
print_section "Installing Rust..."
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ local installer
+ installer=$(fetch_setup_text --proto '=https' --tlsv1.2 https://sh.rustup.rs) || return 1
+ sh -s -- -y <<< "$installer" || return 1
source "${CARGO_HOME:-$HOME/.cargo}/env"
print_success "Rust installed"
}
@@ -177,7 +188,8 @@ install_go_from_official() {
print_step "Fetching latest Go version... "
local go_version
- go_version=$(curl -sL https://go.dev/VERSION?m=text | head -1)
+ go_version=$(fetch_setup_text 'https://go.dev/VERSION?m=text') || return 1
+ go_version=${go_version%%$'\n'*}
if [ -z "$go_version" ]; then
print_error "Failed to fetch Go version from go.dev"
return 1
@@ -189,7 +201,7 @@ install_go_from_official() {
print_step "Downloading ${tarball}... "
local tmpfile="/tmp/${tarball}"
- if ! curl -sSL "$url" -o "$tmpfile"; then
+ if ! sh "$SCRIPT_DIR/build/download-archive.sh" "$url" "$tmpfile"; then
print_error "Failed to download Go from $url"
return 1
fi
@@ -335,7 +347,7 @@ install_nodejs_from_tarball() {
print_step "Downloading ${tarball}... "
local tmpfile="/tmp/${tarball}"
- if ! curl -fsSL "$url" -o "$tmpfile"; then
+ if ! sh "$SCRIPT_DIR/build/download-archive.sh" "$url" "$tmpfile"; then
print_error "Failed to download Node.js from $url"
return 1
fi
@@ -360,7 +372,7 @@ install_nodejs_from_nodesource() {
# apt-get update; pipe through sudo so it has the right privileges, but
# keep the body in a here-string to avoid shell quoting pitfalls.
local nodesource_script
- if ! nodesource_script=$(curl -fsSL "$nodesource_url"); then
+ if ! nodesource_script=$(fetch_setup_text "$nodesource_url"); then
print_error "Failed to download NodeSource setup script"
return 1
fi
@@ -371,7 +383,7 @@ install_nodejs_from_nodesource() {
print_success "Configured"
print_step "Installing nodejs... "
- run_with_sudo apt-get install -y -qq nodejs
+ run_with_sudo apt-get install -y -qq -o Acquire::Retries=3 nodejs
print_success "Installed"
local installed_version
diff --git a/scripts/setup/setup-macos.sh b/scripts/setup/setup-macos.sh
index 550bf3c9b..ef2388061 100755
--- a/scripts/setup/setup-macos.sh
+++ b/scripts/setup/setup-macos.sh
@@ -36,7 +36,9 @@ setup_homebrew() {
print_error "Not found"
echo ""
print_section "Installing Homebrew..."
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+ local installer
+ installer=$(fetch_setup_text https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) || return 1
+ /bin/bash -c "$installer"
# Add Homebrew to PATH for Apple Silicon Macs
if [[ -f "/opt/homebrew/bin/brew" ]]; then
diff --git a/scripts/setup/setup-manylinux.sh b/scripts/setup/setup-manylinux.sh
index 64137fd8e..efbc7ad80 100755
--- a/scripts/setup/setup-manylinux.sh
+++ b/scripts/setup/setup-manylinux.sh
@@ -34,7 +34,7 @@ yum_installed() {
# Update package lists
update_yum() {
print_section "🔄 Updating package lists..."
- run_with_sudo yum update -y -q
+ run_with_sudo yum --setopt=retries=3 update -y -q
echo ""
}
@@ -97,7 +97,7 @@ install_system_deps() {
print_success "Already installed"
else
echo -e "${YELLOW}Installing...${NC}"
- run_with_sudo yum install -y -q "$pkg"
+ run_with_sudo yum --setopt=retries=3 install -y -q "$pkg"
print_success "$pkg installed"
fi
done
@@ -109,7 +109,7 @@ install_system_deps() {
print_success "Already installed"
else
echo -e "${YELLOW}Installing...${NC}"
- run_with_sudo yum install -y -q glibc-static
+ run_with_sudo yum --setopt=retries=3 install -y -q glibc-static
print_success "glibc-static installed"
fi
@@ -181,7 +181,7 @@ install_protoc() {
local PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
local PROTOC_ZIP="/tmp/protoc.zip"
- curl -sSL "$PROTOC_URL" -o "$PROTOC_ZIP"
+ sh "$SCRIPT_DIR/build/download-archive.sh" "$PROTOC_URL" "$PROTOC_ZIP"
run_with_sudo unzip -q -o "$PROTOC_ZIP" -d /usr/local
rm -f "$PROTOC_ZIP"
diff --git a/scripts/setup/setup-musllinux.sh b/scripts/setup/setup-musllinux.sh
index 961567830..15afbb3cf 100755
--- a/scripts/setup/setup-musllinux.sh
+++ b/scripts/setup/setup-musllinux.sh
@@ -31,13 +31,6 @@ apk_installed() {
apk info -e "$1" &>/dev/null
}
-# Update package lists
-update_apk() {
- print_section "🔄 Updating package lists..."
- run_with_sudo apk update
- echo ""
-}
-
# Install system dependencies
install_system_deps() {
print_section "📦 Installing system dependencies..."
@@ -90,16 +83,19 @@ install_system_deps() {
cmake # Configure/build/run C SDK unit + integration tests
)
+ local missing=()
for pkg in "${packages[@]}"; do
print_step "Checking for $pkg... "
if apk_installed "$pkg"; then
print_success "Already installed"
else
- echo -e "${YELLOW}Installing...${NC}"
- run_with_sudo apk add --quiet "$pkg"
- print_success "$pkg installed"
+ echo "Queued for installation"
+ missing+=("$pkg")
fi
done
+ if (( ${#missing[@]} )); then
+ run_with_sudo sh "$SCRIPT_DIR/build/install-apk.sh" "${missing[@]}"
+ fi
echo ""
}
@@ -159,7 +155,7 @@ install_protoc() {
local PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
local PROTOC_ZIP="/tmp/protoc.zip"
- curl -sSL "$PROTOC_URL" -o "$PROTOC_ZIP"
+ sh "$SCRIPT_DIR/build/download-archive.sh" "$PROTOC_URL" "$PROTOC_ZIP"
run_with_sudo unzip -q -o "$PROTOC_ZIP" -d /usr/local
rm -f "$PROTOC_ZIP"
@@ -177,8 +173,6 @@ main() {
print_section "📋 Checking prerequisites..."
echo ""
- update_apk
-
install_system_deps
setup_go
diff --git a/scripts/setup/setup-submodules.sh b/scripts/setup/setup-submodules.sh
index cc27957a3..92bede728 100755
--- a/scripts/setup/setup-submodules.sh
+++ b/scripts/setup/setup-submodules.sh
@@ -128,7 +128,7 @@ main() {
# --force is what re-runs the checkout when the recorded commit already matches
# the submodule's HEAD — the interrupted-clone case. It is confined to the paths
# with no checkout, so a healthy submodule's local changes are never discarded.
- git -C "$repo_root" submodule update --init --force --depth 1 --jobs "$jobs" \
+ sh "$SCRIPT_DIR/build/retry-fetch.sh" git -C "$repo_root" submodule update --init --force --depth 1 --jobs "$jobs" \
-- "${unchecked[@]}"
print_success "Submodules initialized"
}
diff --git a/scripts/setup/setup-ubuntu.sh b/scripts/setup/setup-ubuntu.sh
index d1c87c866..fa5797663 100755
--- a/scripts/setup/setup-ubuntu.sh
+++ b/scripts/setup/setup-ubuntu.sh
@@ -40,7 +40,7 @@ apt_installed() {
# successfully after failed index downloads, then package install fails later.
apt_get() {
run_with_sudo apt-get \
- -o Acquire::Retries="${APT_RETRIES:-5}" \
+ -o Acquire::Retries="${APT_RETRIES:-3}" \
-o Acquire::http::Timeout="${APT_TIMEOUT:-30}" \
-o Acquire::https::Timeout="${APT_TIMEOUT:-30}" \
"$@"
diff --git a/scripts/util.sh b/scripts/util.sh
index c75698432..09b8a28ee 100755
--- a/scripts/util.sh
+++ b/scripts/util.sh
@@ -177,11 +177,7 @@ ensure_linux_headers_for_arch() (
local url="https://github.com/sabotage-linux/kernel-headers/archive/refs/tags/v$headers_version.tar.gz"
echo " → downloading $url" >&2
- if command -v curl >/dev/null 2>&1; then
- curl -fsSL "$url" -o "$tarball"
- else
- wget -q "$url" -O "$tarball"
- fi
+ sh "$script_dir/build/download-archive.sh" "$url" "$tarball" || return $?
local actual_sha256
if command -v shasum >/dev/null 2>&1; then
diff --git a/sdks/go/ssh_usage_integration_test.go b/sdks/go/ssh_usage_integration_test.go
index fa2065539..89f30dc4c 100644
--- a/sdks/go/ssh_usage_integration_test.go
+++ b/sdks/go/ssh_usage_integration_test.go
@@ -1,4 +1,4 @@
-//go:build boxlite_runner && boxlite_dev && boxlite_integration
+//go:build boxlite_runner && boxlite_dev && (boxlite_integration || boxlite_ssh_usage_test)
package boxlite
diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml
index 36cae8bcf..3e9529217 100644
--- a/sdks/python/pyproject.toml
+++ b/sdks/python/pyproject.toml
@@ -157,8 +157,13 @@ repair-wheel-command = "" # Skip auditwheel repair
# SKIP_GUEST_BUILD=1: Use the restored boxlite-guest from the Ubuntu host
environment = { SKIP_GUEST_BUILD = "1", PATH = "/usr/local/go/bin:$HOME/.cargo/bin:/usr/local/bin:$PATH", PKG_CONFIG_PATH = "/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig", LD_LIBRARY_PATH = "/usr/local/lib64:/usr/local/lib", RUSTC_WRAPPER = "/usr/local/bin/sccache", SCCACHE_GHA_ENABLED = "false", SCCACHE_DIR = "/tmp/boxlite-sccache", SCCACHE_CACHE_SIZE = "1G", SCCACHE_DIRECT = "false", SCCACHE_BASEDIRS = "/project", CARGO_INCREMENTAL = "0" }
-# Only file paths cross into the container; compiler results need no remote credentials.
-environment-pass = ["BOXLITE_HOST_SCCACHE_DIR", "BOXLITE_HOST_SCCACHE_BIN"]
+# The wheel build inherits the host cache paths and download retry settings.
+environment-pass = [
+ "BOXLITE_HOST_SCCACHE_DIR",
+ "BOXLITE_HOST_SCCACHE_BIN",
+ "PIP_RETRIES",
+ "UV_HTTP_RETRIES",
+]
# Stop the shared-cache server before wheel tests and container teardown.
before-test = "/usr/local/bin/sccache --stop-server >/dev/null 2>&1 || true"
diff --git a/src/boxlite/build.rs b/src/boxlite/build.rs
index 646957497..807f7b9b7 100644
--- a/src/boxlite/build.rs
+++ b/src/boxlite/build.rs
@@ -498,8 +498,15 @@ impl PrebuiltRuntime {
fn download_file(url: &str, dest: &Path) -> io::Result<()> {
println!("cargo:warning=Downloading {}...", url);
- let output = Command::new("curl")
- .args(["-fsSL", "-o", dest.to_str().unwrap(), url])
+ let output = Command::new("sh")
+ .args([
+ "-c",
+ include_str!("download-archive.sh"),
+ "download-archive",
+ url,
+ ])
+ .arg(dest)
+ .arg("curl")
.output()?;
if !output.status.success() {
diff --git a/src/boxlite/download-archive.sh b/src/boxlite/download-archive.sh
new file mode 120000
index 000000000..d0ff7cbb9
--- /dev/null
+++ b/src/boxlite/download-archive.sh
@@ -0,0 +1 @@
+../../scripts/build/download-archive.sh
\ No newline at end of file
diff --git a/src/cli/tests/common/serve.rs b/src/cli/tests/common/serve.rs
index ed0ccb3ff..1f9757084 100644
--- a/src/cli/tests/common/serve.rs
+++ b/src/cli/tests/common/serve.rs
@@ -2,10 +2,16 @@
#![allow(dead_code)]
+use std::ffi::OsString;
use std::net::TcpStream;
use std::process::{Child, Command, Stdio};
use std::time::{Duration, Instant};
+fn cli_executable() -> OsString {
+ std::env::var_os("NEXTEST_BIN_EXE_boxlite")
+ .unwrap_or_else(|| env!("CARGO_BIN_EXE_boxlite").into())
+}
+
/// A `boxlite serve` child, torn down (gracefully) when dropped.
pub struct ServeChild {
child: Child,
@@ -36,7 +42,7 @@ impl ServeChild {
.unwrap()
.port();
- let mut cmd = Command::new(env!("CARGO_BIN_EXE_boxlite"));
+ let mut cmd = Command::new(cli_executable());
cmd.arg("--home").arg(&home.path);
cmd.arg("--config")
.arg(super::write_registry_config(&home.path));
@@ -74,7 +80,7 @@ impl ServeChild {
/// Run a `boxlite --url` client command against this server.
pub fn client(&self, args: &[&str]) -> std::process::Output {
- let mut cmd = Command::new(env!("CARGO_BIN_EXE_boxlite"));
+ let mut cmd = Command::new(cli_executable());
cmd.args(["--url", &self.url()]).args(args);
if let Some(key) = &self.api_key {
cmd.env("BOXLITE_API_KEY", key);
@@ -115,7 +121,7 @@ impl ServeChild {
let deadline = Instant::now() + Duration::from_secs(45);
while Instant::now() < deadline {
if TcpStream::connect(("127.0.0.1", self.port)).is_ok() {
- let mut probe = Command::new(env!("CARGO_BIN_EXE_boxlite"));
+ let mut probe = Command::new(cli_executable());
probe.args(["--url", &self.url(), "ps"]);
if let Some(key) = &self.api_key {
probe.env("BOXLITE_API_KEY", key);
diff --git a/src/deps/libkrun-sys/build.rs b/src/deps/libkrun-sys/build.rs
index 486b07ef4..4422e1a95 100644
--- a/src/deps/libkrun-sys/build.rs
+++ b/src/deps/libkrun-sys/build.rs
@@ -82,19 +82,59 @@ impl Fetcher {
tarball_path: &Path,
extract_dir: &Path,
) -> io::Result<()> {
- if !tarball_path.exists() {
- Self::download(url, tarball_path)?;
+ let shared = env::var_os("BOXLITE_CACHE")
+ .filter(|root| !root.is_empty())
+ .map(|root| PathBuf::from(root).join("firmware").join(sha256));
+ let archive = shared.as_deref().unwrap_or(tarball_path);
+ if archive.try_exists()? {
+ if let Err(error) = Self::verify_sha256(archive, sha256) {
+ if error.kind() == io::ErrorKind::InvalidData {
+ fs::remove_file(archive)?;
+ }
+ return Err(error);
+ }
+ } else {
+ if let Some(parent) = archive.parent() {
+ fs::create_dir_all(parent)?;
+ }
+ let partial = Self::reserve_partial(archive)?;
+ let result = Self::download(url, &partial)
+ .and_then(|()| Self::verify_sha256(&partial, sha256))
+ .and_then(|()| fs::rename(&partial, archive));
+ if result.is_err() {
+ let _ = fs::remove_file(&partial);
+ }
+ result?;
+ }
+ Self::extract_tarball(archive, extract_dir)
+ }
+
+ fn reserve_partial(archive: &Path) -> io::Result<PathBuf> {
+ // PID namespaces can assign the same PID to writers sharing a cache.
+ let mut attempt = 0_u64;
+ loop {
+ let path = archive.with_extension(format!("part.{}.{attempt}", std::process::id()));
+ match fs::File::create_new(&path) {
+ Ok(_) => return Ok(path),
+ Err(error) if error.kind() == io::ErrorKind::AlreadyExists => attempt += 1,
+ Err(error) => return Err(error),
+ }
}
- Self::verify_sha256(tarball_path, sha256)?;
- Self::extract_tarball(tarball_path, extract_dir)
}
/// Downloads a file from URL to the specified path.
fn download(url: &str, dest: &Path) -> io::Result<()> {
println!("cargo:warning=Downloading {}...", url);
- let output = Command::new("curl")
- .args(["-fsSL", "-o", dest.to_str().unwrap(), url])
+ let output = Command::new("sh")
+ .args([
+ "-c",
+ include_str!("download-archive.sh"),
+ "download-archive",
+ url,
+ ])
+ .arg(dest)
+ .arg("curl")
.output()?;
if !output.status.success() {
@@ -109,13 +149,16 @@ impl Fetcher {
/// Verifies SHA256 checksum of a file.
fn verify_sha256(file: &Path, expected: &str) -> io::Result<()> {
- let (cmd, args): (&str, Vec<&str>) = if cfg!(target_os = "linux") {
- ("sha256sum", vec![file.to_str().unwrap()])
+ let (cmd, args): (&str, &[&str]) = if cfg!(target_os = "linux") {
+ ("sha256sum", &[])
} else {
- ("shasum", vec!["-a", "256", file.to_str().unwrap()])
+ ("shasum", &["-a", "256"])
};
- let output = Command::new(cmd).args(&args).output()?;
+ let output = Command::new(cmd)
+ .args(args)
+ .stdin(fs::File::open(file)?)
+ .output()?;
if !output.status.success() {
return Err(io::Error::other(format!("{} failed", cmd)));
@@ -143,12 +186,10 @@ impl Fetcher {
fs::create_dir_all(dest)?;
let status = Command::new("tar")
- .args([
- "-xzf",
- tarball.to_str().unwrap(),
- "-C",
- dest.to_str().unwrap(),
- ])
+ .arg("-xzf")
+ .arg(tarball)
+ .arg("-C")
+ .arg(dest)
.status()?;
if !status.success() {
diff --git a/src/deps/libkrun-sys/download-archive.sh b/src/deps/libkrun-sys/download-archive.sh
new file mode 120000
index 000000000..9ce93c8c3
--- /dev/null
+++ b/src/deps/libkrun-sys/download-archive.sh
@@ -0,0 +1 @@
+../../../scripts/build/download-archive.sh
\ No newline at end of file
diff --git a/src/test-utils/src/cache.rs b/src/test-utils/src/cache.rs
index bc67e0a4c..5b8aea242 100644
--- a/src/test-utils/src/cache.rs
+++ b/src/test-utils/src/cache.rs
@@ -262,12 +262,16 @@ impl SharedResources {
/// Persistent cache directory in `target/boxlite-test/`.
pub(crate) fn cache_dir() -> PathBuf {
- Path::new(env!("CARGO_MANIFEST_DIR"))
- .parent()
- .and_then(Path::parent)
- .unwrap()
- .join("target")
- .join("boxlite-test")
+ let root = std::env::var_os("NEXTEST_WORKSPACE_ROOT")
+ .map(PathBuf::from)
+ .unwrap_or_else(|| {
+ Path::new(env!("CARGO_MANIFEST_DIR"))
+ .parent()
+ .and_then(Path::parent)
+ .unwrap()
+ .to_owned()
+ });
+ root.join("target").join("boxlite-test")
}
/// Create a symlink, ignoring `AlreadyExists` errors (race-safe).
diff --git a/tests/scripts/test_firmware_download.py b/tests/scripts/test_firmware_download.py
new file mode 100644
index 000000000..9e923410c
--- /dev/null
+++ b/tests/scripts/test_firmware_download.py
@@ -0,0 +1,275 @@
+"""Exercise release retries and checksum verification through the firmware build script."""
+
+import hashlib
+import io
+import os
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import threading
+import unittest
+from http.server import BaseHTTPRequestHandler, HTTPServer, ThreadingHTTPServer
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parents[2]
+
+
+class FirmwareDownloadTest(unittest.TestCase):
+ @classmethod
+ def setUpClass(cls):
+ tmp = tempfile.TemporaryDirectory()
+ cls.addClassCleanup(tmp.cleanup)
+ cls.build = Path(tmp.name) / "fetch"
+ wrapper = cls.build.with_suffix(".rs")
+ source = ROOT / "src/deps/libkrun-sys/build.rs"
+ wrapper.write_text(
+ "mod num_cpus { pub fn get() -> usize { 1 } }\n"
+ f'mod firmware {{ use super::num_cpus; include!(r#"{source}"#);\n'
+ "pub fn fetch(a: &[String]) -> std::io::Result<()> {"
+ "Fetcher::fetch(&a[1], &a[2], a[3].as_ref(), a[4].as_ref()) } }\n"
+ """fn main() -> std::io::Result<()> {
+ let args: Vec<_> = std::env::args().collect();
+ let Some(other_output) = args.get(5) else { return firmware::fetch(&args) };
+ let mut other = args.clone();
+ other[4] = other_output.clone();
+ std::thread::scope(|scope| {
+ let peer = scope.spawn(|| firmware::fetch(&other));
+ firmware::fetch(&args).and(peer.join().unwrap())
+ })
+ }"""
+ )
+ subprocess.run(
+ ["rustc", "--edition=2021", "-Awarnings", wrapper, "-o", cls.build],
+ check=True,
+ )
+ buffer = io.BytesIO()
+ with tarfile.open(fileobj=buffer, mode="w:gz") as archive:
+ member = tarfile.TarInfo("kernel")
+ member.size = 2
+ archive.addfile(member, io.BytesIO(b"ok"))
+ cls.archive = buffer.getvalue()
+ cls.digest = hashlib.sha256(cls.archive).hexdigest()
+
+ def check_transfer(self, failures, digest, requests, success, truncated=False):
+ body = self.archive
+ paths = []
+
+ class Release(BaseHTTPRequestHandler):
+ def log_message(self, *args):
+ pass
+
+ def do_GET(self):
+ paths.append(self.path)
+ if self.path == "/release":
+ self.send_response(302)
+ self.send_header("Location", "/asset")
+ self.end_headers()
+ elif paths.count("/asset") <= failures:
+ if truncated:
+ self.send_response(200)
+ self.send_header("Content-Length", str(len(body)))
+ self.end_headers()
+ self.wfile.write(body[:5])
+ else:
+ self.send_error(618)
+ else:
+ self.send_response(200)
+ self.send_header("Content-Length", str(len(body)))
+ self.end_headers()
+ self.wfile.write(body)
+
+ with (
+ tempfile.TemporaryDirectory() as tmp,
+ HTTPServer(("127.0.0.1", 0), Release) as server,
+ ):
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+ dest = Path(tmp) / "release.tgz"
+ extracted = Path(tmp) / "out"
+ try:
+ result = subprocess.run(
+ [
+ self.build,
+ f"http://127.0.0.1:{server.server_port}/release",
+ digest,
+ dest,
+ extracted,
+ ],
+ check=False,
+ capture_output=True,
+ text=True,
+ timeout=30,
+ env={
+ **os.environ,
+ "BOXLITE_CACHE": str(Path(tmp) / "cache"),
+ "NO_PROXY": "127.0.0.1",
+ "no_proxy": "127.0.0.1",
+ },
+ )
+ finally:
+ server.shutdown()
+ thread.join()
+ self.assertEqual(paths, ["/release", "/asset"] * requests, result.stderr)
+ self.assertEqual(result.returncode == 0, success, result.stderr)
+ if success:
+ self.assertEqual((extracted / "kernel").read_bytes(), b"ok")
+ else:
+ self.assertFalse(extracted.exists())
+ self.assertFalse(dest.exists())
+ self.assertEqual(list((Path(tmp) / "cache" / "firmware").iterdir()), [])
+
+ def test_initial_success(self):
+ self.check_transfer(0, self.digest, 1, True)
+
+ def test_three_retries_recover_from_618(self):
+ self.check_transfer(3, self.digest, 4, True)
+
+ def test_persistent_618_stops_after_four_requests(self):
+ self.check_transfer(4, self.digest, 4, False)
+
+ def test_partial_transfer_is_replaced(self):
+ self.check_transfer(1, self.digest, 2, True, truncated=True)
+
+ def test_bad_checksum_stops_before_extraction(self):
+ self.check_transfer(0, "0" * 64, 1, False)
+
+ def test_empty_and_unset_cache_use_the_caller_output(self):
+ for value in (None, ""):
+ with self.subTest(cache=value), tempfile.TemporaryDirectory() as tmp:
+ root = Path(tmp)
+ source = root / "source"
+ source.mkdir(mode=0o555)
+ upstream = root / "upstream.tgz"
+ upstream.write_bytes(self.archive)
+ env = os.environ.copy()
+ env.pop("BOXLITE_CACHE", None)
+ if value is not None:
+ env["BOXLITE_CACHE"] = value
+ archive = root / "output" / "firmware.tgz"
+ try:
+ result = subprocess.run(
+ [self.build, upstream.as_uri(), self.digest, archive, archive.parent],
+ cwd=source, env=env, capture_output=True, timeout=20,
+ )
+ self.assertEqual(result.returncode, 0, result.stderr)
+ self.assertEqual(list(source.iterdir()), [])
+ self.assertEqual(archive.read_bytes(), self.archive)
+ self.assertEqual((archive.parent / "kernel").read_bytes(), b"ok")
+ finally:
+ source.chmod(0o755)
+
+ def test_concurrent_builds_with_the_same_pid_publish_verified_firmware(self):
+ # Both writers must finish checksumming before either can publish.
+ verified = threading.Barrier(2, timeout=10)
+
+ class BothVerified(BaseHTTPRequestHandler):
+ def do_GET(self):
+ verified.wait()
+ self.send_response(204)
+ self.end_headers()
+
+ def log_message(self, *args):
+ pass
+
+ with (
+ tempfile.TemporaryDirectory() as tmp,
+ ThreadingHTTPServer(("127.0.0.1", 0), BothVerified) as server,
+ ):
+ root = Path(tmp)
+ upstream = root / "release.tgz"
+ upstream.write_bytes(self.archive)
+ checksum = "shasum" if sys.platform == "darwin" else "sha256sum"
+ checker = root / checksum
+ checker.write_text('#!/bin/sh\n"$REAL_CHECKSUM" "$@" && curl -fsS "$BARRIER_URL"\n')
+ checker.chmod(0o755)
+ env = {
+ **os.environ,
+ "REAL_CHECKSUM": shutil.which(checksum),
+ "PATH": tmp + os.pathsep + os.environ["PATH"],
+ "BARRIER_URL": f"http://127.0.0.1:{server.server_port}/verified",
+ "NO_PROXY": "127.0.0.1",
+ "no_proxy": "127.0.0.1",
+ "BOXLITE_CACHE": tmp,
+ }
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
+ thread.start()
+ try:
+ result = subprocess.run(
+ [
+ self.build, upstream.as_uri(), self.digest,
+ root / "input.tgz", root / "shim", root / "ffi",
+ ],
+ capture_output=True, env=env, timeout=20,
+ )
+ finally:
+ server.shutdown()
+ thread.join()
+ self.assertEqual(result.returncode, 0, result.stderr)
+ for output in ("shim", "ffi"):
+ self.assertEqual((root / output / "kernel").read_bytes(), b"ok")
+ cache = root / "firmware"
+ self.assertEqual(list(cache.iterdir()), [cache / self.digest])
+ self.assertEqual((cache / self.digest).read_bytes(), self.archive)
+
+ def test_shared_firmware_survives_a_new_cargo_output_directory(self):
+ self.check_cache_reuse("native")
+
+ def test_cache_path_with_backslash(self):
+ self.check_cache_reuse(r"cache\name")
+
+ @unittest.skipUnless(sys.platform.startswith("linux"), "requires byte-oriented filenames")
+ def test_cache_path_with_non_utf8_bytes(self):
+ self.check_cache_reuse(os.fsdecode(b"cache-\xff"))
+
+ def check_cache_reuse(self, cache_name):
+ with tempfile.TemporaryDirectory() as tmp:
+ root = Path(tmp)
+ upstream = root / "upstream.tgz"
+ upstream.write_bytes(self.archive)
+ env = {**os.environ, "BOXLITE_CACHE": str(root / cache_name)}
+ for build in ("shim", "ffi"):
+ output = root / build
+ output.mkdir()
+ result = subprocess.run(
+ [self.build, upstream.as_uri(), self.digest, output / "input.tgz", output],
+ capture_output=True, env=env, timeout=20,
+ )
+ self.assertEqual(result.returncode, 0, result.stderr)
+ self.assertEqual((output / "kernel").read_bytes(), b"ok")
+ upstream.unlink(missing_ok=True)
+
+
+class GuestArchiveDownloadTest(unittest.TestCase):
+ def test_unavailable_guest_dependencies_stop_after_four_attempts(self):
+ commands = [
+ ["scripts/build/build-libseccomp.sh", "x86_64-unknown-linux-musl"],
+ ["scripts/util.sh", "--ensure-linux-headers", "x86_64"],
+ ]
+ for script, *args in commands:
+ with self.subTest(script=script), tempfile.TemporaryDirectory() as tmp:
+ tools = Path(tmp)
+ for tool in ("gperf", "x86_64-linux-musl-gcc", "sleep"):
+ (tools / tool).symlink_to("/usr/bin/true")
+ curl = tools / "curl"
+ curl.write_text(
+ '#!/bin/sh\nprintf "request\\n" >> "$REQUEST_LOG"\nexit 22\n'
+ )
+ curl.chmod(0o755)
+ log = tools / "requests"
+ env = {
+ **os.environ,
+ "PATH": tmp + os.pathsep + os.environ["PATH"],
+ "REQUEST_LOG": str(log),
+ "BOXLITE_CACHE": str(tools / "cache"),
+ }
+ result = subprocess.run(
+ ["bash", ROOT / script, *args],
+ check=False,
+ capture_output=True,
+ env=env,
+ )
+ self.assertNotEqual(result.returncode, 0)
+ self.assertEqual(len(log.read_text().splitlines()), 4, result.stderr)
+ self.assertFalse((tools / "cache").exists())
diff --git a/tests/scripts/test_go_coverage.py b/tests/scripts/test_go_coverage.py
index cf8dda330..718e6d1ff 100644
--- a/tests/scripts/test_go_coverage.py
+++ b/tests/scripts/test_go_coverage.py
@@ -2,6 +2,7 @@
import json
import os
+import re
from pathlib import Path
import subprocess
import tempfile
@@ -13,8 +14,8 @@ ROOT = Path(__file__).resolve().parents[2]
class GoCoverageTest(unittest.TestCase):
def test_secret_server_runs_with_race_and_propagates_failure(self):
- for status in (0, 17):
- with self.subTest(status=status), tempfile.TemporaryDirectory() as scratch:
+ for status, defer_kvm in ((0, False), (17, False), (0, True)):
+ with self.subTest(status=status, defer_kvm=defer_kvm), tempfile.TemporaryDirectory() as scratch:
root = Path(scratch).resolve()
for module in (
"sdks/go", "src/deps/libgvproxy-sys/gvproxy-bridge",
@@ -30,6 +31,9 @@ class GoCoverageTest(unittest.TestCase):
"from pathlib import Path\n"
"with open(os.environ['GO_COVERAGE_LOG'], 'a') as log:\n"
" log.write(json.dumps([str(Path.cwd()), sys.argv[1:], os.getenv('GOWORK')]) + '\\n')\n"
+ "profile = next(arg.split('=', 1)[1] for arg in sys.argv if arg.startswith('-coverprofile='))\n"
+ "block = 'hardware' if '-run' in sys.argv else 'ordinary'\n"
+ "Path(profile).write_text(f'mode: atomic\\n{block}.go:1.1,1.2 1 1\\n')\n"
"sys.exit(int(os.environ['SECRET_TEST_STATUS']) if Path.cwd().name == 'secret-server' else 0)\n"
)
go.chmod(0o755)
@@ -41,10 +45,11 @@ class GoCoverageTest(unittest.TestCase):
)
log = root / "calls.jsonl"
result = subprocess.run(
- ["make", "coverage:go"], cwd=root, text=True,
+ ["make", "coverage:go", *(["_coverage-go-kvm"] if defer_kvm else [])], cwd=root, text=True,
capture_output=True, timeout=20,
env={**os.environ, "PATH": f"{tools}:{os.environ['PATH']}",
- "GO_COVERAGE_LOG": str(log), "SECRET_TEST_STATUS": str(status)},
+ "GO_COVERAGE_LOG": str(log), "SECRET_TEST_STATUS": str(status),
+ "GO_COVERAGE_DEFER_KVM": "1" if defer_kvm else ""},
)
self.assertTrue(log.exists(), result.stderr)
calls = [json.loads(line) for line in log.read_text().splitlines()]
@@ -56,3 +61,26 @@ class GoCoverageTest(unittest.TestCase):
self.assertIn(arg, args)
self.assertIn(f"-coverprofile={root}/target/coverage/secret-server.out", args)
self.assertEqual(result.returncode == 0, status == 0, result.stderr)
+
+ ordinary = {Path(cwd).name: args for cwd, args, _ in calls if '-run' not in args}
+ self.assertEqual(len(ordinary), 5)
+ focused = {Path(cwd).name: args for cwd, args, _ in calls if '-run' in args}
+ self.assertEqual(set(focused), {'go', 'runner'} if defer_kvm else set())
+ if defer_kvm:
+ for module, tests in {
+ 'go': ['TestSSHUsageConfiguredLocalBoxReturnsOwnedEmptyBatchWithoutBoot',
+ 'TestNestedVirtualizationCreateAuthorization'],
+ 'runner': ['TestRunnerDrainsPollOnSIGTERM', 'TestNestedVirtualizationRunnerCreateAndReplay'],
+ }.items():
+ args = focused[module]
+ selector = args[args.index('-run') + 1]
+ self.assertEqual(ordinary[module][ordinary[module].index('-skip') + 1], selector)
+ for case in tests:
+ self.assertRegex(case, selector)
+ self.assertIsNone(re.search(selector, 'TestIntegrationExecutionInventoryRecoveryHTTP'))
+ self.assertNotIn('./...', args)
+ profile = root / 'target/coverage' / ('go-sdk.out' if module == 'go' else 'runner.out')
+ self.assertEqual(profile.read_text().splitlines(),
+ ['mode: atomic', 'ordinary.go:1.1,1.2 1 1', 'hardware.go:1.1,1.2 1 1'])
+ else:
+ self.assertTrue(all('-skip' not in args for args in ordinary.values()))