From 978be7e127455f4377eb5edfa1436f700c7ee8dd Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 10:15:46 -0800 Subject: [PATCH 1/7] ci(e2e): Install the pinned box on the macOS runner so the Box tests run --- .github/workflows/e2e-test.yml | 18 ++++++++++++++++++ e2eTest/README.md | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 3eb08e6dae..32a451d06c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -125,6 +125,24 @@ jobs: role-to-assume: ${{ env.E2E_AWS_ROLE_ARN }} aws-region: ${{ vars.E2E_REGION || 'us-east-1' }} unset-current-credentials: true + # box ships only arm64 builds, so only the macOS runner (Apple silicon) can run the Box tests. + # They skip on a runner with no box on PATH. + - name: Install box + if: matrix.name == 'macOS' + run: | + REPO=$(jq -r .box.repo src/core/project/backends/boxRelease.json) + VER=$(jq -r .box.version src/core/project/backends/boxRelease.json) + ASSET="box-v${VER}-aarch64-apple-darwin.tar.gz" + URL="https://github.com/${REPO}/releases/download/v${VER}" + WORK=$(mktemp -d) + curl -fsSL --retry 3 -o "${WORK}/${ASSET}" "${URL}/${ASSET}" + curl -fsSL --retry 3 -o "${WORK}/SHA256SUMS.txt" "${URL}/SHA256SUMS.txt" + (cd "${WORK}" && grep " ${ASSET}\$" SHA256SUMS.txt | shasum -a 256 -c -) + # box reads its packs from resources/ beside it, so keep the release together. + sudo mkdir -p /opt/box + sudo tar -xzf "${WORK}/${ASSET}" -C /opt/box + sudo ln -sf /opt/box/box /usr/local/bin/box + box --version - name: Build CLI if: inputs.npmVersion == '' run: bun run build diff --git a/e2eTest/README.md b/e2eTest/README.md index 2910594f9b..1606685782 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -26,7 +26,8 @@ The `box` tests cover the Strands Box templates, which run their agent in a box. invoke each one on AgentCore Runtime, and run `agentcore dev` with one local invoke for each. They are optional and need a `box` on your PATH: `create` checks for one for a CodeZip box template, and `build` and `deploy` run `box profile show` for every Box template, the container one too. Without -one, they skip. `create` also installs the agent's dependencies and the CDK app's, which `dev` and +one, they skip. box ships only arm64 builds, so in CI only the macOS runner (Apple silicon) has one: +it installs the box that `src/core/project/backends/boxRelease.json` pins. `create` also installs the agent's dependencies and the CDK app's, which `dev` and `deploy` use, so the tests don't pass `--skip-install`. The tests that deploy also need `AGENTCORE_E2E_BOX_CDK`: the pinned `@aws/agentcore-cdk` release From 2c2bb6790cdb4e87a99b482deae882cc5eb0776b Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 10:24:11 -0800 Subject: [PATCH 2/7] ci(e2e): Run the Box tests on a Linux arm64 runner --- .github/workflows/e2e-test.yml | 30 +++++++++++++++++++++++------- e2eTest/README.md | 5 +++-- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 32a451d06c..abf4aaa31c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -92,6 +92,7 @@ jobs: || matrix.name == 'Windows' && format('["codebuild-agentcore-e2e-{0}-{1}","image:windows-1.0","e2e-windows"]', github.run_id, github.run_attempt) || matrix.name == 'macOS' && '["macos-latest"]' + || matrix.name == 'Linux-arm64' && '["ubuntu-24.04-arm"]' ) }} permissions: id-token: write @@ -99,7 +100,7 @@ jobs: strategy: fail-fast: false matrix: - name: ${{ fromJSON(inputs.linuxOnly && '["Linux"]' || '["Linux","Windows","macOS"]') }} + name: ${{ fromJSON(inputs.linuxOnly && '["Linux","Linux-arm64"]' || '["Linux","Linux-arm64","Windows","macOS"]') }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -125,14 +126,16 @@ jobs: role-to-assume: ${{ env.E2E_AWS_ROLE_ARN }} aws-region: ${{ vars.E2E_REGION || 'us-east-1' }} unset-current-credentials: true - # box ships only arm64 builds, so only the macOS runner (Apple silicon) can run the Box tests. - # They skip on a runner with no box on PATH. + # box ships only arm64 builds, so only the macOS (Apple silicon) and Linux arm64 runners can run + # the Box tests. They skip on a runner with no box on PATH. - name: Install box - if: matrix.name == 'macOS' + if: matrix.name == 'macOS' || matrix.name == 'Linux-arm64' + env: + TARGET: ${{ matrix.name == 'macOS' && 'aarch64-apple-darwin' || 'aarch64-unknown-linux-gnu' }} run: | REPO=$(jq -r .box.repo src/core/project/backends/boxRelease.json) VER=$(jq -r .box.version src/core/project/backends/boxRelease.json) - ASSET="box-v${VER}-aarch64-apple-darwin.tar.gz" + ASSET="box-v${VER}-${TARGET}.tar.gz" URL="https://github.com/${REPO}/releases/download/v${VER}" WORK=$(mktemp -d) curl -fsSL --retry 3 -o "${WORK}/${ASSET}" "${URL}/${ASSET}" @@ -143,6 +146,11 @@ jobs: sudo tar -xzf "${WORK}/${ASSET}" -C /opt/box sudo ln -sf /opt/box/box /usr/local/bin/box box --version + # Ubuntu 24.04 lets AppArmor stop an unprivileged process from making a user namespace, which + # `box run` needs for its sandbox. The runner is a throwaway VM. + - name: Allow user namespaces for box + if: matrix.name == 'Linux-arm64' + run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 - name: Build CLI if: inputs.npmVersion == '' run: bun run build @@ -154,14 +162,22 @@ jobs: npm install --global "@aws/agentcore@${NPM_VERSION}" agentcore --version - name: Run all E2E tests - if: inputs.tags == '' + if: inputs.tags == '' && matrix.name != 'Linux-arm64' env: AGENTCORE_CLI_PATH: ${{ inputs.npmVersion != '' && 'agentcore' || format('node {0}/dist/index.js', github.workspace) }} AWS_REGION: ${{ vars.E2E_REGION || 'us-east-1' }} run: bun run test:e2e - name: Run tagged E2E tests - if: inputs.tags != '' + if: inputs.tags != '' && matrix.name != 'Linux-arm64' env: AGENTCORE_CLI_PATH: ${{ inputs.npmVersion != '' && 'agentcore' || format('node {0}/dist/index.js', github.workspace) }} AWS_REGION: ${{ vars.E2E_REGION || 'us-east-1' }} run: bun run test:e2e -- --tagsFilter="${{ inputs.tags }}" + # The Linux x86_64 job runs every other test, so the Linux arm64 job runs only the Box tests. + - name: Run Box E2E tests + if: matrix.name == 'Linux-arm64' && (inputs.tags == '' || contains(inputs.tags, 'box')) + env: + AGENTCORE_CLI_PATH: ${{ inputs.npmVersion != '' && 'agentcore' || format('node {0}/dist/index.js', github.workspace) }} + AWS_REGION: ${{ vars.E2E_REGION || 'us-east-1' }} + TAGS: ${{ inputs.tags || 'box' }} + run: bun run test:e2e -- --tagsFilter="$TAGS" diff --git a/e2eTest/README.md b/e2eTest/README.md index 1606685782..cd23f39fe6 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -26,8 +26,9 @@ The `box` tests cover the Strands Box templates, which run their agent in a box. invoke each one on AgentCore Runtime, and run `agentcore dev` with one local invoke for each. They are optional and need a `box` on your PATH: `create` checks for one for a CodeZip box template, and `build` and `deploy` run `box profile show` for every Box template, the container one too. Without -one, they skip. box ships only arm64 builds, so in CI only the macOS runner (Apple silicon) has one: -it installs the box that `src/core/project/backends/boxRelease.json` pins. `create` also installs the agent's dependencies and the CDK app's, which `dev` and +one, they skip. box ships only arm64 builds, so in CI only the macOS runner (Apple silicon) and the +Linux arm64 runner (`ubuntu-24.04-arm`, which runs only the Box tests) have one: each installs the +box that `src/core/project/backends/boxRelease.json` pins. `create` also installs the agent's dependencies and the CDK app's, which `dev` and `deploy` use, so the tests don't pass `--skip-install`. The tests that deploy also need `AGENTCORE_E2E_BOX_CDK`: the pinned `@aws/agentcore-cdk` release From c1adceffef7d06858b7837e26772ba73e24a0ceb Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 11:03:33 -0800 Subject: [PATCH 3/7] ci(e2e): Run every e2e test on the Linux arm64 runner, and check box with sha256sum on Linux --- .github/workflows/e2e-test.yml | 16 +++++----------- e2eTest/README.md | 6 +++--- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index abf4aaa31c..29facb357f 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -140,7 +140,9 @@ jobs: WORK=$(mktemp -d) curl -fsSL --retry 3 -o "${WORK}/${ASSET}" "${URL}/${ASSET}" curl -fsSL --retry 3 -o "${WORK}/SHA256SUMS.txt" "${URL}/SHA256SUMS.txt" - (cd "${WORK}" && grep " ${ASSET}\$" SHA256SUMS.txt | shasum -a 256 -c -) + # Linux has sha256sum, and macOS may have only shasum. + SUM=$(command -v sha256sum || echo "shasum -a 256") + (cd "${WORK}" && grep " ${ASSET}\$" SHA256SUMS.txt | $SUM -c -) # box reads its packs from resources/ beside it, so keep the release together. sudo mkdir -p /opt/box sudo tar -xzf "${WORK}/${ASSET}" -C /opt/box @@ -162,22 +164,14 @@ jobs: npm install --global "@aws/agentcore@${NPM_VERSION}" agentcore --version - name: Run all E2E tests - if: inputs.tags == '' && matrix.name != 'Linux-arm64' + if: inputs.tags == '' env: AGENTCORE_CLI_PATH: ${{ inputs.npmVersion != '' && 'agentcore' || format('node {0}/dist/index.js', github.workspace) }} AWS_REGION: ${{ vars.E2E_REGION || 'us-east-1' }} run: bun run test:e2e - name: Run tagged E2E tests - if: inputs.tags != '' && matrix.name != 'Linux-arm64' + if: inputs.tags != '' env: AGENTCORE_CLI_PATH: ${{ inputs.npmVersion != '' && 'agentcore' || format('node {0}/dist/index.js', github.workspace) }} AWS_REGION: ${{ vars.E2E_REGION || 'us-east-1' }} run: bun run test:e2e -- --tagsFilter="${{ inputs.tags }}" - # The Linux x86_64 job runs every other test, so the Linux arm64 job runs only the Box tests. - - name: Run Box E2E tests - if: matrix.name == 'Linux-arm64' && (inputs.tags == '' || contains(inputs.tags, 'box')) - env: - AGENTCORE_CLI_PATH: ${{ inputs.npmVersion != '' && 'agentcore' || format('node {0}/dist/index.js', github.workspace) }} - AWS_REGION: ${{ vars.E2E_REGION || 'us-east-1' }} - TAGS: ${{ inputs.tags || 'box' }} - run: bun run test:e2e -- --tagsFilter="$TAGS" diff --git a/e2eTest/README.md b/e2eTest/README.md index cd23f39fe6..238bfae03d 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -27,9 +27,9 @@ invoke each one on AgentCore Runtime, and run `agentcore dev` with one local inv are optional and need a `box` on your PATH: `create` checks for one for a CodeZip box template, and `build` and `deploy` run `box profile show` for every Box template, the container one too. Without one, they skip. box ships only arm64 builds, so in CI only the macOS runner (Apple silicon) and the -Linux arm64 runner (`ubuntu-24.04-arm`, which runs only the Box tests) have one: each installs the -box that `src/core/project/backends/boxRelease.json` pins. `create` also installs the agent's dependencies and the CDK app's, which `dev` and -`deploy` use, so the tests don't pass `--skip-install`. +Linux arm64 runner (`ubuntu-24.04-arm`) have one: each installs the box that +`src/core/project/backends/boxRelease.json` pins. `create` also installs the agent's dependencies +and the CDK app's, which `dev` and `deploy` use, so the tests don't pass `--skip-install`. The tests that deploy also need `AGENTCORE_E2E_BOX_CDK`: the pinned `@aws/agentcore-cdk` release cannot deploy a Box project yet. Set it to an `@aws/agentcore-cdk` version or a `file:` tarball From 6a487349d76e815009bb71b363ef5075406bba4d Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 11:06:47 -0800 Subject: [PATCH 4/7] ci(e2e): Check the installed box against the pin in boxRelease.json Pin the macOS arm64 build in boxRelease.json beside the Linux one, written by scripts/bump-box-release.ts. The e2e install step checks each archive against that pin, not against SHA256SUMS.txt of the same release, which anyone who can edit the release could replace with the archive. It also extracts with --no-same-owner. --- .github/workflows/e2e-test.yml | 21 ++++++++++++--------- README.md | 3 ++- e2eTest/README.md | 3 ++- scripts/bump-box-release.ts | 20 +++++++++++++------- src/core/project/backends/boxRelease.json | 5 +++++ src/core/project/backends/boxRelease.ts | 4 +++- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 29facb357f..36a039925e 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -131,21 +131,24 @@ jobs: - name: Install box if: matrix.name == 'macOS' || matrix.name == 'Linux-arm64' env: - TARGET: ${{ matrix.name == 'macOS' && 'aarch64-apple-darwin' || 'aarch64-unknown-linux-gnu' }} + # The build's key in boxRelease.json, which pins its archive and SHA-256. + BUILD: ${{ matrix.name == 'macOS' && 'darwin' || 'linux' }} run: | - REPO=$(jq -r .box.repo src/core/project/backends/boxRelease.json) - VER=$(jq -r .box.version src/core/project/backends/boxRelease.json) - ASSET="box-v${VER}-${TARGET}.tar.gz" - URL="https://github.com/${REPO}/releases/download/v${VER}" + PIN=src/core/project/backends/boxRelease.json + REPO=$(jq -er .box.repo "$PIN") + VER=$(jq -er .box.version "$PIN") + ASSET=$(jq -er ".box.${BUILD}.asset" "$PIN") + SHA=$(jq -er ".box.${BUILD}.sha256" "$PIN") WORK=$(mktemp -d) - curl -fsSL --retry 3 -o "${WORK}/${ASSET}" "${URL}/${ASSET}" - curl -fsSL --retry 3 -o "${WORK}/SHA256SUMS.txt" "${URL}/SHA256SUMS.txt" + curl -fsSL --retry 3 -o "${WORK}/${ASSET}" \ + "https://github.com/${REPO}/releases/download/v${VER}/${ASSET}" + # Check against the pin in the repository, not a checksum file of the same release. # Linux has sha256sum, and macOS may have only shasum. SUM=$(command -v sha256sum || echo "shasum -a 256") - (cd "${WORK}" && grep " ${ASSET}\$" SHA256SUMS.txt | $SUM -c -) + echo "${SHA} ${WORK}/${ASSET}" | $SUM -c - # box reads its packs from resources/ beside it, so keep the release together. sudo mkdir -p /opt/box - sudo tar -xzf "${WORK}/${ASSET}" -C /opt/box + sudo tar --no-same-owner -xzf "${WORK}/${ASSET}" -C /opt/box sudo ln -sf /opt/box/box /usr/local/bin/box box --version # Ubuntu 24.04 lets AppArmor stop an unprivileged process from making a user namespace, which diff --git a/README.md b/README.md index 65dab78c2b..49895bf701 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,8 @@ is needed to download it. When that release has no build for your machine, use t checks of `build`. `src/core/project/backends/boxRelease.json` pins the Linux build of box that ships to AgentCore -Runtime, with its repository, version and SHA-256. `bun scripts/bump-box-release.ts --box ` +Runtime, with its repository, version and SHA-256. It also pins the macOS arm64 build, which the e2e +workflow installs on its macOS runner. `bun scripts/bump-box-release.ts --box ` (with `--box-repo` to move repository) rewrites the file from the release's `SHA256SUMS.txt`. How each command uses it: diff --git a/e2eTest/README.md b/e2eTest/README.md index 238bfae03d..24f4abb87b 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -54,7 +54,8 @@ pins a shim for `PYTHON_3_14` only, so they fail on any machine. The `box-egress` test checks that box, under `agentcore dev`, lets the agent reach the host its profile allows (`checkip.amazonaws.com`) and blocks any other (`example.com`). It reaches public -hosts, so the network can make it fail. It retries twice, and `--tagsFilter='box'` leaves it out: +hosts, so the network can make it fail. It retries twice, and `--tagsFilter='box'` leaves it out. +A full run includes it, so in CI it runs on the macOS and Linux arm64 runners: ```sh bun run test:e2e -- --tagsFilter='box-egress' diff --git a/scripts/bump-box-release.ts b/scripts/bump-box-release.ts index d339c296c7..17feb06df5 100644 --- a/scripts/bump-box-release.ts +++ b/scripts/bump-box-release.ts @@ -1,9 +1,10 @@ #!/usr/bin/env bun /** - Pins box to a published GitHub release, in src/core/project/backends/boxRelease.json. It reads - the release's SHA256SUMS.txt, so the file changes only to a version whose archives are published. - It imports nothing from src/. + Pins box to a published GitHub release, in src/core/project/backends/boxRelease.json: the Linux + arm64 build that ships to AgentCore Runtime, and the macOS arm64 build that the e2e workflow + installs on its macOS runner. It reads the release's SHA256SUMS.txt, so the file changes only to a + version whose archives are published. It imports nothing from src/. bun scripts/bump-box-release.ts --box [--box-repo ] **/ @@ -20,6 +21,7 @@ const FILE = join( "boxRelease.json", ); const LINUX_TARGET = "aarch64-unknown-linux-gnu"; +const DARWIN_TARGET = "aarch64-apple-darwin"; const { values } = parseArgs({ args: Bun.argv.slice(2), @@ -50,10 +52,14 @@ const pinned = await Bun.file(FILE).json(); const repo = values["box-repo"] ?? pinned.box.repo; const version = values.box; const sums = await checksums(repo, version); -const asset = `box-v${version}-${LINUX_TARGET}.tar.gz`; -const linux = sums.get(asset); -if (!linux) throw new Error(`${repo} v${version} lists no ${asset}`); +/** The pinned archive of `target`, which the release must list. */ +function pin(target: string): { target: string; asset: string; sha256: string } { + const asset = `box-v${version}-${target}.tar.gz`; + const sha256 = sums.get(asset); + if (!sha256) throw new Error(`${repo} v${version} lists no ${asset}`); + return { target, asset, sha256 }; +} console.log(`box: ${pinned.box.repo} ${pinned.box.version} → ${repo} ${version}`); -const box = { repo, version, linux: { target: LINUX_TARGET, asset, sha256: linux } }; +const box = { repo, version, linux: pin(LINUX_TARGET), darwin: pin(DARWIN_TARGET) }; await Bun.write(FILE, `${JSON.stringify({ box }, null, 2)}\n`); diff --git a/src/core/project/backends/boxRelease.json b/src/core/project/backends/boxRelease.json index 0270d8b27a..4a12171690 100644 --- a/src/core/project/backends/boxRelease.json +++ b/src/core/project/backends/boxRelease.json @@ -6,6 +6,11 @@ "target": "aarch64-unknown-linux-gnu", "asset": "box-v0.1.11-preview.10-aarch64-unknown-linux-gnu.tar.gz", "sha256": "45740d3ea768783b9a8939111ea0a26efd2dacf27ffa86104a4634ce1c2dc583" + }, + "darwin": { + "target": "aarch64-apple-darwin", + "asset": "box-v0.1.11-preview.10-aarch64-apple-darwin.tar.gz", + "sha256": "76a3909c5c99c435b6ead470be2f401a22c6155b5b60652263bfb1af3ef57e18" } } } diff --git a/src/core/project/backends/boxRelease.ts b/src/core/project/backends/boxRelease.ts index c2ea0aa8cb..cc12466d44 100644 --- a/src/core/project/backends/boxRelease.ts +++ b/src/core/project/backends/boxRelease.ts @@ -25,12 +25,14 @@ const TargetAssetSchema = AssetSchema.extend({ target: z.string().min(1) }); /** * A box release: the Linux arm64 build that ships to AgentCore Runtime. Its archive holds box, - * its helpers, its packs and release.json. + * its helpers, its packs and release.json. `darwin`, the macOS arm64 build, is what the e2e + * workflow installs on its macOS runner; the CLI does not read it. */ const BoxReleaseSchema = z.object({ repo: z.string().min(1), version: z.string().min(1), linux: TargetAssetSchema, + darwin: TargetAssetSchema.optional(), }); export type BoxRelease = z.infer; From bc7101552e462659cce62546c54f0ff8200d8c5a Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 11:35:24 -0800 Subject: [PATCH 5/7] ci(e2e): Keep linuxOnly on the x86_64 Linux job, and test the macOS box pin canary.yml runs this workflow with linuxOnly, so a Linux arm64 job there doubled each canary's deploys and made its heartbeat wait on a hosted arm64 runner. The pinned releases test now checks the darwin entry that the e2e workflow installs from, so a stale pin fails in bun test. --- .github/workflows/e2e-test.yml | 2 +- src/core/project/backends/boxRelease.test.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 36a039925e..29ed848e58 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -100,7 +100,7 @@ jobs: strategy: fail-fast: false matrix: - name: ${{ fromJSON(inputs.linuxOnly && '["Linux","Linux-arm64"]' || '["Linux","Linux-arm64","Windows","macOS"]') }} + name: ${{ fromJSON(inputs.linuxOnly && '["Linux"]' || '["Linux","Linux-arm64","Windows","macOS"]') }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: diff --git a/src/core/project/backends/boxRelease.test.ts b/src/core/project/backends/boxRelease.test.ts index 02fb2b3866..fb028477b3 100644 --- a/src/core/project/backends/boxRelease.test.ts +++ b/src/core/project/backends/boxRelease.test.ts @@ -280,6 +280,11 @@ describe("the pinned releases", () => { `box-v${BOX_RELEASE.version}-aarch64-unknown-linux-gnu.tar.gz`, ); expect(BOX_RELEASE.linux.sha256).toMatch(/^[0-9a-f]{64}$/); + // The e2e workflow installs the macOS build on its macOS runner, from this pin. + expect(BOX_RELEASE.darwin?.asset).toBe( + `box-v${BOX_RELEASE.version}-aarch64-apple-darwin.tar.gz`, + ); + expect(BOX_RELEASE.darwin?.sha256).toMatch(/^[0-9a-f]{64}$/); expect(BOX_RELEASE_PAGE).toBe( `https://github.com/mquang-amazon/box-releases/releases/tag/v${BOX_RELEASE.version}`, ); From 887297f654e9ceeefb4132ff984b7f0c36db07d3 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 14:07:57 -0800 Subject: [PATCH 6/7] test(e2e): Skip the Box container dev test on CI macOS The hosted macOS arm64 runner has no nested virtualization, so it cannot run a container tool, and agentcore dev of the box container template fails there. The Linux arm64 runner still runs it. --- e2eTest/README.md | 5 +++-- e2eTest/project/templates.test.ts | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/e2eTest/README.md b/e2eTest/README.md index 24f4abb87b..1a20795f09 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -39,8 +39,9 @@ that can, for example one packed from the `box-integration` branch of `agentcore/cdk`. Without it, as in CI, they skip. The `dev` tests also need a machine where `box run` can start its sandbox, and for the container -template a container tool. Box listens on the protocol's fixed port (8080, 8000 or 9000), so the -`dev` tests run one at a time and need those ports free: +template a container tool. CI skips the container template's `dev` test on macOS, whose runner +cannot run one; the Linux arm64 runner runs it. Box listens on the protocol's fixed port (8080, +8000 or 9000), so the `dev` tests run one at a time and need those ports free: ```sh AGENTCORE_E2E_BOX_CDK=file:/path/to/aws-agentcore-cdk-1.1.0.tgz bun run test:e2e -- --tagsFilter='box' diff --git a/e2eTest/project/templates.test.ts b/e2eTest/project/templates.test.ts index 9a1ca5478b..1d3167ff1c 100644 --- a/e2eTest/project/templates.test.ts +++ b/e2eTest/project/templates.test.ts @@ -420,8 +420,14 @@ describe.skipIf(!BOX_ON_PATH)( { tags: [TAGS.BOX], sequential: true }, () => { const cli = new CliRunner(); + // The container template's dev needs a container tool, which a CI macOS runner cannot run + // (no nested virtualization), as py_strands_container notes. Linux arm64 runs it. + const noLocalContainers = process.env.CI === "true" && process.platform !== "linux"; + const templates = BOX_TEMPLATES.filter( + (t) => !(noLocalContainers && t.template === "agent-python-strands-box-container"), + ); - test.each(BOX_TEMPLATES)( + test.each(templates)( "$name", { timeout: TIMEOUT_MS.PROJECT_CREATE + TIMEOUT_MS.PROJECT_DEV + TIMEOUT_MS.PROJECT_INVOKE }, async (runtime) => { From 5049104100056c8e4e391894b7621393c7b5f666 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Fri, 20 Nov 2026 15:58:01 -0800 Subject: [PATCH 7/7] test(e2e): Skip the Box container dev test when no container tool runs from PATH Addresses the review of #2872: a capability check in place of CI && !linux. It also covers a local machine with no container tool, says nothing about Windows by accident, and runs the test once a runner gains one. --- e2eTest/README.md | 4 ++-- e2eTest/project/templates.test.ts | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/e2eTest/README.md b/e2eTest/README.md index 1a20795f09..d555a35b61 100644 --- a/e2eTest/README.md +++ b/e2eTest/README.md @@ -39,8 +39,8 @@ that can, for example one packed from the `box-integration` branch of `agentcore/cdk`. Without it, as in CI, they skip. The `dev` tests also need a machine where `box run` can start its sandbox, and for the container -template a container tool. CI skips the container template's `dev` test on macOS, whose runner -cannot run one; the Linux arm64 runner runs it. Box listens on the protocol's fixed port (8080, +template a container tool. The container template's `dev` test skips when no `docker`, `podman` +or `finch` runs from PATH, as on the CI macOS runner; the Linux arm64 runner runs it. Box listens on the protocol's fixed port (8080, 8000 or 9000), so the `dev` tests run one at a time and need those ports free: ```sh diff --git a/e2eTest/project/templates.test.ts b/e2eTest/project/templates.test.ts index 1d3167ff1c..db9b8ebc26 100644 --- a/e2eTest/project/templates.test.ts +++ b/e2eTest/project/templates.test.ts @@ -75,6 +75,11 @@ const AGUI_RUN_PAYLOAD = { * deploy of every Box template run `box profile show`, so the Box tests skip without one. */ const BOX_ON_PATH = spawnSync("box", ["--version"], { stdio: "ignore" }).status === 0; + +/** Whether a container tool that `agentcore dev` uses (docker, podman or finch) runs from PATH. */ +const CONTAINER_TOOL_ON_PATH = ["docker", "podman", "finch"].some( + (tool) => spawnSync(tool, ["--version"], { stdio: "ignore" }).status === 0, +); /** * The opt-in for the Box tests that deploy: an `@aws/agentcore-cdk` version or `file:` tarball * that deploys Box projects, which the pinned release does not yet. It replaces the pin in each @@ -420,11 +425,10 @@ describe.skipIf(!BOX_ON_PATH)( { tags: [TAGS.BOX], sequential: true }, () => { const cli = new CliRunner(); - // The container template's dev needs a container tool, which a CI macOS runner cannot run - // (no nested virtualization), as py_strands_container notes. Linux arm64 runs it. - const noLocalContainers = process.env.CI === "true" && process.platform !== "linux"; + // The container template's dev builds and runs its image, so it needs a container tool, which + // the CI macOS runner does not have (no nested virtualization). const templates = BOX_TEMPLATES.filter( - (t) => !(noLocalContainers && t.template === "agent-python-strands-box-container"), + (t) => CONTAINER_TOOL_ON_PATH || t.template !== "agent-python-strands-box-container", ); test.each(templates)(