Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript (v3): Integration test fix #7165

Merged
merged 1 commit into from
Dec 19, 2024
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
3 changes: 2 additions & 1 deletion javascriptv3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ COPY --chown=automation:automation ./workflows /workflows

# Set default command
# `npm i` needs to be run in the container. Otherwise it causes a dependency issue: https://github.com/evanw/esbuild/issues/1646#issuecomment-1238080595
CMD npm i --prefix /javascriptv3 && npm run --prefix /javascriptv3 integration-test
# `aws-cdk` is required by some integration tests in order to deploy resources
CMD npm i -g aws-cdk && npm i --prefix /javascriptv3 && npm run --prefix /javascriptv3 integration-test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class PoolsAndTriggersStack extends Stack {

constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
this.createFunction("AutoConfirmHandler");
this.createFunction("autoConfirmHandler");
this.poolsAndTriggersBase.outputs(this);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { readFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { spawn } from "node:child_process";

import { describe, it, expect, beforeAll, afterAll } from "vitest";
import { describe, it, beforeAll, afterAll } from "vitest";
import {
Capability,
CloudFormationClient,
CreateStackCommand,
DeleteStackCommand,
DescribeStacksCommand,
} from "@aws-sdk/client-cloudformation";
Expand All @@ -24,16 +22,24 @@ describe("Scenario - AutoConfirm", () => {
const stackName = "PoolsAndTriggersStack";

beforeAll(async () => {
const path = join(__dirname, "../cdk/stack.yaml");
const stack = await readFile(path, { encoding: "utf8" });
const cdkDeploy = spawn("cdk", ["deploy", "--require-approval", "never"], {
cwd: `${__dirname}/../cdk`,
});

cdkDeploy.stderr.on("data", (d) => {
console.error(d);
});

await new Promise((resolve, reject) => {
cdkDeploy.on("exit", (code) => {
if (code === 0) {
resolve();
} else {
reject();
}
});
});

await cloudformationClient.send(
new CreateStackCommand({
StackName: stackName,
TemplateBody: stack,
Capabilities: [Capability.CAPABILITY_NAMED_IAM],
}),
);
await retry(
{ intervalInMs: 2000, maxRetries: 100, backoff: 5000 },
async () => {
Expand Down
Loading