Skip to content

Commit 07e4bb5

Browse files
jchrostek-ddclaude
andauthored
refactor(integration-tests): consolidate lambda code and test structure (#1102)
## Overview - Some refactoring to cleanup the integration test code, will make it easier for some future changes I plan on making (adding more comprehensive tests) - No change to actual extension code. ## Summary - Rename `base` stack to `on-demand` for clearer naming - Create shared lambda handlers (`default-*`) used by on-demand, lmi, and snapstart stacks - Refactor tests to use `describe.each` pattern for iterating over runtimes - Add new test utilities (`default.ts`, `invoke.ts`) for cleaner test organization - Remove duplicate per-stack lambda code in favor of shared handlers This refactoring consolidates ~20 duplicate lambda handler files into 4 shared handlers (one per runtime), making the test infrastructure easier to maintain and extend. ## Test plan - [x] Deployed on-demand stack to sandbox account - [x] Ran `on-demand.test.ts` - all 40 tests passed - [x] CI checks 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 67eebf0 commit 07e4bb5

File tree

48 files changed

+1622
-2477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1622
-2477
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_suites:
2-
- name: base
2+
- name: on-demand
33
- name: otlp
44
- name: snapstart
55
- name: lmi

integration-tests/bin/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
import 'source-map-support/register';
33
import * as cdk from 'aws-cdk-lib';
4-
import {Base} from '../lib/stacks/base';
4+
import {OnDemand} from '../lib/stacks/on-demand';
55
import {Otlp} from '../lib/stacks/otlp';
66
import {Snapstart} from '../lib/stacks/snapstart';
77
import {LambdaManagedInstancesStack} from '../lib/stacks/lmi';
@@ -22,7 +22,7 @@ const identifier = getIdentifier();
2222
new CapacityProviderStack(app, `integ-default-capacity-provider`, {env});
2323

2424
const stacks = [
25-
new Base(app, `integ-${identifier}-base`, {
25+
new OnDemand(app, `integ-${identifier}-on-demand`, {
2626
env,
2727
}),
2828
new Otlp(app, `integ-${identifier}-otlp`, {

integration-tests/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import * as os from 'os';
33
export const ACCOUNT = process.env.CDK_DEFAULT_ACCOUNT || process.env.AWS_ACCOUNT_ID;
44
export const REGION = process.env.CDK_DEFAULT_REGION || process.env.AWS_REGION || 'us-east-1';
55

6+
// Default wait time for Datadog to index logs and traces after Lambda invocation
7+
export const DEFAULT_DATADOG_INDEXING_WAIT_MS = 5 * 60 * 1000; // 5 minutes
8+
9+
// Extended wait time for async invocations (SQS, SNS) - need more time for message processing
10+
export const ASYNC_DATADOG_INDEXING_WAIT_MS = 90 * 1000; // 90 seconds
11+
12+
// Extended wait time for tests that need more time (e.g., OTLP tests)
13+
export const DATADOG_INDEXING_WAIT_5_MIN_MS = 5 * 60 * 1000; // 5 minutes
14+
615

716
export function getIdentifier(): string {
817
if (process.env.IDENTIFIER) {

integration-tests/lambda/base-dotnet/Function.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

integration-tests/lambda/base-java/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

integration-tests/lambda/base-java/pom.xml

Lines changed: 0 additions & 50 deletions
This file was deleted.

integration-tests/lambda/base-java/src/main/java/example/Handler.java

Lines changed: 0 additions & 13 deletions
This file was deleted.

integration-tests/lambda/base-node/index.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

integration-tests/lambda/base-node/package.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

integration-tests/lambda/base-python/lambda_function.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)