-
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
chore(init-templates): allow renaming in templates for cdk migrate apps #27166
Conversation
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.
I'm thinking this should actually be placed within the cli-integ-tests
folder. It could even go in the cli.integtest.ts
file because it is a CLI test.
I had planned to separate them because it seems any test that uses cdk init is separated from the other commands. I didn't know if this was due to a compatibility issue, runtime optimization, or if it was just arbitrary. But I had planned to keep that structure just in case. If that's not right, then I'm happy to put it in the cli-integ-tests suite because it would definitely simplify the process. Of note any test that uses cdk init (including our migrate command) seems to fail locally, where as the others seem to succeed locally so I had assumed these suites were separated for compatibility reasons. Unsure if this is just an issue with my environment or it's an issue with init being testable locally |
Looking a bit more closely, I do think that we should put this in the |
will do |
Was gonna close but I'll just push a commit. That'll be significantly easier. |
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.
template.txt
🫣
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.
lol want it to be .json? or just a more descriptive name than "template"
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.
Both!
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.
changed them
@@ -50,6 +50,31 @@ integTest('VPC Lookup', withDefaultFixture(async (fixture) => { | |||
await fixture.cdkDeploy('import-vpc', { modEnv: { ENABLE_VPC_TESTING: 'IMPORT' } }); | |||
})); | |||
|
|||
integTest( |
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.
Let's synth and deploy this in each target language and then verify the deployment with something like
// verify the the stack
const response = await fixture.aws.cloudFormation('describeStacks', {
StackName: stackArn,
});
expect(response.StackName).toEqual(stackName);
As the test is written, it's not testing anything beyond what our unit tests already cover.
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.
Also, I'd move it below the tests that actually test synth and deploy.
const tempPath = path.resolve(context.integTestDir); | ||
const inputFile = path.join(__dirname, 'template.txt'); | ||
|
||
await tempShell.shell([ |
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.
This can't possibly pass. It's missing --stack-name
.
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.
Hm good point. It's actually kind of alarming because this did pass, and that likely means our other init tests aren't being tested currently. Since this is identical to how we do our init tests today
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.
Most of those tests have an expect
statement of some sort. I see that not all do but I'm not totally familiar with their inner workings.
32dd15f
to
316ac35
Compare
What's the error you're getting for csharp and java? |
Java
Csharp
|
343c2b0
to
626cc9c
Compare
c626a1c
to
b6aa7ec
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
New integ test for the new CDK migrate command. Template.txt is a sample cloudformation template with enough complexity to be a good enough sample.
Tests for Java and Csharp aren't there because they are broken right now. Add them back after we fix
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license