@aws-cdk/integ-runner 2.187.1 → 2.187.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +3 -5
- package/lib/runner/integ-test-runner.d.ts +6 -2
- package/lib/runner/integ-test-runner.js +53 -44
- package/lib/runner/integ-test-suite.d.ts +1 -1
- package/lib/runner/integ-test-suite.js +3 -3
- package/lib/runner/runner-base.d.ts +21 -17
- package/lib/runner/runner-base.js +40 -26
- package/lib/runner/snapshot-test-runner.d.ts +2 -2
- package/lib/runner/snapshot-test-runner.js +14 -12
- package/lib/utils.d.ts +12 -0
- package/lib/utils.js +15 -1
- package/lib/workers/extract/extract_worker.d.ts +2 -2
- package/lib/workers/extract/extract_worker.js +7 -7
- package/lib/workers/extract/index.js +300 -283
- package/package.json +13 -12
|
@@ -1084,20 +1084,6 @@ var init_synth = __esm({
|
|
|
1084
1084
|
}
|
|
1085
1085
|
});
|
|
1086
1086
|
|
|
1087
|
-
// ../cdk-cli-wrapper/lib/commands/common.ts
|
|
1088
|
-
var RequireApproval;
|
|
1089
|
-
var init_common = __esm({
|
|
1090
|
-
"../cdk-cli-wrapper/lib/commands/common.ts"() {
|
|
1091
|
-
"use strict";
|
|
1092
|
-
RequireApproval = /* @__PURE__ */ ((RequireApproval4) => {
|
|
1093
|
-
RequireApproval4["NEVER"] = "never";
|
|
1094
|
-
RequireApproval4["ANYCHANGE"] = "any-change";
|
|
1095
|
-
RequireApproval4["BROADENING"] = "broadening";
|
|
1096
|
-
return RequireApproval4;
|
|
1097
|
-
})(RequireApproval || {});
|
|
1098
|
-
}
|
|
1099
|
-
});
|
|
1100
|
-
|
|
1101
1087
|
// ../cdk-cli-wrapper/lib/commands/deploy.ts
|
|
1102
1088
|
var HotswapMode, StackActivityProgress;
|
|
1103
1089
|
var init_deploy = __esm({
|
|
@@ -1117,13 +1103,6 @@ var init_deploy = __esm({
|
|
|
1117
1103
|
}
|
|
1118
1104
|
});
|
|
1119
1105
|
|
|
1120
|
-
// ../cdk-cli-wrapper/lib/commands/destroy.ts
|
|
1121
|
-
var init_destroy = __esm({
|
|
1122
|
-
"../cdk-cli-wrapper/lib/commands/destroy.ts"() {
|
|
1123
|
-
"use strict";
|
|
1124
|
-
}
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
1106
|
// ../cdk-cli-wrapper/lib/commands/list.ts
|
|
1128
1107
|
var init_list = __esm({
|
|
1129
1108
|
"../cdk-cli-wrapper/lib/commands/list.ts"() {
|
|
@@ -1135,16 +1114,13 @@ var init_list = __esm({
|
|
|
1135
1114
|
var commands_exports = {};
|
|
1136
1115
|
__export(commands_exports, {
|
|
1137
1116
|
HotswapMode: () => HotswapMode,
|
|
1138
|
-
RequireApproval: () => RequireApproval,
|
|
1139
1117
|
StackActivityProgress: () => StackActivityProgress
|
|
1140
1118
|
});
|
|
1141
1119
|
var init_commands = __esm({
|
|
1142
1120
|
"../cdk-cli-wrapper/lib/commands/index.ts"() {
|
|
1143
1121
|
"use strict";
|
|
1144
1122
|
init_synth();
|
|
1145
|
-
init_common();
|
|
1146
1123
|
init_deploy();
|
|
1147
|
-
init_destroy();
|
|
1148
1124
|
init_list();
|
|
1149
1125
|
}
|
|
1150
1126
|
});
|
|
@@ -1256,7 +1232,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1256
1232
|
throw new Error('one of "app" or "stacks" must be provided');
|
|
1257
1233
|
}
|
|
1258
1234
|
}
|
|
1259
|
-
list(options) {
|
|
1235
|
+
async list(options) {
|
|
1260
1236
|
const listCommandArgs = [
|
|
1261
1237
|
...renderBooleanArg("long", options.long),
|
|
1262
1238
|
...this.createDefaultArguments(options)
|
|
@@ -1265,12 +1241,12 @@ var init_cdk_wrapper = __esm({
|
|
|
1265
1241
|
cwd: this.directory,
|
|
1266
1242
|
verbose: this.showOutput,
|
|
1267
1243
|
env: this.env
|
|
1268
|
-
});
|
|
1244
|
+
}).split("\n");
|
|
1269
1245
|
}
|
|
1270
1246
|
/**
|
|
1271
1247
|
* cdk deploy
|
|
1272
1248
|
*/
|
|
1273
|
-
deploy(options) {
|
|
1249
|
+
async deploy(options) {
|
|
1274
1250
|
const deployCommandArgs = [
|
|
1275
1251
|
...renderBooleanArg("ci", options.ci),
|
|
1276
1252
|
...renderBooleanArg("execute", options.execute),
|
|
@@ -1297,7 +1273,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1297
1273
|
env: this.env
|
|
1298
1274
|
});
|
|
1299
1275
|
}
|
|
1300
|
-
watch(options) {
|
|
1276
|
+
async watch(options, events = {}) {
|
|
1301
1277
|
let hotswap;
|
|
1302
1278
|
switch (options.hotswap) {
|
|
1303
1279
|
case "fall-back" /* FALL_BACK */:
|
|
@@ -1332,16 +1308,28 @@ var init_cdk_wrapper = __esm({
|
|
|
1332
1308
|
...options.deploymentMethod ? ["--method", options.deploymentMethod] : [],
|
|
1333
1309
|
...this.createDefaultArguments(options)
|
|
1334
1310
|
];
|
|
1335
|
-
|
|
1311
|
+
const child = watch([this.cdk, "deploy", ...deployCommandArgs], {
|
|
1336
1312
|
cwd: this.directory,
|
|
1337
1313
|
verbose: this.showOutput,
|
|
1338
1314
|
env: this.env
|
|
1339
1315
|
});
|
|
1316
|
+
if (events.onStdout) {
|
|
1317
|
+
child.stdout?.on("data", events.onStdout);
|
|
1318
|
+
}
|
|
1319
|
+
if (events.onStderr) {
|
|
1320
|
+
child.stderr?.on("data", events.onStderr);
|
|
1321
|
+
}
|
|
1322
|
+
child.on("close", (code) => {
|
|
1323
|
+
child.stdin?.end();
|
|
1324
|
+
if (events.onClose) {
|
|
1325
|
+
events.onClose(code);
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1340
1328
|
}
|
|
1341
1329
|
/**
|
|
1342
1330
|
* cdk destroy
|
|
1343
1331
|
*/
|
|
1344
|
-
destroy(options) {
|
|
1332
|
+
async destroy(options) {
|
|
1345
1333
|
const destroyCommandArgs = [
|
|
1346
1334
|
...renderBooleanArg("force", options.force),
|
|
1347
1335
|
...renderBooleanArg("exclusively", options.exclusively),
|
|
@@ -1356,7 +1344,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1356
1344
|
/**
|
|
1357
1345
|
* cdk synth
|
|
1358
1346
|
*/
|
|
1359
|
-
synth(options) {
|
|
1347
|
+
async synth(options) {
|
|
1360
1348
|
const synthCommandArgs = [
|
|
1361
1349
|
...renderBooleanArg("validation", options.validation),
|
|
1362
1350
|
...renderBooleanArg("quiet", options.quiet),
|
|
@@ -1375,7 +1363,7 @@ var init_cdk_wrapper = __esm({
|
|
|
1375
1363
|
* The CLI has a pretty slow startup time because of all the modules it needs to load,
|
|
1376
1364
|
* Bypass it to be quicker!
|
|
1377
1365
|
*/
|
|
1378
|
-
synthFast(options) {
|
|
1366
|
+
async synthFast(options) {
|
|
1379
1367
|
exec(options.execCmd, {
|
|
1380
1368
|
cwd: this.directory,
|
|
1381
1369
|
verbose: this.showOutput,
|
|
@@ -1749,6 +1737,7 @@ var init_schema = __esm({
|
|
|
1749
1737
|
ArtifactType3["CDK_TREE"] = "cdk:tree";
|
|
1750
1738
|
ArtifactType3["ASSET_MANIFEST"] = "cdk:asset-manifest";
|
|
1751
1739
|
ArtifactType3["NESTED_CLOUD_ASSEMBLY"] = "cdk:cloud-assembly";
|
|
1740
|
+
ArtifactType3["FEATURE_FLAG_REPORT"] = "cdk:feature-flag-report";
|
|
1752
1741
|
return ArtifactType3;
|
|
1753
1742
|
})(ArtifactType || {});
|
|
1754
1743
|
}
|
|
@@ -5100,7 +5089,7 @@ var require_semver2 = __commonJS({
|
|
|
5100
5089
|
// ../cloud-assembly-schema/cli-version.json
|
|
5101
5090
|
var require_cli_version = __commonJS({
|
|
5102
5091
|
"../cloud-assembly-schema/cli-version.json"(exports2, module2) {
|
|
5103
|
-
module2.exports = { version: "2.
|
|
5092
|
+
module2.exports = { version: "2.1019.0" };
|
|
5104
5093
|
}
|
|
5105
5094
|
});
|
|
5106
5095
|
|
|
@@ -5465,6 +5454,9 @@ var require_cloud_assembly_schema = __commonJS({
|
|
|
5465
5454
|
},
|
|
5466
5455
|
{
|
|
5467
5456
|
$ref: "#/definitions/NestedCloudAssemblyProperties"
|
|
5457
|
+
},
|
|
5458
|
+
{
|
|
5459
|
+
$ref: "#/definitions/FeatureFlagReportProperties"
|
|
5468
5460
|
}
|
|
5469
5461
|
]
|
|
5470
5462
|
},
|
|
@@ -5490,7 +5482,8 @@ have a unique display name. (Default - no display name)`,
|
|
|
5490
5482
|
"aws:cloudformation:stack",
|
|
5491
5483
|
"cdk:tree",
|
|
5492
5484
|
"cdk:asset-manifest",
|
|
5493
|
-
"cdk:cloud-assembly"
|
|
5485
|
+
"cdk:cloud-assembly",
|
|
5486
|
+
"cdk:feature-flag-report"
|
|
5494
5487
|
]
|
|
5495
5488
|
},
|
|
5496
5489
|
MetadataEntry: {
|
|
@@ -5883,6 +5876,27 @@ have a unique display name. (Default - no display name)`,
|
|
|
5883
5876
|
"directoryName"
|
|
5884
5877
|
]
|
|
5885
5878
|
},
|
|
5879
|
+
FeatureFlagReportProperties: {
|
|
5880
|
+
description: "Artifact properties for a feature flag report\n\nA feature flag report is small enough that all the properties can be inlined\nhere, and doesn't need an additional file.",
|
|
5881
|
+
type: "object",
|
|
5882
|
+
properties: {
|
|
5883
|
+
module: {
|
|
5884
|
+
description: "The library that this feature flag report applies to.",
|
|
5885
|
+
type: "string"
|
|
5886
|
+
},
|
|
5887
|
+
flags: {
|
|
5888
|
+
$ref: "#/definitions/Record<string,FeatureFlag>",
|
|
5889
|
+
description: "Information about every feature flag supported by this library."
|
|
5890
|
+
}
|
|
5891
|
+
},
|
|
5892
|
+
required: [
|
|
5893
|
+
"flags",
|
|
5894
|
+
"module"
|
|
5895
|
+
]
|
|
5896
|
+
},
|
|
5897
|
+
"Record<string,FeatureFlag>": {
|
|
5898
|
+
type: "object"
|
|
5899
|
+
},
|
|
5886
5900
|
MissingContext: {
|
|
5887
5901
|
description: "Represents a missing piece of context.",
|
|
5888
5902
|
type: "object",
|
|
@@ -7026,7 +7040,7 @@ var require_integ_schema = __commonJS({
|
|
|
7026
7040
|
var require_version = __commonJS({
|
|
7027
7041
|
"../cloud-assembly-schema/schema/version.json"(exports2, module2) {
|
|
7028
7042
|
module2.exports = {
|
|
7029
|
-
schemaHash: "
|
|
7043
|
+
schemaHash: "4709e40bc5dd6ad7d2bb6c6bd0315c622b7f4aa07ee3af66ff07f9bc77fdf783",
|
|
7030
7044
|
revision: 44
|
|
7031
7045
|
};
|
|
7032
7046
|
}
|
|
@@ -7167,7 +7181,7 @@ var init_manifest = __esm({
|
|
|
7167
7181
|
}
|
|
7168
7182
|
const maxSupported = semver.major(parseVersion(_Manifest.version()));
|
|
7169
7183
|
const actual = parseVersion(manifest.version);
|
|
7170
|
-
if (maxSupported < semver.major(actual) && !
|
|
7184
|
+
if (maxSupported < semver.major(actual) && !options?.skipVersionCheck) {
|
|
7171
7185
|
const cliVersion = manifest.minimumCliVersion;
|
|
7172
7186
|
let cliWarning = "";
|
|
7173
7187
|
if (cliVersion) {
|
|
@@ -7185,7 +7199,7 @@ var init_manifest = __esm({
|
|
|
7185
7199
|
preValidateProperty: _Manifest.validateAssumeRoleAdditionalOptions
|
|
7186
7200
|
});
|
|
7187
7201
|
let errors = result.errors;
|
|
7188
|
-
if (options
|
|
7202
|
+
if (options?.skipEnumCheck) {
|
|
7189
7203
|
errors = stripEnumErrors(errors);
|
|
7190
7204
|
}
|
|
7191
7205
|
if (errors.length > 0) {
|
|
@@ -7252,10 +7266,10 @@ ${errors.map((e) => e.stack).join("\n")}`);
|
|
|
7252
7266
|
return;
|
|
7253
7267
|
}
|
|
7254
7268
|
const assumeRoleOptions = instance[key];
|
|
7255
|
-
if (assumeRoleOptions
|
|
7269
|
+
if (assumeRoleOptions?.RoleArn) {
|
|
7256
7270
|
throw new Error(`RoleArn is not allowed inside '${key}'`);
|
|
7257
7271
|
}
|
|
7258
|
-
if (assumeRoleOptions
|
|
7272
|
+
if (assumeRoleOptions?.ExternalId) {
|
|
7259
7273
|
throw new Error(`ExternalId is not allowed inside '${key}'`);
|
|
7260
7274
|
}
|
|
7261
7275
|
}
|
|
@@ -7317,16 +7331,16 @@ var init_schema3 = __esm({
|
|
|
7317
7331
|
});
|
|
7318
7332
|
|
|
7319
7333
|
// ../cloud-assembly-schema/lib/integ-tests/commands/common.ts
|
|
7320
|
-
var
|
|
7321
|
-
var
|
|
7334
|
+
var RequireApproval;
|
|
7335
|
+
var init_common = __esm({
|
|
7322
7336
|
"../cloud-assembly-schema/lib/integ-tests/commands/common.ts"() {
|
|
7323
7337
|
"use strict";
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
return
|
|
7329
|
-
})(
|
|
7338
|
+
RequireApproval = /* @__PURE__ */ ((RequireApproval3) => {
|
|
7339
|
+
RequireApproval3["NEVER"] = "never";
|
|
7340
|
+
RequireApproval3["ANYCHANGE"] = "any-change";
|
|
7341
|
+
RequireApproval3["BROADENING"] = "broadening";
|
|
7342
|
+
return RequireApproval3;
|
|
7343
|
+
})(RequireApproval || {});
|
|
7330
7344
|
}
|
|
7331
7345
|
});
|
|
7332
7346
|
|
|
@@ -7338,7 +7352,7 @@ var init_deploy2 = __esm({
|
|
|
7338
7352
|
});
|
|
7339
7353
|
|
|
7340
7354
|
// ../cloud-assembly-schema/lib/integ-tests/commands/destroy.ts
|
|
7341
|
-
var
|
|
7355
|
+
var init_destroy = __esm({
|
|
7342
7356
|
"../cloud-assembly-schema/lib/integ-tests/commands/destroy.ts"() {
|
|
7343
7357
|
"use strict";
|
|
7344
7358
|
}
|
|
@@ -7348,9 +7362,9 @@ var init_destroy2 = __esm({
|
|
|
7348
7362
|
var init_commands2 = __esm({
|
|
7349
7363
|
"../cloud-assembly-schema/lib/integ-tests/commands/index.ts"() {
|
|
7350
7364
|
"use strict";
|
|
7351
|
-
|
|
7365
|
+
init_common();
|
|
7352
7366
|
init_deploy2();
|
|
7353
|
-
|
|
7367
|
+
init_destroy();
|
|
7354
7368
|
}
|
|
7355
7369
|
});
|
|
7356
7370
|
|
|
@@ -7364,7 +7378,7 @@ var init_test_case = __esm({
|
|
|
7364
7378
|
// ../cloud-assembly-schema/lib/integ-tests/index.ts
|
|
7365
7379
|
var integ_tests_exports = {};
|
|
7366
7380
|
__export(integ_tests_exports, {
|
|
7367
|
-
RequireApproval: () =>
|
|
7381
|
+
RequireApproval: () => RequireApproval
|
|
7368
7382
|
});
|
|
7369
7383
|
var init_integ_tests = __esm({
|
|
7370
7384
|
"../cloud-assembly-schema/lib/integ-tests/index.ts"() {
|
|
@@ -7558,7 +7572,7 @@ var require_cloud_artifact = __commonJS({
|
|
|
7558
7572
|
};
|
|
7559
7573
|
exports2.CloudArtifact = CloudArtifact;
|
|
7560
7574
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7561
|
-
CloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudArtifact", version: "2.
|
|
7575
|
+
CloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudArtifact", version: "2.201.0" };
|
|
7562
7576
|
}
|
|
7563
7577
|
});
|
|
7564
7578
|
|
|
@@ -7628,7 +7642,7 @@ var require_asset_manifest_artifact = __commonJS({
|
|
|
7628
7642
|
};
|
|
7629
7643
|
exports2.AssetManifestArtifact = AssetManifestArtifact;
|
|
7630
7644
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7631
|
-
AssetManifestArtifact[_a] = { fqn: "@aws-cdk/cx-api.AssetManifestArtifact", version: "2.
|
|
7645
|
+
AssetManifestArtifact[_a] = { fqn: "@aws-cdk/cx-api.AssetManifestArtifact", version: "2.201.0" };
|
|
7632
7646
|
Object.defineProperty(AssetManifestArtifact.prototype, ASSET_MANIFEST_ARTIFACT_SYM, {
|
|
7633
7647
|
value: true,
|
|
7634
7648
|
enumerable: false,
|
|
@@ -7676,7 +7690,7 @@ var require_environment2 = __commonJS({
|
|
|
7676
7690
|
};
|
|
7677
7691
|
exports2.EnvironmentUtils = EnvironmentUtils;
|
|
7678
7692
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7679
|
-
EnvironmentUtils[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentUtils", version: "2.
|
|
7693
|
+
EnvironmentUtils[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentUtils", version: "2.201.0" };
|
|
7680
7694
|
}
|
|
7681
7695
|
});
|
|
7682
7696
|
|
|
@@ -7782,7 +7796,7 @@ var require_cloudformation_artifact = __commonJS({
|
|
|
7782
7796
|
};
|
|
7783
7797
|
exports2.CloudFormationStackArtifact = CloudFormationStackArtifact;
|
|
7784
7798
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7785
|
-
CloudFormationStackArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudFormationStackArtifact", version: "2.
|
|
7799
|
+
CloudFormationStackArtifact[_a] = { fqn: "@aws-cdk/cx-api.CloudFormationStackArtifact", version: "2.201.0" };
|
|
7786
7800
|
Object.defineProperty(CloudFormationStackArtifact.prototype, CLOUDFORMATION_STACK_ARTIFACT_SYM, {
|
|
7787
7801
|
value: true,
|
|
7788
7802
|
enumerable: false,
|
|
@@ -7847,7 +7861,7 @@ var require_nested_cloud_assembly_artifact = __commonJS({
|
|
|
7847
7861
|
};
|
|
7848
7862
|
exports2.NestedCloudAssemblyArtifact = NestedCloudAssemblyArtifact;
|
|
7849
7863
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7850
|
-
NestedCloudAssemblyArtifact[_a] = { fqn: "@aws-cdk/cx-api.NestedCloudAssemblyArtifact", version: "2.
|
|
7864
|
+
NestedCloudAssemblyArtifact[_a] = { fqn: "@aws-cdk/cx-api.NestedCloudAssemblyArtifact", version: "2.201.0" };
|
|
7851
7865
|
Object.defineProperty(NestedCloudAssemblyArtifact.prototype, NESTED_CLOUD_ASSEMBLY_SYM, {
|
|
7852
7866
|
value: true,
|
|
7853
7867
|
enumerable: false,
|
|
@@ -7908,7 +7922,7 @@ var require_tree_cloud_artifact = __commonJS({
|
|
|
7908
7922
|
};
|
|
7909
7923
|
exports2.TreeCloudArtifact = TreeCloudArtifact;
|
|
7910
7924
|
_a = JSII_RTTI_SYMBOL_1;
|
|
7911
|
-
TreeCloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.TreeCloudArtifact", version: "2.
|
|
7925
|
+
TreeCloudArtifact[_a] = { fqn: "@aws-cdk/cx-api.TreeCloudArtifact", version: "2.201.0" };
|
|
7912
7926
|
Object.defineProperty(TreeCloudArtifact.prototype, TREE_CLOUD_ARTIFACT_SYM, {
|
|
7913
7927
|
value: true,
|
|
7914
7928
|
enumerable: false,
|
|
@@ -8014,7 +8028,7 @@ var require_cloud_assembly = __commonJS({
|
|
|
8014
8028
|
this.directory = directory;
|
|
8015
8029
|
this.manifest = cxschema.Manifest.loadAssemblyManifest(path7.join(directory, MANIFEST_FILE), loadOptions);
|
|
8016
8030
|
this.version = this.manifest.version;
|
|
8017
|
-
this.artifacts = this.renderArtifacts(
|
|
8031
|
+
this.artifacts = this.renderArtifacts(loadOptions?.topoSort ?? true);
|
|
8018
8032
|
this.runtime = this.manifest.runtime || { libraries: {} };
|
|
8019
8033
|
Object.defineProperty(this, CLOUD_ASSEMBLY_SYMBOL, { value: true });
|
|
8020
8034
|
this.validateDeps();
|
|
@@ -8174,7 +8188,7 @@ var require_cloud_assembly = __commonJS({
|
|
|
8174
8188
|
};
|
|
8175
8189
|
exports2.CloudAssembly = CloudAssembly;
|
|
8176
8190
|
_a = JSII_RTTI_SYMBOL_1;
|
|
8177
|
-
CloudAssembly[_a] = { fqn: "@aws-cdk/cx-api.CloudAssembly", version: "2.
|
|
8191
|
+
CloudAssembly[_a] = { fqn: "@aws-cdk/cx-api.CloudAssembly", version: "2.201.0" };
|
|
8178
8192
|
var CloudAssemblyBuilder = class _CloudAssemblyBuilder {
|
|
8179
8193
|
/**
|
|
8180
8194
|
* Initializes a cloud assembly builder.
|
|
@@ -8209,11 +8223,10 @@ var require_cloud_assembly = __commonJS({
|
|
|
8209
8223
|
* @param missing Missing context information.
|
|
8210
8224
|
*/
|
|
8211
8225
|
addMissing(missing) {
|
|
8212
|
-
var _a2;
|
|
8213
8226
|
if (this.missing.every((m) => m.key !== missing.key)) {
|
|
8214
8227
|
this.missing.push(missing);
|
|
8215
8228
|
}
|
|
8216
|
-
|
|
8229
|
+
this.parentBuilder?.addMissing(missing);
|
|
8217
8230
|
}
|
|
8218
8231
|
/**
|
|
8219
8232
|
* Finalizes the cloud assembly into the output directory returns a
|
|
@@ -8268,7 +8281,7 @@ var require_cloud_assembly = __commonJS({
|
|
|
8268
8281
|
};
|
|
8269
8282
|
exports2.CloudAssemblyBuilder = CloudAssemblyBuilder;
|
|
8270
8283
|
_b = JSII_RTTI_SYMBOL_1;
|
|
8271
|
-
CloudAssemblyBuilder[_b] = { fqn: "@aws-cdk/cx-api.CloudAssemblyBuilder", version: "2.
|
|
8284
|
+
CloudAssemblyBuilder[_b] = { fqn: "@aws-cdk/cx-api.CloudAssemblyBuilder", version: "2.201.0" };
|
|
8272
8285
|
function filterUndefined(obj) {
|
|
8273
8286
|
if (Array.isArray(obj)) {
|
|
8274
8287
|
return obj.filter((x) => x !== void 0).map((x) => filterUndefined(x));
|
|
@@ -9905,17 +9918,8 @@ var require_features = __commonJS({
|
|
|
9905
9918
|
};
|
|
9906
9919
|
var CURRENT_MV = "v2";
|
|
9907
9920
|
exports2.CURRENT_VERSION_EXPIRED_FLAGS = Object.entries(exports2.FLAGS).filter(([_, flag]) => flag.introducedIn[CURRENT_MV] === void 0).map(([name, _]) => name).sort();
|
|
9908
|
-
exports2.CURRENTLY_RECOMMENDED_FLAGS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) =>
|
|
9909
|
-
|
|
9910
|
-
return flag.recommendedValue !== ((_a = flag.defaults) == null ? void 0 : _a[CURRENT_MV]) && flag.introducedIn[CURRENT_MV];
|
|
9911
|
-
}).map(([name, flag]) => [name, flag.recommendedValue]));
|
|
9912
|
-
exports2.CURRENT_VERSION_FLAG_DEFAULTS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) => {
|
|
9913
|
-
var _a;
|
|
9914
|
-
return ((_a = flag.defaults) == null ? void 0 : _a[CURRENT_MV]) !== void 0;
|
|
9915
|
-
}).map(([name, flag]) => {
|
|
9916
|
-
var _a;
|
|
9917
|
-
return [name, (_a = flag.defaults) == null ? void 0 : _a[CURRENT_MV]];
|
|
9918
|
-
}));
|
|
9921
|
+
exports2.CURRENTLY_RECOMMENDED_FLAGS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) => flag.recommendedValue !== flag.defaults?.[CURRENT_MV] && flag.introducedIn[CURRENT_MV]).map(([name, flag]) => [name, flag.recommendedValue]));
|
|
9922
|
+
exports2.CURRENT_VERSION_FLAG_DEFAULTS = Object.fromEntries(Object.entries(exports2.FLAGS).filter(([_, flag]) => flag.defaults?.[CURRENT_MV] !== void 0).map(([name, flag]) => [name, flag.defaults?.[CURRENT_MV]]));
|
|
9919
9923
|
function futureFlagDefault(flag) {
|
|
9920
9924
|
const value = exports2.CURRENT_VERSION_FLAG_DEFAULTS[flag] ?? false;
|
|
9921
9925
|
if (typeof value !== "boolean") {
|
|
@@ -10017,7 +10021,7 @@ var require_placeholders = __commonJS({
|
|
|
10017
10021
|
};
|
|
10018
10022
|
exports2.EnvironmentPlaceholders = EnvironmentPlaceholders;
|
|
10019
10023
|
_a = JSII_RTTI_SYMBOL_1;
|
|
10020
|
-
EnvironmentPlaceholders[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentPlaceholders", version: "2.
|
|
10024
|
+
EnvironmentPlaceholders[_a] = { fqn: "@aws-cdk/cx-api.EnvironmentPlaceholders", version: "2.201.0" };
|
|
10021
10025
|
EnvironmentPlaceholders.CURRENT_REGION = "${AWS::Region}";
|
|
10022
10026
|
EnvironmentPlaceholders.CURRENT_ACCOUNT = "${AWS::AccountId}";
|
|
10023
10027
|
EnvironmentPlaceholders.CURRENT_PARTITION = "${AWS::Partition}";
|
|
@@ -12607,18 +12611,21 @@ var require_lib5 = __commonJS({
|
|
|
12607
12611
|
});
|
|
12608
12612
|
|
|
12609
12613
|
// lib/runner/private/integ-manifest.ts
|
|
12610
|
-
var path, import_cloud_assembly_schema, fs2,
|
|
12614
|
+
var path, import_cloud_assembly_schema, fs2, IntegManifestReader;
|
|
12611
12615
|
var init_integ_manifest = __esm({
|
|
12612
12616
|
"lib/runner/private/integ-manifest.ts"() {
|
|
12613
12617
|
"use strict";
|
|
12614
12618
|
path = __toESM(require("path"));
|
|
12615
12619
|
import_cloud_assembly_schema = __toESM(require_lib3());
|
|
12616
12620
|
fs2 = __toESM(require_lib5());
|
|
12617
|
-
|
|
12621
|
+
IntegManifestReader = class _IntegManifestReader {
|
|
12618
12622
|
constructor(directory, manifest) {
|
|
12619
12623
|
this.manifest = manifest;
|
|
12620
12624
|
this.directory = directory;
|
|
12621
12625
|
}
|
|
12626
|
+
static {
|
|
12627
|
+
this.DEFAULT_FILENAME = "integ.json";
|
|
12628
|
+
}
|
|
12622
12629
|
/**
|
|
12623
12630
|
* Reads an integration test manifest from the specified file
|
|
12624
12631
|
*/
|
|
@@ -12658,8 +12665,6 @@ var init_integ_manifest = __esm({
|
|
|
12658
12665
|
};
|
|
12659
12666
|
}
|
|
12660
12667
|
};
|
|
12661
|
-
_IntegManifestReader.DEFAULT_FILENAME = "integ.json";
|
|
12662
|
-
IntegManifestReader = _IntegManifestReader;
|
|
12663
12668
|
}
|
|
12664
12669
|
});
|
|
12665
12670
|
|
|
@@ -12746,7 +12751,7 @@ var init_integ_test_suite = __esm({
|
|
|
12746
12751
|
* /// !cdk-integ <stack-name>
|
|
12747
12752
|
*
|
|
12748
12753
|
*/
|
|
12749
|
-
static fromLegacy(config) {
|
|
12754
|
+
static async fromLegacy(config) {
|
|
12750
12755
|
const pragmas = this.pragmas(config.integSourceFilePath);
|
|
12751
12756
|
const tests = {
|
|
12752
12757
|
stacks: [],
|
|
@@ -12761,7 +12766,7 @@ var init_integ_test_suite = __esm({
|
|
|
12761
12766
|
...config.listOptions,
|
|
12762
12767
|
notices: false
|
|
12763
12768
|
};
|
|
12764
|
-
const stacks = config.cdk.list(options)
|
|
12769
|
+
const stacks = await config.cdk.list(options);
|
|
12765
12770
|
if (stacks.length !== 1) {
|
|
12766
12771
|
throw new Error(`"cdk-integ" can only operate on apps with a single stack.
|
|
12767
12772
|
|
|
@@ -13126,6 +13131,14 @@ function chunks(command) {
|
|
|
13126
13131
|
const result = command.match(/(?:[^\s"]+|"[^"]*")+/g);
|
|
13127
13132
|
return result ?? [];
|
|
13128
13133
|
}
|
|
13134
|
+
function promiseWithResolvers() {
|
|
13135
|
+
let resolve3, reject;
|
|
13136
|
+
const promise = new Promise((res, rej) => {
|
|
13137
|
+
resolve3 = res;
|
|
13138
|
+
reject = rej;
|
|
13139
|
+
});
|
|
13140
|
+
return { promise, resolve: resolve3, reject };
|
|
13141
|
+
}
|
|
13129
13142
|
var import_child_process2;
|
|
13130
13143
|
var init_utils2 = __esm({
|
|
13131
13144
|
"lib/utils.ts"() {
|
|
@@ -13362,7 +13375,7 @@ var require_asset_manifest = __commonJS({
|
|
|
13362
13375
|
});
|
|
13363
13376
|
|
|
13364
13377
|
// lib/runner/private/cloud-assembly.ts
|
|
13365
|
-
var path2, import_cloud_assembly_schema3, import_asset_manifest, fs4,
|
|
13378
|
+
var path2, import_cloud_assembly_schema3, import_asset_manifest, fs4, AssemblyManifestReader;
|
|
13366
13379
|
var init_cloud_assembly2 = __esm({
|
|
13367
13380
|
"lib/runner/private/cloud-assembly.ts"() {
|
|
13368
13381
|
"use strict";
|
|
@@ -13370,12 +13383,15 @@ var init_cloud_assembly2 = __esm({
|
|
|
13370
13383
|
import_cloud_assembly_schema3 = __toESM(require_lib3());
|
|
13371
13384
|
import_asset_manifest = __toESM(require_asset_manifest());
|
|
13372
13385
|
fs4 = __toESM(require_lib5());
|
|
13373
|
-
|
|
13386
|
+
AssemblyManifestReader = class _AssemblyManifestReader {
|
|
13374
13387
|
constructor(directory, manifest, manifestFileName) {
|
|
13375
13388
|
this.manifest = manifest;
|
|
13376
13389
|
this.manifestFileName = manifestFileName;
|
|
13377
13390
|
this.directory = directory;
|
|
13378
13391
|
}
|
|
13392
|
+
static {
|
|
13393
|
+
this.DEFAULT_FILENAME = "manifest.json";
|
|
13394
|
+
}
|
|
13379
13395
|
/**
|
|
13380
13396
|
* Reads a Cloud Assembly manifest from a file
|
|
13381
13397
|
*/
|
|
@@ -13426,10 +13442,7 @@ var init_cloud_assembly2 = __esm({
|
|
|
13426
13442
|
*/
|
|
13427
13443
|
getNestedStacksForStack(stackId) {
|
|
13428
13444
|
const nestedTemplates = this.getAssetManifestsForStack(stackId).flatMap(
|
|
13429
|
-
(manifest) => manifest.files.filter((asset) =>
|
|
13430
|
-
var _a;
|
|
13431
|
-
return (_a = asset.source.path) == null ? void 0 : _a.endsWith(".nested.template.json");
|
|
13432
|
-
}).map((asset) => asset.source.path)
|
|
13445
|
+
(manifest) => manifest.files.filter((asset) => asset.source.path?.endsWith(".nested.template.json")).map((asset) => asset.source.path)
|
|
13433
13446
|
);
|
|
13434
13447
|
const nestedStacks = Object.fromEntries(nestedTemplates.map((templateFile) => [
|
|
13435
13448
|
templateFile.split(".", 1)[0],
|
|
@@ -13451,10 +13464,9 @@ var init_cloud_assembly2 = __esm({
|
|
|
13451
13464
|
* Return a list of assets for a given stack
|
|
13452
13465
|
*/
|
|
13453
13466
|
getAssetIdsForStack(stackId) {
|
|
13454
|
-
var _a;
|
|
13455
13467
|
const assets = [];
|
|
13456
13468
|
for (const artifact of Object.values(this.manifest.artifacts ?? {})) {
|
|
13457
|
-
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST &&
|
|
13469
|
+
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`) {
|
|
13458
13470
|
assets.push(...this.assetsFromAssetManifest(artifact).map((asset) => asset.id.assetId));
|
|
13459
13471
|
} else if (artifact.type === import_cloud_assembly_schema3.ArtifactType.AWS_CLOUDFORMATION_STACK) {
|
|
13460
13472
|
assets.push(...this.assetsFromAssemblyManifest(artifact).map((asset) => asset.id));
|
|
@@ -13466,13 +13478,11 @@ var init_cloud_assembly2 = __esm({
|
|
|
13466
13478
|
* For a given stackId return a list of assets that belong to the stack
|
|
13467
13479
|
*/
|
|
13468
13480
|
getAssetLocationsForStack(stackId) {
|
|
13469
|
-
var _a;
|
|
13470
13481
|
const assets = [];
|
|
13471
13482
|
for (const artifact of Object.values(this.manifest.artifacts ?? {})) {
|
|
13472
|
-
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST &&
|
|
13483
|
+
if (artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`) {
|
|
13473
13484
|
assets.push(...this.assetsFromAssetManifest(artifact).flatMap((asset) => {
|
|
13474
|
-
|
|
13475
|
-
if (asset.type === "file" && !((_a2 = asset.source.path) == null ? void 0 : _a2.endsWith("nested.template.json"))) {
|
|
13485
|
+
if (asset.type === "file" && !asset.source.path?.endsWith("nested.template.json")) {
|
|
13476
13486
|
return asset.source.path;
|
|
13477
13487
|
} else if (asset.type !== "file") {
|
|
13478
13488
|
return asset.source.directory;
|
|
@@ -13489,10 +13499,7 @@ var init_cloud_assembly2 = __esm({
|
|
|
13489
13499
|
* Return a list of asset artifacts for a given stack
|
|
13490
13500
|
*/
|
|
13491
13501
|
getAssetManifestsForStack(stackId) {
|
|
13492
|
-
return Object.values(this.manifest.artifacts ?? {}).filter((artifact) => {
|
|
13493
|
-
var _a;
|
|
13494
|
-
return artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && ((_a = artifact.properties) == null ? void 0 : _a.file) === `${stackId}.assets.json`;
|
|
13495
|
-
}).map((artifact) => {
|
|
13502
|
+
return Object.values(this.manifest.artifacts ?? {}).filter((artifact) => artifact.type === import_cloud_assembly_schema3.ArtifactType.ASSET_MANIFEST && artifact.properties?.file === `${stackId}.assets.json`).map((artifact) => {
|
|
13496
13503
|
const fileName = artifact.properties.file;
|
|
13497
13504
|
return import_asset_manifest.AssetManifest.fromFile(path2.join(this.directory, fileName));
|
|
13498
13505
|
});
|
|
@@ -13596,8 +13603,6 @@ var init_cloud_assembly2 = __esm({
|
|
|
13596
13603
|
return newArtifacts;
|
|
13597
13604
|
}
|
|
13598
13605
|
};
|
|
13599
|
-
_AssemblyManifestReader.DEFAULT_FILENAME = "manifest.json";
|
|
13600
|
-
AssemblyManifestReader = _AssemblyManifestReader;
|
|
13601
13606
|
}
|
|
13602
13607
|
});
|
|
13603
13608
|
|
|
@@ -13644,42 +13649,36 @@ var init_runner_base = __esm({
|
|
|
13644
13649
|
const testRunCommand = this.test.appCommand;
|
|
13645
13650
|
this.cdkApp = testRunCommand.replace("{filePath}", path3.relative(this.directory, this.test.fileName));
|
|
13646
13651
|
this.profile = options.profile;
|
|
13647
|
-
if (this.hasSnapshot()) {
|
|
13648
|
-
this.expectedTestSuite = this.loadManifest();
|
|
13649
|
-
}
|
|
13650
|
-
this.actualTestSuite = this.generateActualSnapshot();
|
|
13651
13652
|
}
|
|
13652
13653
|
/**
|
|
13653
13654
|
* Return the list of expected (i.e. existing) test cases for this integration test
|
|
13654
13655
|
*/
|
|
13655
|
-
expectedTests() {
|
|
13656
|
-
|
|
13657
|
-
return (_a = this.expectedTestSuite) == null ? void 0 : _a.testSuite;
|
|
13656
|
+
async expectedTests() {
|
|
13657
|
+
return (await this.expectedTestSuite())?.testSuite;
|
|
13658
13658
|
}
|
|
13659
13659
|
/**
|
|
13660
13660
|
* Return the list of actual (i.e. new) test cases for this integration test
|
|
13661
13661
|
*/
|
|
13662
|
-
actualTests() {
|
|
13663
|
-
return this.actualTestSuite.testSuite;
|
|
13662
|
+
async actualTests() {
|
|
13663
|
+
return (await this.actualTestSuite()).testSuite;
|
|
13664
13664
|
}
|
|
13665
13665
|
/**
|
|
13666
13666
|
* Generate a new "actual" snapshot which will be compared to the
|
|
13667
13667
|
* existing "expected" snapshot
|
|
13668
13668
|
* This will synth and then load the integration test manifest
|
|
13669
13669
|
*/
|
|
13670
|
-
generateActualSnapshot() {
|
|
13671
|
-
|
|
13672
|
-
this.cdk.synthFast({
|
|
13670
|
+
async generateActualSnapshot() {
|
|
13671
|
+
await this.cdk.synthFast({
|
|
13673
13672
|
execCmd: this.cdkApp.split(" "),
|
|
13674
13673
|
env: {
|
|
13675
13674
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
13676
13675
|
// we don't know the "actual" context yet (this method is what generates it) so just
|
|
13677
13676
|
// use the "expected" context. This is only run in order to read the manifest
|
|
13678
|
-
CDK_CONTEXT_JSON: JSON.stringify(this.getContext((
|
|
13677
|
+
CDK_CONTEXT_JSON: JSON.stringify(this.getContext((await this.expectedTestSuite())?.synthContext))
|
|
13679
13678
|
},
|
|
13680
13679
|
output: path3.relative(this.directory, this.cdkOutDir)
|
|
13681
13680
|
});
|
|
13682
|
-
const manifest = this.loadManifest(this.cdkOutDir);
|
|
13681
|
+
const manifest = await this.loadManifest(this.cdkOutDir);
|
|
13683
13682
|
this.cleanup();
|
|
13684
13683
|
return manifest;
|
|
13685
13684
|
}
|
|
@@ -13689,6 +13688,24 @@ var init_runner_base = __esm({
|
|
|
13689
13688
|
hasSnapshot() {
|
|
13690
13689
|
return fs5.existsSync(this.snapshotDir);
|
|
13691
13690
|
}
|
|
13691
|
+
/**
|
|
13692
|
+
* The test suite from the existing snapshot
|
|
13693
|
+
*/
|
|
13694
|
+
async expectedTestSuite() {
|
|
13695
|
+
if (!this._expectedTestSuite && this.hasSnapshot()) {
|
|
13696
|
+
this._expectedTestSuite = await this.loadManifest();
|
|
13697
|
+
}
|
|
13698
|
+
return this._expectedTestSuite;
|
|
13699
|
+
}
|
|
13700
|
+
/**
|
|
13701
|
+
* The test suite from the new "actual" snapshot
|
|
13702
|
+
*/
|
|
13703
|
+
async actualTestSuite() {
|
|
13704
|
+
if (!this._actualTestSuite) {
|
|
13705
|
+
this._actualTestSuite = await this.generateActualSnapshot();
|
|
13706
|
+
}
|
|
13707
|
+
return this._actualTestSuite;
|
|
13708
|
+
}
|
|
13692
13709
|
/**
|
|
13693
13710
|
* Load the integ manifest which contains information
|
|
13694
13711
|
* on how to execute the tests
|
|
@@ -13696,12 +13713,12 @@ var init_runner_base = __esm({
|
|
|
13696
13713
|
* from the cloud assembly. If it doesn't exist, then we fallback to the
|
|
13697
13714
|
* "legacy mode" and create a manifest from pragma
|
|
13698
13715
|
*/
|
|
13699
|
-
loadManifest(dir) {
|
|
13716
|
+
async loadManifest(dir) {
|
|
13700
13717
|
try {
|
|
13701
13718
|
const testSuite = IntegTestSuite.fromPath(dir ?? this.snapshotDir);
|
|
13702
13719
|
return testSuite;
|
|
13703
13720
|
} catch {
|
|
13704
|
-
const testCases = LegacyIntegTestSuite.fromLegacy({
|
|
13721
|
+
const testCases = await LegacyIntegTestSuite.fromLegacy({
|
|
13705
13722
|
cdk: this.cdk,
|
|
13706
13723
|
testName: this.test.normalizedTestName,
|
|
13707
13724
|
integSourceFilePath: this.test.fileName,
|
|
@@ -13714,7 +13731,6 @@ var init_runner_base = __esm({
|
|
|
13714
13731
|
}
|
|
13715
13732
|
});
|
|
13716
13733
|
this.legacyContext = LegacyIntegTestSuite.getPragmaContext(this.test.fileName);
|
|
13717
|
-
this.isLegacyTest = true;
|
|
13718
13734
|
return testCases;
|
|
13719
13735
|
}
|
|
13720
13736
|
}
|
|
@@ -13752,8 +13768,8 @@ var init_runner_base = __esm({
|
|
|
13752
13768
|
* disabled and then delete assets that relate to that stack. It does that
|
|
13753
13769
|
* by reading the asset manifest for the stack and deleting the asset source
|
|
13754
13770
|
*/
|
|
13755
|
-
removeAssetsFromSnapshot() {
|
|
13756
|
-
const stacks = this.actualTestSuite.getStacksWithoutUpdateWorkflow() ?? [];
|
|
13771
|
+
async removeAssetsFromSnapshot() {
|
|
13772
|
+
const stacks = (await this.actualTestSuite()).getStacksWithoutUpdateWorkflow() ?? [];
|
|
13757
13773
|
const manifest = AssemblyManifestReader.fromPath(this.snapshotDir);
|
|
13758
13774
|
const assets = flatten(stacks.map((stack) => {
|
|
13759
13775
|
return manifest.getAssetLocationsForStack(stack) ?? [];
|
|
@@ -13794,12 +13810,12 @@ var init_runner_base = __esm({
|
|
|
13794
13810
|
* If lookups are disabled (which means the stack is env agnostic) then just copy
|
|
13795
13811
|
* the assembly that was output by the deployment
|
|
13796
13812
|
*/
|
|
13797
|
-
createSnapshot() {
|
|
13813
|
+
async createSnapshot() {
|
|
13798
13814
|
if (fs5.existsSync(this.snapshotDir)) {
|
|
13799
13815
|
fs5.removeSync(this.snapshotDir);
|
|
13800
13816
|
}
|
|
13801
|
-
if (this.actualTestSuite.enableLookups) {
|
|
13802
|
-
this.cdk.synthFast({
|
|
13817
|
+
if ((await this.actualTestSuite()).enableLookups) {
|
|
13818
|
+
await this.cdk.synthFast({
|
|
13803
13819
|
execCmd: this.cdkApp.split(" "),
|
|
13804
13820
|
env: {
|
|
13805
13821
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
@@ -13810,23 +13826,24 @@ var init_runner_base = __esm({
|
|
|
13810
13826
|
} else {
|
|
13811
13827
|
fs5.moveSync(this.cdkOutDir, this.snapshotDir, { overwrite: true });
|
|
13812
13828
|
}
|
|
13813
|
-
this.cleanupSnapshot();
|
|
13829
|
+
await this.cleanupSnapshot();
|
|
13814
13830
|
}
|
|
13815
13831
|
/**
|
|
13816
13832
|
* Perform some cleanup steps after the snapshot is created
|
|
13817
13833
|
* Anytime the snapshot needs to be modified after creation
|
|
13818
13834
|
* the logic should live here.
|
|
13819
13835
|
*/
|
|
13820
|
-
cleanupSnapshot() {
|
|
13836
|
+
async cleanupSnapshot() {
|
|
13821
13837
|
if (fs5.existsSync(this.snapshotDir)) {
|
|
13822
|
-
this.removeAssetsFromSnapshot();
|
|
13838
|
+
await this.removeAssetsFromSnapshot();
|
|
13823
13839
|
this.removeAssetsCacheFromSnapshot();
|
|
13824
13840
|
const assembly = AssemblyManifestReader.fromPath(this.snapshotDir);
|
|
13825
13841
|
assembly.cleanManifest();
|
|
13826
13842
|
assembly.recordTrace(this.renderTraceData());
|
|
13827
13843
|
}
|
|
13828
|
-
|
|
13829
|
-
|
|
13844
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
13845
|
+
if (actualTestSuite.type === "legacy-test-suite") {
|
|
13846
|
+
actualTestSuite.saveManifest(this.snapshotDir, this.legacyContext);
|
|
13830
13847
|
}
|
|
13831
13848
|
}
|
|
13832
13849
|
getContext(additionalContext) {
|
|
@@ -20548,7 +20565,7 @@ function formatAssertionResults(results) {
|
|
|
20548
20565
|
${result.message}`)).join("\n ");
|
|
20549
20566
|
}
|
|
20550
20567
|
var import_util, chalk2;
|
|
20551
|
-
var
|
|
20568
|
+
var init_common2 = __esm({
|
|
20552
20569
|
"lib/workers/common.ts"() {
|
|
20553
20570
|
"use strict";
|
|
20554
20571
|
import_util = require("util");
|
|
@@ -20571,17 +20588,21 @@ var init_integ_test_runner = __esm({
|
|
|
20571
20588
|
init_runner_base();
|
|
20572
20589
|
init_logger();
|
|
20573
20590
|
init_utils2();
|
|
20574
|
-
|
|
20591
|
+
init_common2();
|
|
20575
20592
|
IntegTestRunner = class extends IntegRunner {
|
|
20576
20593
|
constructor(options, destructiveChanges) {
|
|
20577
20594
|
super(options);
|
|
20578
20595
|
this._destructiveChanges = destructiveChanges;
|
|
20579
|
-
|
|
20596
|
+
}
|
|
20597
|
+
async actualTests() {
|
|
20598
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20599
|
+
if (!this.hasSnapshot() && actualTestSuite.type === "legacy-test-suite") {
|
|
20580
20600
|
throw new Error(
|
|
20581
20601
|
`${this.testName} is a new test. Please use the IntegTest construct to configure the test
|
|
20582
20602
|
https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
20583
20603
|
);
|
|
20584
20604
|
}
|
|
20605
|
+
return actualTestSuite.testSuite;
|
|
20585
20606
|
}
|
|
20586
20607
|
createCdkContextJson() {
|
|
20587
20608
|
if (!fs6.existsSync(this.cdkContextPath)) {
|
|
@@ -20648,9 +20669,10 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20648
20669
|
* This is meant to be run on a single test and will not create a snapshot
|
|
20649
20670
|
*/
|
|
20650
20671
|
async watchIntegTest(options) {
|
|
20651
|
-
const
|
|
20672
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20673
|
+
const actualTestCase = actualTestSuite.testSuite[options.testCaseName];
|
|
20652
20674
|
if (!actualTestCase) {
|
|
20653
|
-
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(
|
|
20675
|
+
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(actualTestSuite.testSuite)}'`);
|
|
20654
20676
|
}
|
|
20655
20677
|
const enableForVerbosityLevel = (needed = 1) => {
|
|
20656
20678
|
const verbosity = options.verbosity ?? 0;
|
|
@@ -20688,12 +20710,12 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20688
20710
|
* The update workflow exists to check for cases where a change would cause
|
|
20689
20711
|
* a failure to an existing stack, but not for a newly created stack.
|
|
20690
20712
|
*/
|
|
20691
|
-
runIntegTestCase(options) {
|
|
20692
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
20713
|
+
async runIntegTestCase(options) {
|
|
20693
20714
|
let assertionResults;
|
|
20694
|
-
const
|
|
20715
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20716
|
+
const actualTestCase = actualTestSuite.testSuite[options.testCaseName];
|
|
20695
20717
|
if (!actualTestCase) {
|
|
20696
|
-
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(
|
|
20718
|
+
throw new Error(`Did not find test case name '${options.testCaseName}' in '${Object.keys(actualTestSuite.testSuite)}'`);
|
|
20697
20719
|
}
|
|
20698
20720
|
const clean = options.clean ?? true;
|
|
20699
20721
|
const updateWorkflowEnabled = (options.updateWorkflow ?? true) && (actualTestCase.stackUpdateWorkflow ?? true);
|
|
@@ -20702,8 +20724,8 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20702
20724
|
return verbosity >= needed ? true : void 0;
|
|
20703
20725
|
};
|
|
20704
20726
|
try {
|
|
20705
|
-
if (!options.dryRun && (
|
|
20706
|
-
assertionResults = this.deploy(
|
|
20727
|
+
if (!options.dryRun && (actualTestCase.cdkCommandOptions?.deploy?.enabled ?? true)) {
|
|
20728
|
+
assertionResults = await this.deploy(
|
|
20707
20729
|
{
|
|
20708
20730
|
...this.defaultArgs,
|
|
20709
20731
|
profile: this.profile,
|
|
@@ -20718,32 +20740,32 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20718
20740
|
const env = {
|
|
20719
20741
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
20720
20742
|
CDK_CONTEXT_JSON: JSON.stringify(this.getContext({
|
|
20721
|
-
...
|
|
20743
|
+
...actualTestSuite.enableLookups ? DEFAULT_SYNTH_OPTIONS.context : {}
|
|
20722
20744
|
}))
|
|
20723
20745
|
};
|
|
20724
|
-
this.cdk.synthFast({
|
|
20746
|
+
await this.cdk.synthFast({
|
|
20725
20747
|
execCmd: this.cdkApp.split(" "),
|
|
20726
20748
|
env,
|
|
20727
20749
|
output: path4.relative(this.directory, this.cdkOutDir)
|
|
20728
20750
|
});
|
|
20729
20751
|
}
|
|
20730
20752
|
if (!assertionResults || !Object.values(assertionResults).some((result) => result.status === "fail")) {
|
|
20731
|
-
this.createSnapshot();
|
|
20753
|
+
await this.createSnapshot();
|
|
20732
20754
|
}
|
|
20733
20755
|
} catch (e) {
|
|
20734
20756
|
throw e;
|
|
20735
20757
|
} finally {
|
|
20736
20758
|
if (!options.dryRun) {
|
|
20737
|
-
if (clean && (
|
|
20738
|
-
this.destroy(options.testCaseName, {
|
|
20759
|
+
if (clean && (actualTestCase.cdkCommandOptions?.destroy?.enabled ?? true)) {
|
|
20760
|
+
await this.destroy(options.testCaseName, {
|
|
20739
20761
|
...this.defaultArgs,
|
|
20740
20762
|
profile: this.profile,
|
|
20741
20763
|
all: true,
|
|
20742
20764
|
force: true,
|
|
20743
20765
|
app: this.cdkApp,
|
|
20744
20766
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20745
|
-
...
|
|
20746
|
-
context: this.getContext(
|
|
20767
|
+
...actualTestCase.cdkCommandOptions?.destroy?.args,
|
|
20768
|
+
context: this.getContext(actualTestCase.cdkCommandOptions?.destroy?.args?.context),
|
|
20747
20769
|
verbose: enableForVerbosityLevel(3),
|
|
20748
20770
|
debug: enableForVerbosityLevel(4)
|
|
20749
20771
|
});
|
|
@@ -20756,21 +20778,20 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20756
20778
|
/**
|
|
20757
20779
|
* Perform a integ test case stack destruction
|
|
20758
20780
|
*/
|
|
20759
|
-
destroy(testCaseName, destroyArgs) {
|
|
20760
|
-
|
|
20761
|
-
const actualTestCase = this.actualTestSuite.testSuite[testCaseName];
|
|
20781
|
+
async destroy(testCaseName, destroyArgs) {
|
|
20782
|
+
const actualTestCase = (await this.actualTestSuite()).testSuite[testCaseName];
|
|
20762
20783
|
try {
|
|
20763
|
-
if (
|
|
20784
|
+
if (actualTestCase.hooks?.preDestroy) {
|
|
20764
20785
|
actualTestCase.hooks.preDestroy.forEach((cmd) => {
|
|
20765
20786
|
exec2(chunks(cmd), {
|
|
20766
20787
|
cwd: path4.dirname(this.snapshotDir)
|
|
20767
20788
|
});
|
|
20768
20789
|
});
|
|
20769
20790
|
}
|
|
20770
|
-
this.cdk.destroy({
|
|
20791
|
+
await this.cdk.destroy({
|
|
20771
20792
|
...destroyArgs
|
|
20772
20793
|
});
|
|
20773
|
-
if (
|
|
20794
|
+
if (actualTestCase.hooks?.postDestroy) {
|
|
20774
20795
|
actualTestCase.hooks.postDestroy.forEach((cmd) => {
|
|
20775
20796
|
exec2(chunks(cmd), {
|
|
20776
20797
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20780,15 +20801,15 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20780
20801
|
} catch (e) {
|
|
20781
20802
|
this.parseError(
|
|
20782
20803
|
e,
|
|
20783
|
-
|
|
20784
|
-
|
|
20804
|
+
actualTestCase.cdkCommandOptions?.destroy?.expectError ?? false,
|
|
20805
|
+
actualTestCase.cdkCommandOptions?.destroy?.expectedMessage
|
|
20785
20806
|
);
|
|
20786
20807
|
}
|
|
20787
20808
|
}
|
|
20788
20809
|
async watch(watchArgs, testCaseName, verbosity) {
|
|
20789
|
-
|
|
20790
|
-
const actualTestCase =
|
|
20791
|
-
if (
|
|
20810
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
20811
|
+
const actualTestCase = actualTestSuite.testSuite[testCaseName];
|
|
20812
|
+
if (actualTestCase.hooks?.preDeploy) {
|
|
20792
20813
|
actualTestCase.hooks.preDeploy.forEach((cmd) => {
|
|
20793
20814
|
exec2(chunks(cmd), {
|
|
20794
20815
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20797,16 +20818,16 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20797
20818
|
}
|
|
20798
20819
|
const deployArgs = {
|
|
20799
20820
|
...watchArgs,
|
|
20800
|
-
lookups:
|
|
20821
|
+
lookups: actualTestSuite.enableLookups,
|
|
20801
20822
|
stacks: [
|
|
20802
20823
|
...actualTestCase.stacks,
|
|
20803
20824
|
...actualTestCase.assertionStack ? [actualTestCase.assertionStack] : []
|
|
20804
20825
|
],
|
|
20805
20826
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20806
20827
|
outputsFile: path4.relative(this.directory, path4.join(this.cdkOutDir, "assertion-results.json")),
|
|
20807
|
-
...
|
|
20828
|
+
...actualTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20808
20829
|
context: {
|
|
20809
|
-
...this.getContext(
|
|
20830
|
+
...this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context)
|
|
20810
20831
|
},
|
|
20811
20832
|
app: this.cdkApp
|
|
20812
20833
|
};
|
|
@@ -20845,10 +20866,9 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20845
20866
|
cwd: this.directory
|
|
20846
20867
|
});
|
|
20847
20868
|
watcher.on("all", (event, file) => {
|
|
20848
|
-
var _a2;
|
|
20849
20869
|
if (assertionResults.endsWith(file) && (event === "add" || event === "change")) {
|
|
20850
20870
|
const start = Date.now();
|
|
20851
|
-
if (
|
|
20871
|
+
if (actualTestCase.hooks?.postDeploy) {
|
|
20852
20872
|
actualTestCase.hooks.postDeploy.forEach((cmd) => {
|
|
20853
20873
|
exec2(chunks(cmd), {
|
|
20854
20874
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20880,88 +20900,89 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20880
20900
|
}
|
|
20881
20901
|
}
|
|
20882
20902
|
});
|
|
20883
|
-
await new Promise((
|
|
20903
|
+
await new Promise((resolve4) => {
|
|
20884
20904
|
watcher.on("ready", async () => {
|
|
20885
|
-
|
|
20905
|
+
resolve4({});
|
|
20886
20906
|
});
|
|
20887
20907
|
});
|
|
20888
|
-
const
|
|
20889
|
-
|
|
20890
|
-
if (
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
|
|
20908
|
+
const { promise: waiter, resolve: resolve3 } = promiseWithResolvers();
|
|
20909
|
+
await this.cdk.watch(deployArgs, {
|
|
20910
|
+
// if `-v` (or above) is passed then stream the logs
|
|
20911
|
+
onStdout: (message) => {
|
|
20912
|
+
if (verbosity > 0) {
|
|
20913
|
+
process.stdout.write(message);
|
|
20914
|
+
}
|
|
20915
|
+
},
|
|
20916
|
+
// if `-v` (or above) is passed then stream the logs
|
|
20917
|
+
onStderr: (message) => {
|
|
20918
|
+
if (verbosity > 0) {
|
|
20919
|
+
process.stderr.write(message);
|
|
20920
|
+
}
|
|
20921
|
+
},
|
|
20922
|
+
onClose: async (code) => {
|
|
20902
20923
|
if (code !== 0) {
|
|
20903
20924
|
throw new Error("Watch exited with error");
|
|
20904
20925
|
}
|
|
20905
|
-
(_a2 = child.stdin) == null ? void 0 : _a2.end();
|
|
20906
20926
|
await watcher.close();
|
|
20907
20927
|
resolve3(code);
|
|
20908
|
-
}
|
|
20928
|
+
}
|
|
20909
20929
|
});
|
|
20930
|
+
await waiter;
|
|
20910
20931
|
}
|
|
20911
20932
|
/**
|
|
20912
20933
|
* Perform a integ test case deployment, including
|
|
20913
|
-
*
|
|
20934
|
+
* performing the update workflow
|
|
20914
20935
|
*/
|
|
20915
|
-
deploy(deployArgs, updateWorkflowEnabled, testCaseName) {
|
|
20916
|
-
|
|
20917
|
-
const actualTestCase = this.actualTestSuite.testSuite[testCaseName];
|
|
20936
|
+
async deploy(deployArgs, updateWorkflowEnabled, testCaseName) {
|
|
20937
|
+
const actualTestCase = (await this.actualTestSuite()).testSuite[testCaseName];
|
|
20918
20938
|
try {
|
|
20919
|
-
if (
|
|
20939
|
+
if (actualTestCase.hooks?.preDeploy) {
|
|
20920
20940
|
actualTestCase.hooks.preDeploy.forEach((cmd) => {
|
|
20921
20941
|
exec2(chunks(cmd), {
|
|
20922
20942
|
cwd: path4.dirname(this.snapshotDir)
|
|
20923
20943
|
});
|
|
20924
20944
|
});
|
|
20925
20945
|
}
|
|
20926
|
-
|
|
20946
|
+
const expectedTestSuite = await this.expectedTestSuite();
|
|
20947
|
+
if (updateWorkflowEnabled && this.hasSnapshot() && (expectedTestSuite && testCaseName in expectedTestSuite?.testSuite)) {
|
|
20927
20948
|
this.checkoutSnapshot();
|
|
20928
|
-
const expectedTestCase =
|
|
20929
|
-
this.cdk.deploy({
|
|
20949
|
+
const expectedTestCase = expectedTestSuite.testSuite[testCaseName];
|
|
20950
|
+
await this.cdk.deploy({
|
|
20930
20951
|
...deployArgs,
|
|
20931
20952
|
stacks: expectedTestCase.stacks,
|
|
20932
|
-
...
|
|
20933
|
-
context: this.getContext(
|
|
20953
|
+
...expectedTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20954
|
+
context: this.getContext(expectedTestCase?.cdkCommandOptions?.deploy?.args?.context),
|
|
20934
20955
|
app: path4.relative(this.directory, this.snapshotDir),
|
|
20935
|
-
lookups:
|
|
20956
|
+
lookups: expectedTestSuite?.enableLookups
|
|
20936
20957
|
});
|
|
20937
20958
|
}
|
|
20938
|
-
this.cdk.deploy({
|
|
20959
|
+
await this.cdk.deploy({
|
|
20939
20960
|
...deployArgs,
|
|
20940
|
-
lookups: this.actualTestSuite.enableLookups,
|
|
20961
|
+
lookups: (await this.actualTestSuite()).enableLookups,
|
|
20941
20962
|
stacks: [
|
|
20942
20963
|
...actualTestCase.stacks
|
|
20943
20964
|
],
|
|
20944
20965
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20945
|
-
...
|
|
20946
|
-
context: this.getContext(
|
|
20966
|
+
...actualTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20967
|
+
context: this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context),
|
|
20947
20968
|
app: this.cdkApp
|
|
20948
20969
|
});
|
|
20949
20970
|
if (actualTestCase.assertionStack) {
|
|
20950
|
-
this.cdk.deploy({
|
|
20971
|
+
await this.cdk.deploy({
|
|
20951
20972
|
...deployArgs,
|
|
20952
|
-
lookups: this.actualTestSuite.enableLookups,
|
|
20973
|
+
lookups: (await this.actualTestSuite()).enableLookups,
|
|
20953
20974
|
stacks: [
|
|
20954
20975
|
actualTestCase.assertionStack
|
|
20955
20976
|
],
|
|
20956
20977
|
rollback: false,
|
|
20957
20978
|
output: path4.relative(this.directory, this.cdkOutDir),
|
|
20958
|
-
...
|
|
20979
|
+
...actualTestCase?.cdkCommandOptions?.deploy?.args,
|
|
20959
20980
|
outputsFile: path4.relative(this.directory, path4.join(this.cdkOutDir, "assertion-results.json")),
|
|
20960
|
-
context: this.getContext(
|
|
20981
|
+
context: this.getContext(actualTestCase?.cdkCommandOptions?.deploy?.args?.context),
|
|
20961
20982
|
app: this.cdkApp
|
|
20962
20983
|
});
|
|
20963
20984
|
}
|
|
20964
|
-
if (
|
|
20985
|
+
if (actualTestCase.hooks?.postDeploy) {
|
|
20965
20986
|
actualTestCase.hooks.postDeploy.forEach((cmd) => {
|
|
20966
20987
|
exec2(chunks(cmd), {
|
|
20967
20988
|
cwd: path4.dirname(this.snapshotDir)
|
|
@@ -20978,8 +20999,8 @@ https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk/integ-tests-alpha`
|
|
|
20978
20999
|
} catch (e) {
|
|
20979
21000
|
this.parseError(
|
|
20980
21001
|
e,
|
|
20981
|
-
|
|
20982
|
-
|
|
21002
|
+
actualTestCase.cdkCommandOptions?.deploy?.expectError ?? false,
|
|
21003
|
+
actualTestCase.cdkCommandOptions?.deploy?.expectedMessage
|
|
20983
21004
|
);
|
|
20984
21005
|
}
|
|
20985
21006
|
return;
|
|
@@ -21715,6 +21736,8 @@ var require_resource = __commonJS({
|
|
|
21715
21736
|
* Update the type of this property with a new type
|
|
21716
21737
|
*
|
|
21717
21738
|
* Only if it's not in the set of types already.
|
|
21739
|
+
*
|
|
21740
|
+
* Returns true if the type was updated.
|
|
21718
21741
|
*/
|
|
21719
21742
|
updateType(type) {
|
|
21720
21743
|
const richType = new RichPropertyType(type);
|
|
@@ -21724,6 +21747,10 @@ var require_resource = __commonJS({
|
|
|
21724
21747
|
if (type.type === "string" && this.types().some((t) => t.type === "date-time")) {
|
|
21725
21748
|
return false;
|
|
21726
21749
|
}
|
|
21750
|
+
if (type.type === "string" && this.field.type.type === "json") {
|
|
21751
|
+
this.field.type = type;
|
|
21752
|
+
return true;
|
|
21753
|
+
}
|
|
21727
21754
|
if (!this.field.previousTypes) {
|
|
21728
21755
|
this.field.previousTypes = [];
|
|
21729
21756
|
}
|
|
@@ -21891,7 +21918,6 @@ var require_resource = __commonJS({
|
|
|
21891
21918
|
* otherwise on identifier
|
|
21892
21919
|
*/
|
|
21893
21920
|
sortKey(db) {
|
|
21894
|
-
var _a;
|
|
21895
21921
|
switch (this.type.type) {
|
|
21896
21922
|
case "integer":
|
|
21897
21923
|
case "boolean":
|
|
@@ -21906,7 +21932,7 @@ var require_resource = __commonJS({
|
|
|
21906
21932
|
case "map":
|
|
21907
21933
|
return ["1", this.type.type, ...new _RichPropertyType(this.type.element).sortKey(db)];
|
|
21908
21934
|
case "ref":
|
|
21909
|
-
return ["2", this.type.type,
|
|
21935
|
+
return ["2", this.type.type, db?.get("typeDefinition", this.type.reference)?.name ?? this.type.reference.$ref];
|
|
21910
21936
|
case "union":
|
|
21911
21937
|
const typeKeys = this.type.types.map((t) => new _RichPropertyType(t).sortKey(db));
|
|
21912
21938
|
typeKeys.sort((0, sorting_1.sortKeyComparator)((x) => x));
|
|
@@ -22647,6 +22673,23 @@ var init_iam_changes = __esm({
|
|
|
22647
22673
|
this.ssoAssignments.calculateDiff();
|
|
22648
22674
|
this.ssoInstanceACAConfigs.calculateDiff();
|
|
22649
22675
|
}
|
|
22676
|
+
static {
|
|
22677
|
+
this.IamPropertyScrutinies = [
|
|
22678
|
+
import_service_spec_types.PropertyScrutinyType.InlineIdentityPolicies,
|
|
22679
|
+
import_service_spec_types.PropertyScrutinyType.InlineResourcePolicy,
|
|
22680
|
+
import_service_spec_types.PropertyScrutinyType.ManagedPolicies
|
|
22681
|
+
];
|
|
22682
|
+
}
|
|
22683
|
+
static {
|
|
22684
|
+
this.IamResourceScrutinies = [
|
|
22685
|
+
import_service_spec_types.ResourceScrutinyType.ResourcePolicyResource,
|
|
22686
|
+
import_service_spec_types.ResourceScrutinyType.IdentityPolicyResource,
|
|
22687
|
+
import_service_spec_types.ResourceScrutinyType.LambdaPermission,
|
|
22688
|
+
import_service_spec_types.ResourceScrutinyType.SsoAssignmentResource,
|
|
22689
|
+
import_service_spec_types.ResourceScrutinyType.SsoInstanceACAConfigResource,
|
|
22690
|
+
import_service_spec_types.ResourceScrutinyType.SsoPermissionSet
|
|
22691
|
+
];
|
|
22692
|
+
}
|
|
22650
22693
|
get hasChanges() {
|
|
22651
22694
|
return this.statements.hasChanges || this.managedPolicies.hasChanges || this.ssoPermissionSets.hasChanges || this.ssoAssignments.hasChanges || this.ssoInstanceACAConfigs.hasChanges;
|
|
22652
22695
|
}
|
|
@@ -22744,19 +22787,17 @@ var init_iam_changes = __esm({
|
|
|
22744
22787
|
return ret;
|
|
22745
22788
|
}
|
|
22746
22789
|
summarizeSsoInstanceACAConfigs() {
|
|
22747
|
-
var _a, _b;
|
|
22748
22790
|
const ret = [];
|
|
22749
22791
|
const header = ["", "Resource", "InstanceArn", "AccessControlAttributes"];
|
|
22750
22792
|
function formatAccessControlAttribute(aca) {
|
|
22751
|
-
|
|
22752
|
-
return `Key: ${aca == null ? void 0 : aca.Key}, Values: [${(_a2 = aca == null ? void 0 : aca.Value) == null ? void 0 : _a2.Source.join(", ")}]`;
|
|
22793
|
+
return `Key: ${aca?.Key}, Values: [${aca?.Value?.Source.join(", ")}]`;
|
|
22753
22794
|
}
|
|
22754
22795
|
for (const att of this.ssoInstanceACAConfigs.additions) {
|
|
22755
22796
|
ret.push([
|
|
22756
22797
|
"+",
|
|
22757
22798
|
att.cfnLogicalId || "",
|
|
22758
22799
|
att.ssoInstanceArn || "",
|
|
22759
|
-
|
|
22800
|
+
att.accessControlAttributes?.map(formatAccessControlAttribute).join("\n") || ""
|
|
22760
22801
|
].map((s) => chalk3.green(s)));
|
|
22761
22802
|
}
|
|
22762
22803
|
for (const att of this.ssoInstanceACAConfigs.removals) {
|
|
@@ -22764,7 +22805,7 @@ var init_iam_changes = __esm({
|
|
|
22764
22805
|
"-",
|
|
22765
22806
|
att.cfnLogicalId || "",
|
|
22766
22807
|
att.ssoInstanceArn || "",
|
|
22767
|
-
|
|
22808
|
+
att.accessControlAttributes?.map(formatAccessControlAttribute).join("\n") || ""
|
|
22768
22809
|
].map((s) => chalk3.red(s)));
|
|
22769
22810
|
}
|
|
22770
22811
|
ret.sort(makeComparator((row) => [row[1]]));
|
|
@@ -22772,18 +22813,17 @@ var init_iam_changes = __esm({
|
|
|
22772
22813
|
return ret;
|
|
22773
22814
|
}
|
|
22774
22815
|
summarizeSsoPermissionSets() {
|
|
22775
|
-
var _a, _b;
|
|
22776
22816
|
const ret = [];
|
|
22777
22817
|
const header = ["", "Resource", "InstanceArn", "PermissionSet name", "PermissionsBoundary", "CustomerManagedPolicyReferences"];
|
|
22778
22818
|
function formatManagedPolicyRef(s) {
|
|
22779
|
-
return `Name: ${
|
|
22819
|
+
return `Name: ${s?.Name || ""}, Path: ${s?.Path || ""}`;
|
|
22780
22820
|
}
|
|
22781
22821
|
function formatSsoPermissionsBoundary(ssoPb) {
|
|
22782
|
-
if (
|
|
22783
|
-
return `ManagedPolicyArn: ${
|
|
22784
|
-
} else if (
|
|
22822
|
+
if (ssoPb?.ManagedPolicyArn !== void 0) {
|
|
22823
|
+
return `ManagedPolicyArn: ${ssoPb?.ManagedPolicyArn || ""}`;
|
|
22824
|
+
} else if (ssoPb?.CustomerManagedPolicyReference !== void 0) {
|
|
22785
22825
|
return `CustomerManagedPolicyReference: {
|
|
22786
|
-
${formatManagedPolicyRef(ssoPb
|
|
22826
|
+
${formatManagedPolicyRef(ssoPb?.CustomerManagedPolicyReference)}
|
|
22787
22827
|
}`;
|
|
22788
22828
|
} else {
|
|
22789
22829
|
return "";
|
|
@@ -22796,7 +22836,7 @@ var init_iam_changes = __esm({
|
|
|
22796
22836
|
att.ssoInstanceArn || "",
|
|
22797
22837
|
att.name || "",
|
|
22798
22838
|
formatSsoPermissionsBoundary(att.ssoPermissionsBoundary),
|
|
22799
|
-
|
|
22839
|
+
att.ssoCustomerManagedPolicyReferences?.map(formatManagedPolicyRef).join("\n") || ""
|
|
22800
22840
|
].map((s) => chalk3.green(s)));
|
|
22801
22841
|
}
|
|
22802
22842
|
for (const att of this.ssoPermissionSets.removals) {
|
|
@@ -22806,7 +22846,7 @@ var init_iam_changes = __esm({
|
|
|
22806
22846
|
att.ssoInstanceArn || "",
|
|
22807
22847
|
att.name || "",
|
|
22808
22848
|
formatSsoPermissionsBoundary(att.ssoPermissionsBoundary),
|
|
22809
|
-
|
|
22849
|
+
att.ssoCustomerManagedPolicyReferences?.map(formatManagedPolicyRef).join("\n") || ""
|
|
22810
22850
|
].map((s) => chalk3.red(s)));
|
|
22811
22851
|
}
|
|
22812
22852
|
ret.sort(makeComparator((row) => [row[1]]));
|
|
@@ -22880,8 +22920,7 @@ var init_iam_changes = __esm({
|
|
|
22880
22920
|
}
|
|
22881
22921
|
const appliesToPrincipal = "AWS:${" + logicalId + "}";
|
|
22882
22922
|
return flatMap(policies, (policy) => {
|
|
22883
|
-
|
|
22884
|
-
const unparsedStatement = ((_a = policy.PolicyDocument) == null ? void 0 : _a.Statement) ? policy.PolicyDocument.Statement : policy;
|
|
22923
|
+
const unparsedStatement = policy.PolicyDocument?.Statement ? policy.PolicyDocument.Statement : policy;
|
|
22885
22924
|
return defaultPrincipal(appliesToPrincipal, parseStatements(renderIntrinsics(unparsedStatement)));
|
|
22886
22925
|
});
|
|
22887
22926
|
}
|
|
@@ -22977,19 +23016,6 @@ var init_iam_changes = __esm({
|
|
|
22977
23016
|
return [parseLambdaPermission(renderIntrinsics(properties))];
|
|
22978
23017
|
}
|
|
22979
23018
|
};
|
|
22980
|
-
IamChanges.IamPropertyScrutinies = [
|
|
22981
|
-
import_service_spec_types.PropertyScrutinyType.InlineIdentityPolicies,
|
|
22982
|
-
import_service_spec_types.PropertyScrutinyType.InlineResourcePolicy,
|
|
22983
|
-
import_service_spec_types.PropertyScrutinyType.ManagedPolicies
|
|
22984
|
-
];
|
|
22985
|
-
IamChanges.IamResourceScrutinies = [
|
|
22986
|
-
import_service_spec_types.ResourceScrutinyType.ResourcePolicyResource,
|
|
22987
|
-
import_service_spec_types.ResourceScrutinyType.IdentityPolicyResource,
|
|
22988
|
-
import_service_spec_types.ResourceScrutinyType.LambdaPermission,
|
|
22989
|
-
import_service_spec_types.ResourceScrutinyType.SsoAssignmentResource,
|
|
22990
|
-
import_service_spec_types.ResourceScrutinyType.SsoInstanceACAConfigResource,
|
|
22991
|
-
import_service_spec_types.ResourceScrutinyType.SsoPermissionSet
|
|
22992
|
-
];
|
|
22993
23019
|
}
|
|
22994
23020
|
});
|
|
22995
23021
|
|
|
@@ -23031,8 +23057,7 @@ var init_security_group_rule = __esm({
|
|
|
23031
23057
|
"use strict";
|
|
23032
23058
|
SecurityGroupRule = class {
|
|
23033
23059
|
constructor(ruleObject, groupRef) {
|
|
23034
|
-
|
|
23035
|
-
this.ipProtocol = ((_a = ruleObject.IpProtocol) == null ? void 0 : _a.toString()) || "*unknown*";
|
|
23060
|
+
this.ipProtocol = ruleObject.IpProtocol?.toString() || "*unknown*";
|
|
23036
23061
|
this.fromPort = ruleObject.FromPort;
|
|
23037
23062
|
this.toPort = ruleObject.ToPort;
|
|
23038
23063
|
this.groupId = ruleObject.GroupId || groupRef || "*unknown*";
|
|
@@ -23297,7 +23322,6 @@ var init_types = __esm({
|
|
|
23297
23322
|
* case there is no further detail on property values), and resource type changes.
|
|
23298
23323
|
*/
|
|
23299
23324
|
scrutinizablePropertyChanges(scrutinyTypes) {
|
|
23300
|
-
var _a, _b, _c;
|
|
23301
23325
|
const ret = new Array();
|
|
23302
23326
|
for (const [resourceLogicalId, resourceChange] of Object.entries(this.resources.changes)) {
|
|
23303
23327
|
if (resourceChange.resourceTypeChanged) {
|
|
@@ -23306,7 +23330,7 @@ var init_types = __esm({
|
|
|
23306
23330
|
if (!resourceChange.resourceType) {
|
|
23307
23331
|
continue;
|
|
23308
23332
|
}
|
|
23309
|
-
const newTypeProps =
|
|
23333
|
+
const newTypeProps = loadResourceModel(resourceChange.resourceType)?.properties || {};
|
|
23310
23334
|
for (const [propertyName, prop] of Object.entries(newTypeProps)) {
|
|
23311
23335
|
const propScrutinyType = prop.scrutinizable || import_service_spec_types2.PropertyScrutinyType.None;
|
|
23312
23336
|
if (scrutinyTypes.includes(propScrutinyType)) {
|
|
@@ -23315,8 +23339,8 @@ var init_types = __esm({
|
|
|
23315
23339
|
propertyName,
|
|
23316
23340
|
resourceType: resourceChange.resourceType,
|
|
23317
23341
|
scrutinyType: propScrutinyType,
|
|
23318
|
-
oldValue:
|
|
23319
|
-
newValue:
|
|
23342
|
+
oldValue: resourceChange.oldProperties?.[propertyName],
|
|
23343
|
+
newValue: resourceChange.newProperties?.[propertyName]
|
|
23320
23344
|
});
|
|
23321
23345
|
}
|
|
23322
23346
|
}
|
|
@@ -23679,9 +23703,8 @@ function diffResource(oldValue, newValue) {
|
|
|
23679
23703
|
otherDiffs
|
|
23680
23704
|
});
|
|
23681
23705
|
function _diffProperty(oldV, newV, key, resourceSpec) {
|
|
23682
|
-
var _a;
|
|
23683
23706
|
let changeImpact = "NO_CHANGE" /* NO_CHANGE */;
|
|
23684
|
-
const spec =
|
|
23707
|
+
const spec = resourceSpec?.properties?.[key];
|
|
23685
23708
|
if (spec && !deepEqual(oldV, newV)) {
|
|
23686
23709
|
switch (spec.causesReplacement) {
|
|
23687
23710
|
case "yes":
|
|
@@ -23721,15 +23744,14 @@ var init_diff = __esm({
|
|
|
23721
23744
|
});
|
|
23722
23745
|
|
|
23723
23746
|
// ../cloudformation-diff/lib/diff/template-and-changeset-diff-merger.ts
|
|
23724
|
-
var
|
|
23747
|
+
var TemplateAndChangeSetDiffMerger;
|
|
23725
23748
|
var init_template_and_changeset_diff_merger = __esm({
|
|
23726
23749
|
"../cloudformation-diff/lib/diff/template-and-changeset-diff-merger.ts"() {
|
|
23727
23750
|
"use strict";
|
|
23728
23751
|
init_types();
|
|
23729
|
-
|
|
23752
|
+
TemplateAndChangeSetDiffMerger = class _TemplateAndChangeSetDiffMerger {
|
|
23730
23753
|
static determineChangeSetReplacementMode(propertyChange) {
|
|
23731
|
-
|
|
23732
|
-
if (((_a = propertyChange.Target) == null ? void 0 : _a.RequiresRecreation) === void 0) {
|
|
23754
|
+
if (propertyChange.Target?.RequiresRecreation === void 0) {
|
|
23733
23755
|
return "Conditionally";
|
|
23734
23756
|
}
|
|
23735
23757
|
if (propertyChange.Target.RequiresRecreation === "Always") {
|
|
@@ -23742,6 +23764,10 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23742
23764
|
}
|
|
23743
23765
|
return propertyChange.Target.RequiresRecreation;
|
|
23744
23766
|
}
|
|
23767
|
+
static {
|
|
23768
|
+
// If we somehow cannot find the resourceType, then we'll mark it as UNKNOWN, so that can be seen in the diff.
|
|
23769
|
+
this.UNKNOWN_RESOURCE_TYPE = "UNKNOWN_RESOURCE_TYPE";
|
|
23770
|
+
}
|
|
23745
23771
|
constructor(props) {
|
|
23746
23772
|
this.changeSet = props.changeSet;
|
|
23747
23773
|
this.changeSetResources = props.changeSetResources ?? this.convertDescribeChangeSetOutputToChangeSetResources(this.changeSet);
|
|
@@ -23750,15 +23776,14 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23750
23776
|
* Read resources from the changeSet, extracting information into ChangeSetResources.
|
|
23751
23777
|
*/
|
|
23752
23778
|
convertDescribeChangeSetOutputToChangeSetResources(changeSet) {
|
|
23753
|
-
var _a, _b;
|
|
23754
23779
|
const changeSetResources = {};
|
|
23755
23780
|
for (const resourceChange of changeSet.Changes ?? []) {
|
|
23756
|
-
if (
|
|
23781
|
+
if (resourceChange.ResourceChange?.LogicalResourceId === void 0) {
|
|
23757
23782
|
continue;
|
|
23758
23783
|
}
|
|
23759
23784
|
const propertyReplacementModes = {};
|
|
23760
23785
|
for (const propertyChange of resourceChange.ResourceChange.Details ?? []) {
|
|
23761
|
-
if (
|
|
23786
|
+
if (propertyChange.Target?.Attribute === "Properties" && propertyChange.Target.Name) {
|
|
23762
23787
|
propertyReplacementModes[propertyChange.Target.Name] = {
|
|
23763
23788
|
replacementMode: _TemplateAndChangeSetDiffMerger.determineChangeSetReplacementMode(propertyChange)
|
|
23764
23789
|
};
|
|
@@ -23779,19 +23804,17 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23779
23804
|
* replacement (e.g., changing the name of an IAM role requires deleting and replacing the role), then ChangeImpact is "Always".
|
|
23780
23805
|
*/
|
|
23781
23806
|
overrideDiffResourceChangeImpactWithChangeSetChangeImpact(logicalId, change) {
|
|
23782
|
-
|
|
23783
|
-
if (change.resourceTypeChanged === true || ((_a = change.resourceType) == null ? void 0 : _a.includes("AWS::Serverless"))) {
|
|
23807
|
+
if (change.resourceTypeChanged === true || change.resourceType?.includes("AWS::Serverless")) {
|
|
23784
23808
|
return;
|
|
23785
23809
|
}
|
|
23786
23810
|
change.forEachDifference((type, name, value) => {
|
|
23787
|
-
var _a2;
|
|
23788
23811
|
if (type === "Property") {
|
|
23789
23812
|
if (!this.changeSetResources[logicalId]) {
|
|
23790
23813
|
value.changeImpact = "NO_CHANGE" /* NO_CHANGE */;
|
|
23791
23814
|
value.isDifferent = false;
|
|
23792
23815
|
return;
|
|
23793
23816
|
}
|
|
23794
|
-
const changingPropertyCausesResourceReplacement = (
|
|
23817
|
+
const changingPropertyCausesResourceReplacement = (this.changeSetResources[logicalId].propertyReplacementModes ?? {})[name]?.replacementMode;
|
|
23795
23818
|
switch (changingPropertyCausesResourceReplacement) {
|
|
23796
23819
|
case "Always":
|
|
23797
23820
|
value.changeImpact = "WILL_REPLACE" /* WILL_REPLACE */;
|
|
@@ -23825,19 +23848,15 @@ var init_template_and_changeset_diff_merger = __esm({
|
|
|
23825
23848
|
});
|
|
23826
23849
|
}
|
|
23827
23850
|
findResourceImports() {
|
|
23828
|
-
var _a, _b;
|
|
23829
23851
|
const importedResourceLogicalIds = [];
|
|
23830
|
-
for (const resourceChange of
|
|
23831
|
-
if (
|
|
23852
|
+
for (const resourceChange of this.changeSet?.Changes ?? []) {
|
|
23853
|
+
if (resourceChange.ResourceChange?.Action === "Import") {
|
|
23832
23854
|
importedResourceLogicalIds.push(resourceChange.ResourceChange.LogicalResourceId);
|
|
23833
23855
|
}
|
|
23834
23856
|
}
|
|
23835
23857
|
return importedResourceLogicalIds;
|
|
23836
23858
|
}
|
|
23837
23859
|
};
|
|
23838
|
-
// If we somehow cannot find the resourceType, then we'll mark it as UNKNOWN, so that can be seen in the diff.
|
|
23839
|
-
_TemplateAndChangeSetDiffMerger.UNKNOWN_RESOURCE_TYPE = "UNKNOWN_RESOURCE_TYPE";
|
|
23840
|
-
TemplateAndChangeSetDiffMerger = _TemplateAndChangeSetDiffMerger;
|
|
23841
23860
|
}
|
|
23842
23861
|
});
|
|
23843
23862
|
|
|
@@ -31687,16 +31706,15 @@ var init_format = __esm({
|
|
|
31687
31706
|
* and resource metadata, and we combine all sources into a single map.
|
|
31688
31707
|
*/
|
|
31689
31708
|
readConstructPathsFrom(templateDiff) {
|
|
31690
|
-
var _a, _b, _c, _d;
|
|
31691
31709
|
for (const [logicalId, resourceDiff] of Object.entries(templateDiff.resources)) {
|
|
31692
31710
|
if (!resourceDiff) {
|
|
31693
31711
|
continue;
|
|
31694
31712
|
}
|
|
31695
|
-
const oldPathMetadata =
|
|
31713
|
+
const oldPathMetadata = resourceDiff.oldValue?.Metadata?.[PATH_METADATA_KEY];
|
|
31696
31714
|
if (oldPathMetadata && !(logicalId in this.logicalToPathMap)) {
|
|
31697
31715
|
this.logicalToPathMap[logicalId] = oldPathMetadata;
|
|
31698
31716
|
}
|
|
31699
|
-
const newPathMetadata =
|
|
31717
|
+
const newPathMetadata = resourceDiff.newValue?.Metadata?.[PATH_METADATA_KEY];
|
|
31700
31718
|
if (newPathMetadata && !(logicalId in this.logicalToPathMap)) {
|
|
31701
31719
|
this.logicalToPathMap[logicalId] = newPathMetadata;
|
|
31702
31720
|
}
|
|
@@ -31881,7 +31899,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
31881
31899
|
import_cloudformation_diff = __toESM(require_lib9());
|
|
31882
31900
|
init_cloud_assembly2();
|
|
31883
31901
|
init_runner_base();
|
|
31884
|
-
|
|
31902
|
+
init_common2();
|
|
31885
31903
|
IntegSnapshotRunner = class extends IntegRunner {
|
|
31886
31904
|
constructor(options) {
|
|
31887
31905
|
super(options);
|
|
@@ -31892,24 +31910,25 @@ var init_snapshot_test_runner = __esm({
|
|
|
31892
31910
|
*
|
|
31893
31911
|
* @returns any diagnostics and any destructive changes
|
|
31894
31912
|
*/
|
|
31895
|
-
testSnapshot(options = {}) {
|
|
31896
|
-
|
|
31913
|
+
async testSnapshot(options = {}) {
|
|
31914
|
+
const actualTestSuite = await this.actualTestSuite();
|
|
31915
|
+
const expectedTestSuite = await this.expectedTestSuite();
|
|
31897
31916
|
let doClean = true;
|
|
31898
31917
|
try {
|
|
31899
|
-
const expectedSnapshotAssembly = this.getSnapshotAssembly(this.snapshotDir,
|
|
31918
|
+
const expectedSnapshotAssembly = this.getSnapshotAssembly(this.snapshotDir, expectedTestSuite?.stacks);
|
|
31900
31919
|
const env = {
|
|
31901
31920
|
...DEFAULT_SYNTH_OPTIONS.env,
|
|
31902
31921
|
CDK_CONTEXT_JSON: JSON.stringify(this.getContext({
|
|
31903
|
-
...
|
|
31922
|
+
...actualTestSuite.enableLookups ? DEFAULT_SYNTH_OPTIONS.context : {}
|
|
31904
31923
|
}))
|
|
31905
31924
|
};
|
|
31906
|
-
this.cdk.synthFast({
|
|
31925
|
+
await this.cdk.synthFast({
|
|
31907
31926
|
execCmd: this.cdkApp.split(" "),
|
|
31908
31927
|
env,
|
|
31909
31928
|
output: path5.relative(this.directory, this.cdkOutDir)
|
|
31910
31929
|
});
|
|
31911
|
-
const actualSnapshotAssembly = this.getSnapshotAssembly(this.cdkOutDir,
|
|
31912
|
-
const diagnostics = this.diffAssembly(expectedSnapshotAssembly, actualSnapshotAssembly);
|
|
31930
|
+
const actualSnapshotAssembly = this.getSnapshotAssembly(this.cdkOutDir, actualTestSuite.stacks);
|
|
31931
|
+
const diagnostics = await this.diffAssembly(expectedSnapshotAssembly, actualSnapshotAssembly);
|
|
31913
31932
|
if (diagnostics.diagnostics.length) {
|
|
31914
31933
|
const additionalMessages = [];
|
|
31915
31934
|
if (options.retain) {
|
|
@@ -31974,8 +31993,8 @@ var init_snapshot_test_runner = __esm({
|
|
|
31974
31993
|
* @param stackId - the stack id
|
|
31975
31994
|
* @returns a list of resource types or undefined if none are found
|
|
31976
31995
|
*/
|
|
31977
|
-
getAllowedDestroyTypesForStack(stackId) {
|
|
31978
|
-
for (const testCase of Object.values(this.actualTests() ?? {})) {
|
|
31996
|
+
async getAllowedDestroyTypesForStack(stackId) {
|
|
31997
|
+
for (const testCase of Object.values(await this.actualTests() ?? {})) {
|
|
31979
31998
|
if (testCase.stacks.includes(stackId)) {
|
|
31980
31999
|
return testCase.allowDestroy;
|
|
31981
32000
|
}
|
|
@@ -31989,13 +32008,12 @@ var init_snapshot_test_runner = __esm({
|
|
|
31989
32008
|
* @param actual - the new (actual) snapshot
|
|
31990
32009
|
* @returns any diagnostics and any destructive changes
|
|
31991
32010
|
*/
|
|
31992
|
-
diffAssembly(expected, actual) {
|
|
31993
|
-
var _a, _b, _c;
|
|
32011
|
+
async diffAssembly(expected, actual) {
|
|
31994
32012
|
const failures = [];
|
|
31995
32013
|
const destructiveChanges = [];
|
|
31996
32014
|
for (const [stackId, stack] of Object.entries(expected)) {
|
|
31997
32015
|
for (const templateId of Object.keys(stack.templates)) {
|
|
31998
|
-
if (!
|
|
32016
|
+
if (!actual[stackId]?.templates[templateId]) {
|
|
31999
32017
|
failures.push({
|
|
32000
32018
|
testName: this.testName,
|
|
32001
32019
|
stackName: templateId,
|
|
@@ -32007,7 +32025,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
32007
32025
|
}
|
|
32008
32026
|
for (const [stackId, stack] of Object.entries(actual)) {
|
|
32009
32027
|
for (const templateId of Object.keys(stack.templates)) {
|
|
32010
|
-
if (!
|
|
32028
|
+
if (!expected[stackId]?.templates[templateId]) {
|
|
32011
32029
|
failures.push({
|
|
32012
32030
|
testName: this.testName,
|
|
32013
32031
|
stackName: templateId,
|
|
@@ -32017,7 +32035,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
32017
32035
|
continue;
|
|
32018
32036
|
} else {
|
|
32019
32037
|
const config = {
|
|
32020
|
-
diffAssets: (
|
|
32038
|
+
diffAssets: (await this.actualTestSuite()).getOptionsForStack(stackId)?.diffAssets
|
|
32021
32039
|
};
|
|
32022
32040
|
let actualTemplate = actual[stackId].templates[templateId];
|
|
32023
32041
|
let expectedTemplate = expected[stackId].templates[templateId];
|
|
@@ -32027,10 +32045,9 @@ var init_snapshot_test_runner = __esm({
|
|
|
32027
32045
|
}
|
|
32028
32046
|
const templateDiff = (0, import_cloudformation_diff.fullDiff)(expectedTemplate, actualTemplate);
|
|
32029
32047
|
if (!templateDiff.isEmpty) {
|
|
32030
|
-
const allowedDestroyTypes = this.getAllowedDestroyTypesForStack(stackId) ?? [];
|
|
32048
|
+
const allowedDestroyTypes = await this.getAllowedDestroyTypesForStack(stackId) ?? [];
|
|
32031
32049
|
templateDiff.resources.forEachDifference((logicalId, change) => {
|
|
32032
|
-
|
|
32033
|
-
const resourceType = ((_a2 = change.oldValue) == null ? void 0 : _a2.Type) ?? ((_b2 = change.newValue) == null ? void 0 : _b2.Type);
|
|
32050
|
+
const resourceType = change.oldValue?.Type ?? change.newValue?.Type;
|
|
32034
32051
|
if (resourceType && allowedDestroyTypes.includes(resourceType)) {
|
|
32035
32052
|
return;
|
|
32036
32053
|
}
|
|
@@ -32086,7 +32103,7 @@ var init_snapshot_test_runner = __esm({
|
|
|
32086
32103
|
const assetsSeen = /* @__PURE__ */ new Set();
|
|
32087
32104
|
const stringSubstitutions = new Array();
|
|
32088
32105
|
const paramRe = /^AssetParameters([a-zA-Z0-9]{64})(S3Bucket|S3VersionKey|ArtifactHash)([a-zA-Z0-9]{8})$/;
|
|
32089
|
-
for (const paramName of Object.keys(
|
|
32106
|
+
for (const paramName of Object.keys(template?.Parameters || {})) {
|
|
32090
32107
|
const m = paramRe.exec(paramName);
|
|
32091
32108
|
if (!m) {
|
|
32092
32109
|
continue;
|
|
@@ -32228,7 +32245,7 @@ __export(extract_worker_exports, {
|
|
|
32228
32245
|
snapshotTestWorker: () => snapshotTestWorker,
|
|
32229
32246
|
watchTestWorker: () => watchTestWorker
|
|
32230
32247
|
});
|
|
32231
|
-
function integTestWorker(request) {
|
|
32248
|
+
async function integTestWorker(request) {
|
|
32232
32249
|
const failures = [];
|
|
32233
32250
|
const verbosity = request.verbosity ?? 0;
|
|
32234
32251
|
for (const testInfo of request.tests) {
|
|
@@ -32247,13 +32264,13 @@ function integTestWorker(request) {
|
|
|
32247
32264
|
},
|
|
32248
32265
|
showOutput: verbosity >= 2
|
|
32249
32266
|
}, testInfo.destructiveChanges);
|
|
32250
|
-
const tests = runner.actualTests();
|
|
32267
|
+
const tests = await runner.actualTests();
|
|
32251
32268
|
if (!tests || Object.keys(tests).length === 0) {
|
|
32252
32269
|
throw new Error(`No tests defined for ${runner.testName}`);
|
|
32253
32270
|
}
|
|
32254
32271
|
for (const testCaseName of Object.keys(tests)) {
|
|
32255
32272
|
try {
|
|
32256
|
-
const results = runner.runIntegTestCase({
|
|
32273
|
+
const results = await runner.runIntegTestCase({
|
|
32257
32274
|
testCaseName,
|
|
32258
32275
|
clean: request.clean,
|
|
32259
32276
|
dryRun: request.dryRun,
|
|
@@ -32311,7 +32328,7 @@ async function watchTestWorker(options) {
|
|
|
32311
32328
|
showOutput: verbosity >= 2
|
|
32312
32329
|
});
|
|
32313
32330
|
runner.createCdkContextJson();
|
|
32314
|
-
const tests = runner.actualTests();
|
|
32331
|
+
const tests = await runner.actualTests();
|
|
32315
32332
|
if (!tests || Object.keys(tests).length === 0) {
|
|
32316
32333
|
throw new Error(`No tests defined for ${runner.testName}`);
|
|
32317
32334
|
}
|
|
@@ -32322,7 +32339,7 @@ async function watchTestWorker(options) {
|
|
|
32322
32339
|
});
|
|
32323
32340
|
}
|
|
32324
32341
|
}
|
|
32325
|
-
function snapshotTestWorker(testInfo, options = {}) {
|
|
32342
|
+
async function snapshotTestWorker(testInfo, options = {}) {
|
|
32326
32343
|
const failedTests = new Array();
|
|
32327
32344
|
const start = Date.now();
|
|
32328
32345
|
const test = new IntegTest(testInfo);
|
|
@@ -32345,7 +32362,7 @@ function snapshotTestWorker(testInfo, options = {}) {
|
|
|
32345
32362
|
});
|
|
32346
32363
|
failedTests.push(test.info);
|
|
32347
32364
|
} else {
|
|
32348
|
-
const { diagnostics, destructiveChanges } = runner.testSnapshot(options);
|
|
32365
|
+
const { diagnostics, destructiveChanges } = await runner.testSnapshot(options);
|
|
32349
32366
|
if (diagnostics.length > 0) {
|
|
32350
32367
|
diagnostics.forEach((diagnostic) => workerpool2.workerEmit({
|
|
32351
32368
|
...diagnostic,
|
|
@@ -32384,7 +32401,7 @@ var init_extract_worker = __esm({
|
|
|
32384
32401
|
workerpool2 = __toESM(require_src());
|
|
32385
32402
|
init_runner();
|
|
32386
32403
|
init_integration_tests();
|
|
32387
|
-
|
|
32404
|
+
init_common2();
|
|
32388
32405
|
workerpool2.worker({
|
|
32389
32406
|
snapshotTestWorker,
|
|
32390
32407
|
integTestWorker,
|