-
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
fix: this.node.addError does not cause cdk diff
to fail #4700
#5284
Conversation
Adding in appStacks.processMetadata(stacks); command into the diff method so that metadata is process correctly and the diff should fail
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
cdk diff
to fail #4700cdk diff
to fail #4700
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@nideveloper thanks for taking a run at this issue! When you say you're not sure testing the change, did you mean locally or writing unit/integ tests? The PR checklist should point you towards running/adding integ tests, but I'm wondering if the CONTRIBUTING guide itself needs to be beefed up? |
@shivlaks sorry I should have been way more specific. So when I looked into the existing tests for the diff functionality it doesn't actually test the inner workings of diff. A flag is passed in to say pass or fail, this overrides everything that diff actually does internally. So I don't really have an example of a test that uses diff to fail for two mock stacks without setting this flag which for my purposes of this change wouldn't be a very good test as the change is to fail diff if error flags are in the stack. test diff use of fail flag I just wanted to make sure before I go down a certain path with testing this that I was going the right way or that I am not missing something obvious |
I should add I got all the existing tests running and passing locally etc, I didn't have any issues with that so I think the documentation is probably ok. |
I worked it out, going through the commit process now. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
that's great, looking good. i'm wondering if we can also add an integ test for verifying this scenario |
Correct me if i'm wrong but since this ticket is about testing a scenario where you do a diff on a stack with an error I would need to modify this file to create a test stack that has an error? That way I could create a file like this one to test it fails |
@shivlaks I was writing some integration tests there but the existing tests all seem to be based around stacks that can deploy and be interrogated via the cli. A stack with an error on it cannot be deployed. I am pretty sure I can keep modifying until it works but it seems to be against the spirit of the int tests |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@nideveloper fair point, I don't think it's necessary. have you run the cli integ tests and verified that they all pass? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please confirm integ tests run successfully, otherwise LGTM! 🎉
Awesome, let me revert my local changes and run them again today then confirm back here! |
@shivlaks just ran the integration tests and they pass. Will update the branch to be up to date with master and then it should be good to go |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Code updated to latest from master, automated builds ran and passed. Should be good to go |
Adding in appStacks.processMetadata(stacks); command into the diff method so that metadata is processed correctly and the diff should fail
This is for issue #4700
I am unsure how to go about effectively testing this change so I wanted to open the pull request early and start some conversation.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license