Skip to content

Commit 7138057

Browse files
authored
fix(integ-runner): always resynth on deploy (#20508)
We were trying to save time by re-using a previously synthed cloud assembly if it existed, but we should not be doing this. When we perform the deployment we could be using new settings (or context) that needs to be applied to the synth. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7f237a2 commit 7138057

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export class IntegTestRunner extends IntegRunner {
259259
...actualTestCase?.cdkCommandOptions?.deploy?.args,
260260
...actualTestCase.assertionStack ? { outputsFile: path.join(this.cdkOutDir, 'assertion-results.json') } : undefined,
261261
context: this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context),
262-
app: this.hasTmpActualSnapshot() ? this.cdkOutDir : this.cdkApp,
262+
app: this.cdkApp,
263263
});
264264

265265
if (actualTestCase.hooks?.postDeploy) {

packages/@aws-cdk/integ-runner/lib/runner/runner-base.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export abstract class IntegRunner {
146146
this.testName = testName;
147147
} else {
148148
const relativePath = path.relative(options.directory, parsed.dir);
149-
this.testName = `${relativePath ? relativePath+'/' : ''}${parsed.name}`;
149+
this.testName = `${relativePath ? relativePath + '/' : ''}${parsed.name}`;
150150
}
151151
this.snapshotDir = path.join(this.directory, `${testName}.integ.snapshot`);
152152
this.relativeSnapshotDir = `${testName}.integ.snapshot`;
@@ -210,10 +210,6 @@ export abstract class IntegRunner {
210210
return fs.existsSync(this.snapshotDir);
211211
}
212212

213-
public hasTmpActualSnapshot(): boolean {
214-
return fs.existsSync(path.join(this.directory, this.cdkOutDir));
215-
}
216-
217213
/**
218214
* Load the integ manifest which contains information
219215
* on how to execute the tests
@@ -371,7 +367,7 @@ export abstract class IntegRunner {
371367
}
372368

373369
protected getContext(additionalContext?: Record<string, any>): Record<string, any> {
374-
const futureFlags: {[key: string]: any} = {};
370+
const futureFlags: { [key: string]: any } = {};
375371
Object.entries(FUTURE_FLAGS)
376372
.filter(([k, _]) => !FUTURE_FLAGS_EXPIRED.includes(k))
377373
.forEach(([k, v]) => futureFlags[k] = v);

packages/@aws-cdk/integ-runner/test/runner/integ-test-runner.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('IntegTest runIntegTests', () => {
7878
stacks: ['test-stack'],
7979
});
8080
expect(deployMock).toHaveBeenCalledWith({
81-
app: 'cdk-integ.out.test-with-snapshot',
81+
app: 'node integ.test-with-snapshot.js',
8282
requireApproval: 'never',
8383
pathMetadata: false,
8484
assetMetadata: false,

0 commit comments

Comments
 (0)