From 95442943a5b5a00033fdf963b8bcd88e79f088ec Mon Sep 17 00:00:00 2001 From: Nicolas Borges Date: Fri, 23 Oct 2026 14:50:23 -0400 Subject: [PATCH 1/2] feat(ci): run v1 canary against the published npm package --- .github/workflows/README.md | 8 +++++--- .github/workflows/canary.yml | 3 +++ .github/workflows/e2e-test.yml | 19 ++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 597cb0cb1..90229ffd3 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -32,7 +32,8 @@ ci.yml `-- e2e-test.yml (deploys and invokes real AgentCore resources) canary.yml (scheduled) - |-- e2e-test.yml + |-- resolves @aws/agentcore@latest and its matching Git tag + |-- e2e-test.yml (tests the installed npm package with the tagged test suite) `-- emit-canary-heartbeat.sh canary-v0.yml (scheduled) @@ -45,8 +46,9 @@ release-main-and-preview.yml (npm publish and GitHub release when a release PR m `-- verify.yml ``` -`verify.yml` and `e2e-test.yml` each appear in two orchestrators. This is the -point — write once, compose freely. +`verify.yml` and `e2e-test.yml` each appear in two orchestrators. Push CI builds +the CLI from source for E2E, while the canary installs the resolved npm version. +Both use the same E2E test runner. ## Naming Convention diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 56bb81b3b..372ffc8d4 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -18,6 +18,7 @@ jobs: runs-on: codebuild-agentcore-e2e-${{ github.run_id }}-${{ github.run_attempt }} outputs: ref: ${{ steps.resolve.outputs.ref }} + version: ${{ steps.resolve.outputs.version }} steps: - uses: actions/setup-node@v4 with: @@ -38,12 +39,14 @@ jobs: exit 1 fi echo "ref=${ref}" >> "$GITHUB_OUTPUT" + echo "version=${version}" >> "$GITHUB_OUTPUT" e2e: needs: resolve_release uses: ./.github/workflows/e2e-test.yml with: ref: ${{ needs.resolve_release.outputs.ref }} + npmVersion: ${{ needs.resolve_release.outputs.version }} tags: canary linuxOnly: true secrets: diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 06ad47e87..acfff7908 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -3,7 +3,12 @@ on: workflow_call: inputs: ref: - description: git reference (commit, branch, or tag) to build and test + description: git reference (commit, branch, or tag) for the E2E test suite + required: false + type: string + default: "" + npmVersion: + description: install this exact published npm version instead of building the CLI from source required: false type: string default: "" @@ -121,16 +126,24 @@ jobs: aws-region: ${{ vars.E2E_REGION || 'us-east-1' }} unset-current-credentials: true - name: Build CLI + if: inputs.npmVersion == '' run: bun run build + - name: Install published CLI + if: inputs.npmVersion != '' + env: + NPM_VERSION: ${{ inputs.npmVersion }} + run: | + npm install --global "@aws/agentcore@${NPM_VERSION}" + agentcore --version - name: Run all E2E tests if: inputs.tags == '' env: - AGENTCORE_CLI_PATH: node ${{ github.workspace }}/dist/index.js + 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 != '' env: - AGENTCORE_CLI_PATH: node ${{ github.workspace }}/dist/index.js + 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 }}" From b0f30c3ac64d22359fee92ac8a7a1adea5e72ecb Mon Sep 17 00:00:00 2001 From: Nicolas Borges Date: Fri, 23 Oct 2026 15:19:01 -0400 Subject: [PATCH 2/2] fix(ci): support npm CLI shim on windows --- e2eTest/helpers/run.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2eTest/helpers/run.ts b/e2eTest/helpers/run.ts index 008244692..d4a937b8a 100644 --- a/e2eTest/helpers/run.ts +++ b/e2eTest/helpers/run.ts @@ -1,4 +1,4 @@ -import { spawn } from "node:child_process"; +import spawn from "cross-spawn"; import z from "zod"; /** Given a CLI process, captures its standard output, error output, and exit code. */ @@ -32,8 +32,8 @@ export class CliRunner { const child = this.start(args, cwd); let stdout = ""; let stderr = ""; - child.stdout.on("data", (chunk) => (stdout += chunk)); - child.stderr.on("data", (chunk) => (stderr += chunk)); + child.stdout!.on("data", (chunk) => (stdout += chunk)); + child.stderr!.on("data", (chunk) => (stderr += chunk)); child.on("error", reject); child.on("close", (exitCode) => resolve({ stdout, stderr, exitCode: exitCode ?? -1 })); });