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

docs: update INTEGRATION_TESTS.md #27632

Merged
merged 3 commits into from
Oct 20, 2023
Merged

docs: update INTEGRATION_TESTS.md #27632

merged 3 commits into from
Oct 20, 2023

Conversation

scanlonp
Copy link
Contributor

This updates our docs surrounding integ tests:

  • gives the correct location of stable module integ tests
  • standardizes code examples
  • adds example for using assertAtPath()
  • warns against using outputPaths in awsApiCall()
  • other small updates

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 Oct 20, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team October 20, 2023 21:30
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 20, 2023
Copy link
Contributor

@vinayak-kukreja vinayak-kukreja left a comment

Choose a reason for hiding this comment

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

Hey, thank you for improving our docs. 🙌

I have some suggestions, let me know if I can clarify anything.

status: 'SUCCEEDED',
}));
```

Not every test requires an assertion. We typically do not need to assert CloudFormation behavior. For example, if we create an S3 Bucket
If we want to pick out certain values from the api call response, we can use the `assertAtPath()` method, as in the [integ.pipeline-with-additional-inputs.ts](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-testing/framework-integ/test/pipelines/test/integ.pipeline-with-additional-inputs.ts) integ test. Note that using the `outputPaths` optional parameter on the `awsApiCall()` function often interacts poorly with the `expect()` function.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that using the outputPaths optional parameter on the awsApiCall() function often interacts poorly with the expect() function.

Why is this the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea, but it did not work for me, and I have heard from others that it has not worked smoothly for them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, it may be better to deprecate this if it is inconsistent. But not blocking this PR :)

INTEGRATION_TESTS.md Show resolved Hide resolved
INTEGRATION_TESTS.md Outdated Show resolved Hide resolved
INTEGRATION_TESTS.md Show resolved Hide resolved
@vinayak-kukreja vinayak-kukreja changed the title chore: update INTEGRATION_TESTS.md docs: update INTEGRATION_TESTS.md Oct 20, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2023

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
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 8720f44
  • 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 8f4600c into main Oct 20, 2023
9 checks passed
@mergify mergify bot deleted the scanlonp-integration-tests-md branch October 20, 2023 22:59
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants