Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down Expand Up @@ -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 }}"
6 changes: 3 additions & 3 deletions e2eTest/helpers/run.ts
Original file line number Diff line number Diff line change
@@ -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. */
Expand Down Expand Up @@ -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 }));
});
Expand Down
Loading