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

chore(CLI-integ-tests): cli integ tests cannot use local CDK framework #31131

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

comcalvi
Copy link
Contributor

Reason for this change

The cli integration tests cannot use your local version of aws-cdk-lib. This can be verified by making your Stack construct throw an error upon creation, and watching no CLI integration tests fail, even with -a.

Description of changes

Fixed the CLI integration test framework to correctly link the local packages, like it used to.

Description of how you validated changes

Manual testing. This isn't something we can add automated tests for.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label Aug 16, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team August 16, 2024 16:59
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 16, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 16, 2024
@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@comcalvi comcalvi added the pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested label Aug 20, 2024
Copy link
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This essentially skips install of the CDK and uses the local copy, correct? Just getting clarification, then good to approve.

captureStderr: false,
cwd: root,
show: 'error',
}));
})).data;
const output: YarnWorkspacesOutput = JSON.parse(outputDataString);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to parse the shell output again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we first need to parse the output of yarn workspaces, which includes a data object. That data object is an escaped JSON string, which needs to be parsed again.

@@ -96,7 +97,7 @@ async function findYarnPackages(root: string): Promise<Record<string, string>> {
* Find the root directory of the repo from the current directory
*/
export async function autoFindRoot() {
const found = await findUp('release.json');
const found = findUp('release.json');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd that this was ever awaited. Looking in the findUp function, I am not seeing async calls, but is there any chance this await is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS compiler said it's not needed, so I removed it. It doesn't return a promise, so there's no need to await anything here.

@comcalvi
Copy link
Contributor Author

Yep, it skips installing the CDK and uses the local version.

Copy link
Contributor

mergify bot commented Aug 26, 2024

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-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 26, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 379bcd6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 5d9af0f into main Aug 27, 2024
14 of 15 checks passed
Copy link
Contributor

mergify bot commented Aug 27, 2024

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).

@mergify mergify bot deleted the comcalvi/cli-framework branch August 27, 2024 00:28
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution/core This is a PR that came from AWS. p2 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants