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
102 changes: 102 additions & 0 deletions .github/workflows/common-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,55 @@ jobs:
- name: Test - observability mode
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/cdk-esm.test.ts

test-cdk-nested:
runs-on: ubuntu-latest
concurrency:
group: test-cdk-nested
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
node prepareForTest.js cdk-nested
npm i
- name: Download build artifact
uses: actions/download-artifact@v4
if: ${{ inputs.mode == 'build' }}
with:
name: dist
path: dist
- name: Install lambda-live-debugger globally
if: ${{ inputs.mode == 'global' }}
run: |
npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g
working-directory: test
- name: Install lambda-live-debugger locally
if: ${{ inputs.mode == 'local' }}
run: |
npm i lambda-live-debugger@${{ inputs.version || 'latest' }}
working-directory: test
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActions
- name: Destroy
run: npm run destroy
working-directory: test/cdk-nested
continue-on-error: true
- name: Deploy
run: npm run deploy
working-directory: test/cdk-nested
- name: Test
run: npx vitest --retry 2 test/cdk-nested.test.ts
- name: Test - observability mode
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/cdk-nested.test.ts

test-sls-basic:
runs-on: ubuntu-latest
concurrency:
Expand Down Expand Up @@ -484,6 +533,59 @@ jobs:
- name: Test - observability mode
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sam-basic.test.ts

test-sam-nested:
runs-on: ubuntu-latest
concurrency:
group: test-sam-nested
steps:
- uses: actions/checkout@v4
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
node prepareForTest.js sam-nested
npm i
- name: Download build artifact
uses: actions/download-artifact@v4
if: ${{ inputs.mode == 'build' }}
with:
name: dist
path: dist
- name: Install lambda-live-debugger globally
if: ${{ inputs.mode == 'global' }}
run: |
npm i lambda-live-debugger@${{ inputs.version || 'latest' }} -g
working-directory: test
- name: Install lambda-live-debugger locally
if: ${{ inputs.mode == 'local' }}
run: |
npm i lambda-live-debugger@${{ inputs.version || 'latest' }}
working-directory: test
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActions
- name: Destroy
run: npm run destroy
working-directory: test/sam-nested
continue-on-error: true
- name: Deploy
run: npm run deploy
working-directory: test/sam-nested
- name: Test
run: npx vitest --retry 2 test/sam-nested.test.ts
- name: Test - observability mode
run: OBSERVABLE_MODE=true npx vitest --retry 2 test/sam-nested.test.ts

test-sam-alt:
runs-on: ubuntu-latest
concurrency:
Expand Down
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,26 @@
"type": "node",
"cwd": "${workspaceRoot}/test/sam-basic"
},
{
"name": "LLDebugger - SAM nested",
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
"args": ["../../src/lldebugger.ts", "--config-env=test"],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"type": "node",
"cwd": "${workspaceRoot}/test/sam-nested"
},
{
"name": "LLDebugger - SAM nested - observability",
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
"args": ["../../src/lldebugger.ts", "--config-env=test", "-o"],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"type": "node",
"cwd": "${workspaceRoot}/test/sam-nested"
},
{
"name": "LLDebugger - SAM alt",
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"test-osls-esbuild-esm-observable": "npm run build && RUN_TEST_FROM_CLI=true OBSERVABLE_MODE=true vitest run test/osls-esbuild-esm.test.ts",
"test-sam-basic": "npm run build && RUN_TEST_FROM_CLI=true vitest run test/sam-basic.test.ts",
"test-sam-basic-observable": "npm run build && RUN_TEST_FROM_CLI=true OBSERVABLE_MODE=true vitest run test/sam-basic.test.ts",
"test-sam-nested": "npm run build && RUN_TEST_FROM_CLI=true vitest run test/sam-nested.test.ts",
"test-sam-nested-observable": "npm run build && RUN_TEST_FROM_CLI=true OBSERVABLE_MODE=true vitest run test/sam-nested.test.ts",
"test-sam-alt": "npm run build && RUN_TEST_FROM_CLI=true vitest run test/sam-alt.test.ts",
"test-sam-alt-observable": "npm run build && RUN_TEST_FROM_CLI=true OBSERVABLE_MODE=true vitest run test/sam-alt.test.ts",
"test-terraform-basic": "npm run build && RUN_TEST_FROM_CLI=true vitest run test/terraform-basic.test.ts",
Expand Down Expand Up @@ -161,6 +163,7 @@
"test/osls-esbuild",
"test/osls-esbuild-cjs",
"test/sam-basic",
"test/sam-nested",
"test/sam-alt",
"test/terraform-basic",
"test/opentofu-basic"
Expand Down
4 changes: 4 additions & 0 deletions src/cloudFormation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ async function getCloudFormationResources(
async function getLambdasInStack(
stackName: string,
awsConfiguration: AwsConfiguration,
stackLogicalId?: string,
): Promise<
Array<{
lambdaName: string;
logicalId: string;
stackName: string;
stackLogicalId: string;
}>
> {
const response = await getCloudFormationResources(
Expand All @@ -165,6 +167,7 @@ async function getLambdasInStack(
lambdaName: resource.PhysicalResourceId!,
logicalId: resource.LogicalResourceId!,
stackName: stackName,
stackLogicalId: stackLogicalId ?? stackName,
};
}) ?? [];

Expand All @@ -175,6 +178,7 @@ async function getLambdasInStack(
const lambdasInNestedStack = await getLambdasInStack(
nestedStack.PhysicalResourceId,
awsConfiguration,
nestedStack.LogicalResourceId,
);

return lambdasInNestedStack;
Expand Down
Loading
Loading