Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmortlock committed Sep 3, 2022
1 parent a57cc4e commit 9666a45
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 13 deletions.
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-batch/test/integ.job-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ new JobDefinition(stack, "JobDefinition", {
},
});

new JobDefinition(stack, "JobDefinitionTags", {
container: {
image: ContainerImage.fromRegistry("docker/whalesay"),
},
propagateTags: true,
});

const integ = new IntegTest(app, "IntegTest-BatchDefaultEnvVarsStack", {
testCases: [stack],
regions: ["us-east-1"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "21.0.0",
"files": {
"0a50911921bcac3c1775e3a82fc9c4414e3f12ea24b1e2c73bf1fc4c625ee16c": {
"fa4cb3c0495612b2b5dea9687948520b07f859705061dad691367153183cbc90": {
"source": {
"path": "BatchDefaultEnvVarsStack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "0a50911921bcac3c1775e3a82fc9c4414e3f12ea24b1e2c73bf1fc4c625ee16c.json",
"objectKey": "fa4cb3c0495612b2b5dea9687948520b07f859705061dad691367153183cbc90.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,49 @@
},
"Timeout": {}
}
},
"JobDefinitionTags76FA063A": {
"Type": "AWS::Batch::JobDefinition",
"Properties": {
"Type": "container",
"ContainerProperties": {
"Environment": [
{
"Name": "AWS_REGION",
"Value": {
"Ref": "AWS::Region"
}
},
{
"Name": "AWS_ACCOUNT",
"Value": {
"Ref": "AWS::AccountId"
}
}
],
"Image": "docker/whalesay",
"Privileged": false,
"ReadonlyRootFilesystem": false,
"ResourceRequirements": [
{
"Type": "VCPU",
"Value": "1"
},
{
"Type": "MEMORY",
"Value": "4"
}
]
},
"PlatformCapabilities": [
"EC2"
],
"PropagateTags": true,
"RetryStrategy": {
"Attempts": 1
},
"Timeout": {}
}
}
},
"Parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"de70b340a5b843502197c20700c9328cb928be11584f66762e1ac05dc5380bed": {
"674d442d4a977a672cccae088b5eabcf91e06ee46b2464e4437c0332e04cf1a8": {
"source": {
"path": "IntegTestBatchDefaultEnvVarsStackDefaultTestDeployAssertC15EFFF2.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "de70b340a5b843502197c20700c9328cb928be11584f66762e1ac05dc5380bed.json",
"objectKey": "674d442d4a977a672cccae088b5eabcf91e06ee46b2464e4437c0332e04cf1a8.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"status": "ACTIVE"
},
"flattenResponse": "true",
"salt": "1661947601911"
"salt": "1662181496271"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand All @@ -36,7 +36,7 @@
]
},
"expected": "{\"$StringLike\":\"AWS_REGION\"}",
"salt": "1661947601912"
"salt": "1662181496272"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0a50911921bcac3c1775e3a82fc9c4414e3f12ea24b1e2c73bf1fc4c625ee16c.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fa4cb3c0495612b2b5dea9687948520b07f859705061dad691367153183cbc90.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand All @@ -45,6 +45,12 @@
"data": "JobDefinition24FFE3ED"
}
],
"/BatchDefaultEnvVarsStack/JobDefinitionTags/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "JobDefinitionTags76FA063A"
}
],
"/BatchDefaultEnvVarsStack/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
Expand Down Expand Up @@ -76,7 +82,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/de70b340a5b843502197c20700c9328cb928be11584f66762e1ac05dc5380bed.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/674d442d4a977a672cccae088b5eabcf91e06ee46b2464e4437c0332e04cf1a8.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.85"
"version": "10.1.92"
}
},
"BatchDefaultEnvVarsStack": {
Expand Down Expand Up @@ -91,6 +91,83 @@
"fqn": "@aws-cdk/aws-batch.JobDefinition",
"version": "0.0.0"
}
},
"JobDefinitionTags": {
"id": "JobDefinitionTags",
"path": "BatchDefaultEnvVarsStack/JobDefinitionTags",
"children": {
"Resource-Batch-Task-Definition-Role": {
"id": "Resource-Batch-Task-Definition-Role",
"path": "BatchDefaultEnvVarsStack/JobDefinitionTags/Resource-Batch-Task-Definition-Role",
"constructInfo": {
"fqn": "@aws-cdk/aws-iam.LazyRole",
"version": "0.0.0"
}
},
"Resource-Batch-Job-Container-Definition": {
"id": "Resource-Batch-Job-Container-Definition",
"path": "BatchDefaultEnvVarsStack/JobDefinitionTags/Resource-Batch-Job-Container-Definition",
"constructInfo": {
"fqn": "@aws-cdk/aws-ecs.ContainerDefinition",
"version": "0.0.0"
}
},
"Resource": {
"id": "Resource",
"path": "BatchDefaultEnvVarsStack/JobDefinitionTags/Resource",
"attributes": {
"aws:cdk:cloudformation:type": "AWS::Batch::JobDefinition",
"aws:cdk:cloudformation:props": {
"type": "container",
"containerProperties": {
"environment": [
{
"name": "AWS_REGION",
"value": {
"Ref": "AWS::Region"
}
},
{
"name": "AWS_ACCOUNT",
"value": {
"Ref": "AWS::AccountId"
}
}
],
"image": "docker/whalesay",
"privileged": false,
"readonlyRootFilesystem": false,
"resourceRequirements": [
{
"type": "VCPU",
"value": "1"
},
{
"type": "MEMORY",
"value": "4"
}
]
},
"platformCapabilities": [
"EC2"
],
"propagateTags": true,
"retryStrategy": {
"attempts": 1
},
"timeout": {}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-batch.CfnJobDefinition",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/aws-batch.JobDefinition",
"version": "0.0.0"
}
}
},
"constructInfo": {
Expand All @@ -111,7 +188,7 @@
"path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/Default",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.85"
"version": "10.1.92"
}
},
"DeployAssert": {
Expand All @@ -131,7 +208,7 @@
"path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/SdkProvider/AssertionsProvider",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.85"
"version": "10.1.92"
}
}
},
Expand Down Expand Up @@ -171,7 +248,7 @@
"path": "IntegTest-BatchDefaultEnvVarsStack/DefaultTest/DeployAssert/AwsApiCallBatchdescribeJobDefinitions/AssertEqualsBatchdescribeJobDefinitions/AssertionProvider/AssertionsProvider",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.85"
"version": "10.1.92"
}
}
},
Expand Down Expand Up @@ -249,7 +326,7 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.85"
"version": "10.1.92"
}
}
},
Expand Down

0 comments on commit 9666a45

Please sign in to comment.