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

fix(integ-runner): always resynth on deploy #20508

Merged
merged 2 commits into from
May 26, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class IntegTestRunner extends IntegRunner {
...actualTestCase?.cdkCommandOptions?.deploy?.args,
...actualTestCase.assertionStack ? { outputsFile: path.join(this.cdkOutDir, 'assertion-results.json') } : undefined,
context: this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context),
app: this.hasTmpActualSnapshot() ? this.cdkOutDir : this.cdkApp,
app: this.cdkApp,
});

if (actualTestCase.hooks?.postDeploy) {
Expand Down
8 changes: 2 additions & 6 deletions packages/@aws-cdk/integ-runner/lib/runner/runner-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export abstract class IntegRunner {
this.testName = testName;
} else {
const relativePath = path.relative(options.directory, parsed.dir);
this.testName = `${relativePath ? relativePath+'/' : ''}${parsed.name}`;
this.testName = `${relativePath ? relativePath + '/' : ''}${parsed.name}`;
}
this.snapshotDir = path.join(this.directory, `${testName}.integ.snapshot`);
this.relativeSnapshotDir = `${testName}.integ.snapshot`;
Expand Down Expand Up @@ -210,10 +210,6 @@ export abstract class IntegRunner {
return fs.existsSync(this.snapshotDir);
}

public hasTmpActualSnapshot(): boolean {
return fs.existsSync(path.join(this.directory, this.cdkOutDir));
}

/**
* Load the integ manifest which contains information
* on how to execute the tests
Expand Down Expand Up @@ -371,7 +367,7 @@ export abstract class IntegRunner {
}

protected getContext(additionalContext?: Record<string, any>): Record<string, any> {
const futureFlags: {[key: string]: any} = {};
const futureFlags: { [key: string]: any } = {};
Object.entries(FUTURE_FLAGS)
.filter(([k, _]) => !FUTURE_FLAGS_EXPIRED.includes(k))
.forEach(([k, v]) => futureFlags[k] = v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('IntegTest runIntegTests', () => {
stacks: ['test-stack'],
});
expect(deployMock).toHaveBeenCalledWith({
app: 'cdk-integ.out.test-with-snapshot',
app: 'node integ.test-with-snapshot.js',
requireApproval: 'never',
pathMetadata: false,
assetMetadata: false,
Expand Down