Skip to content
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-tests: allow for different props during the stack update workflow #30402

Open
2 tasks
dontirun opened this issue May 31, 2024 · 1 comment
Open
2 tasks
Labels
@aws-cdk/integ-tests effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@dontirun
Copy link
Contributor

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

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

@dontirun dontirun added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 31, 2024
@pahud
Copy link
Contributor

pahud commented Jun 4, 2024

Thank you for sharing your use cases. It makes sense to me and we need to figure out how to support that.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/integ-tests effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants