Skip to content

Commit ff38b62

Browse files
committed
test: update snapshot for cdk.ts e2e tag injection
1 parent 0e819a1 commit ff38b62

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,26 @@ async function main() {
114114
| Record<string, { credentialProviderArn: string; clientSecretArn?: string }>
115115
| undefined;
116116
117+
const tags: Record<string, string> = {
118+
'agentcore:project-name': spec.name,
119+
'agentcore:target-name': target.name,
120+
};
121+
122+
// Opt-in e2e test tagging via env vars. Used by the CLI's own e2e suite
123+
// so an infra sweeper can identify and delete orphaned test stacks.
124+
if (process.env.AGENTCORE_E2E_TEST === '1') {
125+
tags.Environment = 'e2e-test';
126+
tags.CreatedAt = new Date().toISOString();
127+
tags.CreatedBy = process.env.AGENTCORE_E2E_CREATOR ?? 'github-actions';
128+
}
129+
117130
new AgentCoreStack(app, stackName, {
118131
spec,
119132
mcpSpec,
120133
credentials,
121134
env,
122135
description: \`AgentCore stack for \${spec.name} deployed to \${target.name} (\${target.region})\`,
123-
tags: {
124-
'agentcore:project-name': spec.name,
125-
'agentcore:target-name': target.name,
126-
},
136+
tags,
127137
});
128138
}
129139

0 commit comments

Comments
 (0)