Skip to content

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealAmazonKendra committed Oct 2, 2024
1 parent 511eab3 commit 78798f5
Show file tree
Hide file tree
Showing 143 changed files with 75,741 additions and 36,664 deletions.
3 changes: 2 additions & 1 deletion aws-cdk.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"name": "aws-custom-resource-sdk-adapter",
"rootPath": "packages/@aws-cdk/aws-custom-resource-sdk-adapter"
}
]
],
"dotnet.defaultSolution": "disable"
},
"extensions": {
"recommendations": ["dbaeumer.vscode-eslint", "Orta.vscode-jest"]
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ export class AwsClients {
credentials: this.config.credentials,
region: this.config.region,
maxAttempts: 2,
logger: console,
});

return (await stsClient.send(new GetCallerIdentityCommand())).Account!;
return (await stsClient.send(new GetCallerIdentityCommand({}))).Account!;
}

public async deleteStacks(...stackNames: string[]) {
Expand Down
76 changes: 42 additions & 34 deletions packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* eslint-disable no-console */
import * as fs from 'fs';
import * as path from 'path';
import { MemoryStream } from './corking';

const SKIP_TESTS = fs.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' })
const SKIP_TESTS = fs
.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' })
.split('\n')
.map(x => x.trim())
.filter(x => x && !x.startsWith('#'));
.map((x) => x.trim())
.filter((x) => x && !x.startsWith('#'));

if (SKIP_TESTS) {
process.stderr.write(`ℹ️ Skipping tests: ${JSON.stringify(SKIP_TESTS)}\n`);
Expand All @@ -15,7 +17,7 @@ export interface TestContext {
readonly randomString: string;
readonly output: NodeJS.WritableStream;
log(s: string): void;
};
}

if (process.env.JEST_TEST_CONCURRENT === 'true') {
process.stderr.write('ℹ️ JEST_TEST_CONCURRENT is true: tests will run concurrently and filters have no effect!\n0');
Expand All @@ -38,37 +40,41 @@ export function integTest(
const testKind = process.env.JEST_TEST_CONCURRENT === 'true' ? test.concurrent : test;
const runner = shouldSkip(name) ? testKind.skip : testKind;

runner(name, async () => {
const output = new MemoryStream();
runner(
name,
async () => {
const output = new MemoryStream();

output.write('================================================================\n');
output.write(`${name}\n`);
output.write('================================================================\n');
output.write('================================================================\n');
output.write(`${name}\n`);
output.write('================================================================\n');

const now = Date.now();
process.stderr.write(`[INTEG TEST::${name}] Starting (pid ${process.pid})...\n`);
try {
return await callback({
output,
randomString: randomString(),
log(s: string) {
output.write(`${s}\n`);
},
});
} catch (e: any) {
process.stderr.write(`[INTEG TEST::${name}] Failed: ${e}\n`);
output.write(e.message);
output.write(e.stack);
// Print output only if the test fails. Use 'console.log' so the output is buffered by
// jest and prints without a stack trace (if verbose: false).
// eslint-disable-next-line no-console
console.log(output.buffer().toString());
throw e;
} finally {
const duration = Date.now() - now;
process.stderr.write(`[INTEG TEST::${name}] Done (${duration} ms).\n`);
}
}, timeoutMillis);
const now = Date.now();
process.stderr.write(`[INTEG TEST::${name}] Starting (pid ${process.pid})...\n`);
try {
return await callback({
output,
randomString: randomString(),
log(s: string) {
output.write(`${s}\n`);
},
});
} catch (e: any) {
process.stderr.write(`[INTEG TEST::${name}] Failed: ${e}\n`);
output.write(e.message);
output.write(e.stack);
// Print output only if the test fails. Use 'console.log' so the output is buffered by
// jest and prints without a stack trace (if verbose: false).
// eslint-disable-next-line no-console
console.log(output.buffer().toString());
throw e;
} finally {
const duration = Date.now() - now;
process.stderr.write(`[INTEG TEST::${name}] Done (${duration} ms).\n`);
}
},
timeoutMillis,
);
}

function shouldSkip(testName: string) {
Expand All @@ -77,5 +83,7 @@ function shouldSkip(testName: string) {

export function randomString() {
// Crazy
return Math.random().toString(36).replace(/[^a-z0-9]+/g, '');
return Math.random()
.toString(36)
.replace(/[^a-z0-9]+/g, '');
}
7 changes: 3 additions & 4 deletions packages/@aws-cdk-testing/framework-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "^0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@aws-sdk/client-acm": "3.421.0",
"@aws-sdk/client-rds": "3.421.0",
"@aws-sdk/client-s3": "3.421.0",
"@aws-sdk/client-acm": "3.637.0",
"@aws-sdk/client-rds": "3.637.0",
"@aws-sdk/client-s3": "3.637.0",
"delay": "5.0.0"
},
"dependencies": {
Expand All @@ -43,7 +43,6 @@
"@aws-cdk/lambda-layer-kubectl-v29": "^2.1.0",
"@aws-cdk/lambda-layer-kubectl-v30": "^2.0.0",
"aws-cdk-lib": "0.0.0",
"aws-sdk-mock": "5.6.0",
"cdk8s": "2.68.85",
"cdk8s-plus-27": "2.9.5",
"constructs": "^10.0.0"
Expand Down

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

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

This file was deleted.

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

Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "e0e799a729f2e647a95d0ba4e1b63e93839a8f3034bfcb17ba52ea561cafba19.zip"
"S3Key": "782a34c2ce2f5bc5e5b90304f41348680a6f9ba7a0eb2de6f03658640f67ff15.zip"
},
"Timeout": 900,
"MemorySize": 128,
Expand Down

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

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

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

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

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

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

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

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ac5727a1b8e23c42dabba9ff5155c8fb26ae68568e083beac0908af8e70fc606.zip"
"S3Key": "7b64ec3318d486010584f55d9a3e6ef3ecec282ce95c1d3aa61aa73b0501f64d.zip"
},
"Timeout": 900,
"MemorySize": 128,
Expand Down

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

Loading

0 comments on commit 78798f5

Please sign in to comment.