Skip to content

Commit b941fbc

Browse files
authored
ci: add cross-package e2e matrix testing against CDK constructs main (#610)
1 parent 7abdde8 commit b941fbc

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/e2e-tests.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
runs-on: ubuntu-latest
4848
environment: e2e-testing
4949
timeout-minutes: 30
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
cdk-source: [npm, main]
5054
steps:
5155
- uses: actions/checkout@v6
5256
with:
@@ -74,13 +78,30 @@ jobs:
7478
secret-ids: |
7579
E2E,${{ secrets.E2E_SECRET_ARN }}
7680
parse-json-secrets: true
81+
82+
# Build @aws/agentcore-cdk from source for cross-package testing.
83+
# Requires secrets: CDK_REPO_NAME (org/repo), CDK_REPO_TOKEN (fine-grained PAT)
84+
- name: Build CDK package from main
85+
if: matrix.cdk-source == 'main'
86+
run: |
87+
git clone --depth 1 "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo
88+
cd /tmp/cdk-repo
89+
npm ci
90+
npm run build
91+
TARBALL=$(npm pack --pack-destination "$RUNNER_TEMP" | tail -1)
92+
echo "CDK_TARBALL=$RUNNER_TEMP/$TARBALL" >> "$GITHUB_ENV"
93+
env:
94+
CDK_REPO_TOKEN: ${{ secrets.CDK_REPO_TOKEN }}
95+
CDK_REPO: ${{ secrets.CDK_REPO_NAME }}
96+
7797
- run: npm ci
7898
- run: npm run build
79-
- name: Run E2E tests
99+
- name: Run E2E tests (${{ matrix.cdk-source }})
80100
env:
81101
AWS_ACCOUNT_ID: ${{ steps.aws.outputs.account_id }}
82102
AWS_REGION: ${{ inputs.aws_region || 'us-east-1' }}
83103
ANTHROPIC_API_KEY: ${{ env.E2E_ANTHROPIC_API_KEY }}
84104
OPENAI_API_KEY: ${{ env.E2E_OPENAI_API_KEY }}
85105
GEMINI_API_KEY: ${{ env.E2E_GEMINI_API_KEY }}
106+
CDK_TARBALL: ${{ env.CDK_TARBALL }}
86107
run: npx vitest run --project e2e strands-bedrock strands-openai langgraph-bedrock googleadk-gemini

e2e-tests/e2e-helper.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ export function createE2ESuite(cfg: E2EConfig) {
9292
const region = process.env.AWS_REGION ?? 'us-east-1';
9393
const awsTargetsPath = join(projectPath, 'agentcore', 'aws-targets.json');
9494
await writeFile(awsTargetsPath, JSON.stringify([{ name: 'default', account, region }]));
95+
96+
// Override @aws/agentcore-cdk with a local tarball if provided (for cross-package testing)
97+
if (process.env.CDK_TARBALL) {
98+
execSync(`npm install -f ${process.env.CDK_TARBALL}`, {
99+
cwd: join(projectPath, 'agentcore', 'cdk'),
100+
stdio: 'pipe',
101+
});
102+
}
95103
}, 300000);
96104

97105
afterAll(async () => {

0 commit comments

Comments
 (0)