aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

feat(integ-tests): chain assertion api calls

Open corymhall opened this issue 2 years ago • 2 comments

This PR does two things.

  1. Adds a helper method then() that makes it easier to chain assertion api calls together. Yes, it is possible to grab the underlying node and call addDependency, but I think then is a more intuitive experience.

Look at integ.log-group.ts to see where I updated a test from addDependency -> then

  1. Added an ApiCallBase class and renamed the api call interface. This will make it easier to add more types of Api Calls in the future (HttpApiCall coming soon*)

All Submissions:

Adding new Unconventional Dependencies:

  • [ ] This PR adds new unconventional dependencies following the process described here

New Features

  • [ ] Have you added the new feature to an integration test?
    • [ ] Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

corymhall avatar Sep 22 '22 18:09 corymhall

gitpod-io[bot] avatar Sep 22 '22 18:09 gitpod-io[bot]

Not sure if this is a huge problem, but thenable objects are fairly well-formed in JS world. There's no reason why we can't have our own one. However they usually use a different signature: then(success: Callback, error: Callback) with Callback being a function of sorts.

It might be more clear to use something like chain() or next() like we do in Step Functions.

mrgrain avatar Sep 23 '22 09:09 mrgrain

Not sure if this is a huge problem, but thenable objects are fairly well-formed in JS world. There's no reason why we can't have our own one. However they usually use a different signature: then(success: Callback, error: Callback) with Callback being a function of sorts.

It might be more clear to use something like chain() or next() like we do in Step Functions.

That's a good point, i'll change it to next()

corymhall avatar Sep 23 '22 11:09 corymhall

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[bot] avatar Sep 23 '22 13:09 mergify[bot]

AWS CodeBuild CI Report

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

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

aws-cdk-automation avatar Sep 23 '22 14:09 aws-cdk-automation

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[bot] avatar Sep 23 '22 14:09 mergify[bot]