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

Increase coverage using automatic cloud snapshot tests #5958

Closed
eladb opened this issue Mar 17, 2024 · 4 comments
Closed

Increase coverage using automatic cloud snapshot tests #5958

eladb opened this issue Mar 17, 2024 · 4 comments
Labels
⌨️ cli CLI ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl

Comments

@eladb
Copy link
Contributor

eladb commented Mar 17, 2024

I'd like to be able to capture a snapshot of the output when compiling to cloud targets and use it to protect against regressions in CI (without having to deploy to the cloud).

RFC

See #6044

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Slack.
@eladb eladb added ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl labels Mar 17, 2024
@eladb eladb changed the title Increase coverage using cloud snapshot tests Increase coverage using automatic cloud snapshot tests Mar 17, 2024
@Chriscbr Chriscbr added the ⌨️ cli CLI label Mar 18, 2024
@Chriscbr
Copy link
Contributor

I think high level user story makes sense, I'm only unsure about the choice to to automatically take snapshots of every test the user writes. By default, Wing's syntax encourages you to reuse the same test fixtures or preflight components for multiple tests so that you don't have to write the same things over and over. So in the code below, the three tests would all produce identical snapshots, which is not great.

let bucket = new cloud.Bucket();
let api = new cloud.Api();
let dynamodb = new dynamodb.Table();

test "scenario 1" {
  // ...
}

test "scenario 2" {
  // ...
}

test "scenario 3" {
  // ...
}

@eladb
Copy link
Contributor Author

eladb commented Mar 24, 2024

So in the code below, the three tests would all produce identical snapshots, which is not great.

I think a single .test.w file should product a single snapshot, not one per test. See the documentation for cdk-integ, which is basically a similar approach.

eladb added a commit that referenced this issue Mar 24, 2024
An RFC for #5958.

A proposal for a feature that will capture a snapshot of the synthesis output
from `wing test` to reduce regressions in cloud implementations.
mergify bot pushed a commit that referenced this issue Apr 3, 2024
An RFC for #5958.

A proposal for a feature that will capture a snapshot of the synthesis output from `wing test` to reduce regressions in cloud implementations.


*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
@Chriscbr
Copy link
Contributor

@eladb Can this be closed per #6163 ?

@eladb
Copy link
Contributor Author

eladb commented Jun 23, 2024

Yes, we still need to run this in winglibs, but that's a different issue.

@eladb eladb closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ cli CLI ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl
Projects
Status: Done
Development

No branches or pull requests

2 participants