Skip to content

Commit 763a747

Browse files
committed
fix(integ-runner): skip region validation for snapshot tests
1 parent 28511f8 commit 763a747

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/@aws-cdk/integ-runner/lib/engines/toolkit-lib.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ export class ToolkitLibRunnerEngine implements ICdk {
264264
*
265265
* This catches that misconfiguration.
266266
*/
267-
private async validateRegion(asm: IReadableCloudAssembly) {
267+
private async validateRegion(asm: IReadableCloudAssembly): Promise<void> {
268+
// this happens for existing snapshots, in that case nothing to check
269+
if (this.options.region === UNKNOWN_REGION) {
270+
return;
271+
}
272+
268273
for (const stack of asm.cloudAssembly.stacksRecursively) {
269274
if (stack.environment.region !== this.options.region && stack.environment.region !== UNKNOWN_REGION) {
270275
this.ioHost.notify({

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as path from 'path';
22
import type { WritableOptions } from 'stream';
33
import { Writable } from 'stream';
44
import { StringDecoder } from 'string_decoder';
5+
import { UNKNOWN_REGION } from '@aws-cdk/cloud-assembly-api';
56
import type { ResourceDifference } from '@aws-cdk/cloudformation-diff';
67
import { fullDiff, formatDifferences, ResourceImpact } from '@aws-cdk/cloudformation-diff';
78
import { AssemblyManifestReader } from './private/cloud-assembly';
@@ -37,7 +38,7 @@ export class IntegSnapshotRunner extends IntegRunner {
3738
constructor(options: Omit<IntegRunnerOptions, 'region'>) {
3839
super({
3940
...options,
40-
region: 'unused',
41+
region: UNKNOWN_REGION,
4142
});
4243
}
4344

0 commit comments

Comments
 (0)