Skip to content

Commit 6c935c7

Browse files
chore(athena): update integ test to use IntegTest construct (#24146)
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9e1388d commit 6c935c7

9 files changed

+203
-27
lines changed

Diff for: packages/@aws-cdk/aws-athena/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"@aws-cdk/assertions": "0.0.0",
8484
"@aws-cdk/cdk-build-tools": "0.0.0",
8585
"@aws-cdk/integ-runner": "0.0.0",
86+
"@aws-cdk/integ-tests": "0.0.0",
8687
"@aws-cdk/cfn2ts": "0.0.0",
8788
"@aws-cdk/pkglint": "0.0.0",
8889
"@types/jest": "^27.5.2",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "30.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Parameters": {
3+
"BootstrapVersion": {
4+
"Type": "AWS::SSM::Parameter::Value<String>",
5+
"Default": "/cdk-bootstrap/hnb659fds/version",
6+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
7+
}
8+
},
9+
"Rules": {
10+
"CheckBootstrapVersion": {
11+
"Assertions": [
12+
{
13+
"Assert": {
14+
"Fn::Not": [
15+
{
16+
"Fn::Contains": [
17+
[
18+
"1",
19+
"2",
20+
"3",
21+
"4",
22+
"5"
23+
],
24+
{
25+
"Ref": "BootstrapVersion"
26+
}
27+
]
28+
}
29+
]
30+
},
31+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
32+
}
33+
]
34+
}
35+
}
36+
}

Diff for: packages/@aws-cdk/aws-athena/test/integ.workgroup.js.snapshot/aws-cdk-athena-workgroup-tags.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "20.0.0",
2+
"version": "30.0.0",
33
"files": {
44
"d8b01509e317c31bcc2aa728dce91fba9a9fb5d533a6b61cf09948a178861951": {
55
"source": {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"30.0.0"}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
2-
"version": "20.0.0",
2+
"version": "30.0.0",
33
"testCases": {
4-
"integ.workgroup": {
4+
"athena-workgroup-tags-test/DefaultTest": {
55
"stacks": [
66
"aws-cdk-athena-workgroup-tags"
77
],
8-
"diffAssets": false,
9-
"stackUpdateWorkflow": true
8+
"assertionStack": "athena-workgroup-tags-test/DefaultTest/DeployAssert",
9+
"assertionStackName": "athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB"
1010
}
11-
},
12-
"synthContext": {},
13-
"enableLookups": false
11+
}
1412
}

Diff for: packages/@aws-cdk/aws-athena/test/integ.workgroup.js.snapshot/manifest.json

+54-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
2-
"version": "20.0.0",
2+
"version": "30.0.0",
33
"artifacts": {
4-
"Tree": {
5-
"type": "cdk:tree",
6-
"properties": {
7-
"file": "tree.json"
8-
}
9-
},
104
"aws-cdk-athena-workgroup-tags.assets": {
115
"type": "cdk:asset-manifest",
126
"properties": {
@@ -59,6 +53,59 @@
5953
]
6054
},
6155
"displayName": "aws-cdk-athena-workgroup-tags"
56+
},
57+
"athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB.assets": {
58+
"type": "cdk:asset-manifest",
59+
"properties": {
60+
"file": "athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB.assets.json",
61+
"requiresBootstrapStackVersion": 6,
62+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
63+
}
64+
},
65+
"athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB": {
66+
"type": "aws:cloudformation:stack",
67+
"environment": "aws://unknown-account/unknown-region",
68+
"properties": {
69+
"templateFile": "athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB.template.json",
70+
"validateOnSynth": false,
71+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
72+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
73+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
74+
"requiresBootstrapStackVersion": 6,
75+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
76+
"additionalDependencies": [
77+
"athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB.assets"
78+
],
79+
"lookupRole": {
80+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
81+
"requiresBootstrapStackVersion": 8,
82+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
83+
}
84+
},
85+
"dependencies": [
86+
"athenaworkgrouptagstestDefaultTestDeployAssert5C4419AB.assets"
87+
],
88+
"metadata": {
89+
"/athena-workgroup-tags-test/DefaultTest/DeployAssert/BootstrapVersion": [
90+
{
91+
"type": "aws:cdk:logicalId",
92+
"data": "BootstrapVersion"
93+
}
94+
],
95+
"/athena-workgroup-tags-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [
96+
{
97+
"type": "aws:cdk:logicalId",
98+
"data": "CheckBootstrapVersion"
99+
}
100+
]
101+
},
102+
"displayName": "athena-workgroup-tags-test/DefaultTest/DeployAssert"
103+
},
104+
"Tree": {
105+
"type": "cdk:tree",
106+
"properties": {
107+
"file": "tree.json"
108+
}
62109
}
63110
}
64111
}

Diff for: packages/@aws-cdk/aws-athena/test/integ.workgroup.js.snapshot/tree.json

+81-11
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
"id": "App",
55
"path": "",
66
"children": {
7-
"Tree": {
8-
"id": "Tree",
9-
"path": "Tree",
10-
"constructInfo": {
11-
"fqn": "constructs.Construct",
12-
"version": "10.1.85"
13-
}
14-
},
157
"aws-cdk-athena-workgroup-tags": {
168
"id": "aws-cdk-athena-workgroup-tags",
179
"path": "aws-cdk-athena-workgroup-tags",
@@ -42,17 +34,95 @@
4234
"fqn": "@aws-cdk/aws-athena.CfnWorkGroup",
4335
"version": "0.0.0"
4436
}
37+
},
38+
"BootstrapVersion": {
39+
"id": "BootstrapVersion",
40+
"path": "aws-cdk-athena-workgroup-tags/BootstrapVersion",
41+
"constructInfo": {
42+
"fqn": "@aws-cdk/core.CfnParameter",
43+
"version": "0.0.0"
44+
}
45+
},
46+
"CheckBootstrapVersion": {
47+
"id": "CheckBootstrapVersion",
48+
"path": "aws-cdk-athena-workgroup-tags/CheckBootstrapVersion",
49+
"constructInfo": {
50+
"fqn": "@aws-cdk/core.CfnRule",
51+
"version": "0.0.0"
52+
}
53+
}
54+
},
55+
"constructInfo": {
56+
"fqn": "@aws-cdk/core.Stack",
57+
"version": "0.0.0"
58+
}
59+
},
60+
"athena-workgroup-tags-test": {
61+
"id": "athena-workgroup-tags-test",
62+
"path": "athena-workgroup-tags-test",
63+
"children": {
64+
"DefaultTest": {
65+
"id": "DefaultTest",
66+
"path": "athena-workgroup-tags-test/DefaultTest",
67+
"children": {
68+
"Default": {
69+
"id": "Default",
70+
"path": "athena-workgroup-tags-test/DefaultTest/Default",
71+
"constructInfo": {
72+
"fqn": "constructs.Construct",
73+
"version": "10.1.249"
74+
}
75+
},
76+
"DeployAssert": {
77+
"id": "DeployAssert",
78+
"path": "athena-workgroup-tags-test/DefaultTest/DeployAssert",
79+
"children": {
80+
"BootstrapVersion": {
81+
"id": "BootstrapVersion",
82+
"path": "athena-workgroup-tags-test/DefaultTest/DeployAssert/BootstrapVersion",
83+
"constructInfo": {
84+
"fqn": "@aws-cdk/core.CfnParameter",
85+
"version": "0.0.0"
86+
}
87+
},
88+
"CheckBootstrapVersion": {
89+
"id": "CheckBootstrapVersion",
90+
"path": "athena-workgroup-tags-test/DefaultTest/DeployAssert/CheckBootstrapVersion",
91+
"constructInfo": {
92+
"fqn": "@aws-cdk/core.CfnRule",
93+
"version": "0.0.0"
94+
}
95+
}
96+
},
97+
"constructInfo": {
98+
"fqn": "@aws-cdk/core.Stack",
99+
"version": "0.0.0"
100+
}
101+
}
102+
},
103+
"constructInfo": {
104+
"fqn": "@aws-cdk/integ-tests.IntegTestCase",
105+
"version": "0.0.0"
106+
}
45107
}
46108
},
109+
"constructInfo": {
110+
"fqn": "@aws-cdk/integ-tests.IntegTest",
111+
"version": "0.0.0"
112+
}
113+
},
114+
"Tree": {
115+
"id": "Tree",
116+
"path": "Tree",
47117
"constructInfo": {
48118
"fqn": "constructs.Construct",
49-
"version": "10.1.85"
119+
"version": "10.1.249"
50120
}
51121
}
52122
},
53123
"constructInfo": {
54-
"fqn": "constructs.Construct",
55-
"version": "10.1.85"
124+
"fqn": "@aws-cdk/core.App",
125+
"version": "0.0.0"
56126
}
57127
}
58128
}

Diff for: packages/@aws-cdk/aws-athena/test/integ.workgroup.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as cdk from '@aws-cdk/core';
2+
import { IntegTest } from '@aws-cdk/integ-tests';
23
import { CfnWorkGroup } from '../lib';
34

45
const app = new cdk.App();
@@ -21,4 +22,8 @@ new CfnWorkGroup(stack, 'AthenaWorkgroup', {
2122
],
2223
});
2324

25+
new IntegTest(app, 'athena-workgroup-tags-test', {
26+
testCases: [stack],
27+
});
28+
2429
app.synth();

0 commit comments

Comments
 (0)