Skip to content

Commit cf35f57

Browse files
authored
fix(integ-runner): snapshots involving AZs are different if enableLookups: false (#685)
In #666 we used `synthFast()` to always generate a snapshot in the same was as was used for validating (which was also using `synthFast()`). The difference being, that the context we load depends on the `enableLookups: false|true` flag that's passed to `new IntegTest()` in the test case itself. So when writing the snapshot we have to take that same field into account. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 7b10fee commit cf35f57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,13 @@ export abstract class IntegRunner {
326326
fs.removeSync(this.snapshotDir);
327327
}
328328

329+
const actualTestSuite = await this.actualTestSuite();
330+
329331
// if lookups are enabled then we need to synth again
330332
// using dummy context and save that as the snapshot
331333
await this.cdk.synthFast({
332334
execCmd: this.cdkApp.split(' '),
333-
context: this.getContext(DEFAULT_SYNTH_OPTIONS.context),
335+
context: this.getContext(actualTestSuite.enableLookups ? DEFAULT_SYNTH_OPTIONS.context : {}),
334336
env: DEFAULT_SYNTH_OPTIONS.env,
335337
output: path.relative(this.directory, this.snapshotDir),
336338
});

0 commit comments

Comments
 (0)