integ-tests: allow for different props during the stack update workflow
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Allow `testCase` stacks to use different props on the stack create and update workflows
### Use Case
I have CDK constructs that utilize custom resources. This would allow me to properly test custom resources `onUpdate` operations by changing the properties passed to them
### Proposed Solution
_No response_
### Other Information
I can currently achieve this behavior with the following "workaround". It forces two instances of the stack to use the same stack name to achieve the update functionality
```ts
import * as integ from '@aws-cdk/integ-tests-alpha';
import * as cdk from 'aws-cdk-lib';
import { Construct } from "constructs";
const app = new cdk.App();
interface TestStackProps extends cdk.StackProps {
someParameter: string;
}
class TestStack extends cdk.Stack {
constructor(scope: Construct, id: string, props: TestStackProps) {
super(scope, id, props);
// insert construct code here
}
}
const createStack = new TestStack(app, 'test-stack-create', {
someParameter: 'foo',
stackName:'test-stack'
});
const updateStack = new TestStack(app, 'test-stack-update', {
someParameter: 'bar',
stackName:'test-stack'
});
updateStack.addDependency(createStack);
new integ.IntegTest(app, 'integration-test', {
testCases: [createStack, updateStack],
stackUpdateWorkflow: false,
diffAssets: true,
});
```
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.143.1
### Environment details (OS name and version, etc.)
N/A
Contributor guide
Research direction
Start at the TypeScript IntegTest entry point and trace how testCases are processed in the stack update workflow. Check how stackUpdateWorkflow and stack properties are passed to create and update operations; done means a testCase stack can use different props in those two workflows and custom-resource onUpdate behavior can be exercised.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100