-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integ-runner: randomly named integration test stacks? #27437
Comments
You can create a stack with a defined name (e.g. |
|
Aren't the snapshots currently based on the stack name though? So if we change the stack name on each build, won't we get a unique snapshot each time? |
Yes. You're also free to come up with some other method of generating pseudorandom names. However you generate your stack names, you can specify the underlying name that CloudFormation will use by setting the |
@indrora, import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export class DynamicIntegStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
const uuid = Math.random().toString(36).slice(2, 7);
super(scope, id, {
stackName: `${props?.stackName ?? id}-${uuid}`,
});
}
} diff --git ...snapshot/manifest.json ...snapshot/manifest.json
index 89dbed7..b122dc6 100644
--- ...snapshot/manifest.json
+++ ...snapshot/manifest.json
@@ -28,7 +28,8 @@
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
- }
+ },
+ "stackName": "VpcTestStack-jrcdh"
},
"dependencies": [
"INFRA-CDK-K8S-VpcTestStack.assets"
@@ -292,7 +293,8 @@
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
- }
+ },
+ "stackName": "...TestStack-3wdfe"
},
"dependencies": [
"INFRA-CDK-K8S-CidrReservationTestStack.assets"
@@ -442,7 +444,8 @@
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
- }
+ },
+ "stackName": "...TestStack-jjges"
}, This makes it pretty impossible to store these manifests and use them to determine if new tests are necessary or not .. Any suggestions? |
I would also find a feature like this useful in order to allow multiple branches (or developers) to run integration tests concurrently without interfering with each other. |
Describe the feature
By default, it seems that Integration Test stack names are static and consistent.. which makes it hard to run multiple tests at once. We would like to have the integration test runner add a randomly generated string to stacks (within some set of bounds ... like 4-5 charactars, alphanumeric, etc) so that we can run multiple sets of tests at once across a larger development team.
Use Case
It's tough to develop a CDK project when only one integration test can run at once.. also failed stacks then block further integration testing.
Proposed Solution
Allow dynamically naming or appending strings to the integration test stack names.
Other Information
No response
Acknowledgements
CDK version used
2.93.0
Environment details (OS name and version, etc.)
N/A
The text was updated successfully, but these errors were encountered: