Skip to content

Commit

Permalink
Merge branch 'main' into mrgrain/feat/integ-runner-config
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 17, 2022
2 parents 3b84dd5 + 5b3d06d commit 41c962f
Show file tree
Hide file tree
Showing 72 changed files with 3,313 additions and 658 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.57",
"cdk-generate-synthetic-examples": "^0.1.64",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.188",
"@types/lodash": "^4.14.189",
"jest": "^27.5.1",
"lodash": "^4.17.21"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
"@types/sinon": "^9.0.11",
"@types/yaml": "1.9.6",
"aws-sdk": "^2.1211.0",
"cdk8s": "^2.5.39",
"cdk8s": "^2.5.46",
"cdk8s-plus-21": "^2.0.0-beta.12",
"cdk8s-plus-23": "2.0.21",
"cdk8s-plus-23": "2.0.28",
"jest": "^27.5.1",
"sinon": "^9.2.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"delay": "5.0.0",
"esbuild": "^0.15.13"
"esbuild": "^0.15.14"
},
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.108",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.188",
"@types/lodash": "^4.14.189",
"jest": "^27.5.1",
"lodash": "^4.17.21"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
"@types/aws-lambda": "^8.10.108",
"@types/fs-extra": "^8.1.2",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.188",
"@types/lodash": "^4.14.189",
"@types/minimatch": "^3.0.5",
"aws-sdk": "^2.928.0",
"@types/node": "^14.18.33",
Expand Down
2 changes: 2 additions & 0 deletions packages/@aws-cdk/integ-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ Test Results:
Tests: 1 passed, 1 total
```

Nested stack templates are also compared as part of the snapshot. However asset hashes are ignored by default. To enable diff for asset hashes, set `diffAssets: true` of `IntegTestProps`.

#### Update Workflow

By default, integration tests are run with the "update workflow" enabled. This can be disabled by using the `--disable-update-workflow` command line option.
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The @aws-cdk/integ-runner package includes the following third-party software/licensing:

** ajv@8.11.0 - https://www.npmjs.com/package/ajv/v/8.11.0 | MIT
** ajv@8.11.2 - https://www.npmjs.com/package/ajv/v/8.11.2 | MIT
The MIT License (MIT)

Copyright (c) 2015-2021 Evgeny Poberezkin
Expand Down Expand Up @@ -156,7 +156,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE

----------------

** aws-sdk@2.1250.0 - https://www.npmjs.com/package/aws-sdk/v/2.1250.0 | Apache-2.0
** aws-sdk@2.1255.0 - https://www.npmjs.com/package/aws-sdk/v/2.1255.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ export class AssemblyManifestReader {
return stacks;
}

/**
* Get the nested stacks for a given stack
* returns a map of artifactId to CloudFormation template
*/
public getNestedStacksForStack(stackId: string): Record<string, any> {
const nestedTemplates: string[] = this.getAssetManifestsForStack(stackId).flatMap(
manifest => manifest.files
.filter(asset => asset.source.path?.endsWith('.nested.template.json'))
.map(asset => asset.source.path!),
);

const nestedStacks: Record<string, any> = Object.fromEntries(nestedTemplates.map(templateFile => ([
templateFile.split('.', 1)[0],
fs.readJSONSync(path.resolve(this.directory, templateFile)),
])));

return nestedStacks;
}

/**
* Write trace data to the assembly manifest metadata
*/
Expand Down Expand Up @@ -125,6 +144,19 @@ export class AssemblyManifestReader {
return assets;
}

/**
* Return a list of asset artifacts for a given stack
*/
public getAssetManifestsForStack(stackId: string): AssetManifest[] {
return Object.values(this.manifest.artifacts ?? {})
.filter(artifact =>
artifact.type === ArtifactType.ASSET_MANIFEST && (artifact.properties as AssetManifestProperties)?.file === `${stackId}.assets.json`)
.map(artifact => {
const fileName = (artifact.properties as AssetManifestProperties).file;
return AssetManifest.fromFile(path.join(this.directory, fileName));
});
}

/**
* Get a list of assets from the assembly manifest
*/
Expand Down Expand Up @@ -153,7 +185,7 @@ export class AssemblyManifestReader {
assetManifest.entries.forEach(entry => {
if (entry.type === 'file') {
const source = (entry as FileManifestEntry).source;
if (source.path && source.path.startsWith('asset.')) {
if (source.path && (source.path.startsWith('asset.') || source.path.endsWith('nested.template.json'))) {
assets.push(entry as FileManifestEntry);
}
} else if (entry.type === 'docker-image') {
Expand Down
Loading

0 comments on commit 41c962f

Please sign in to comment.