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

[Tracking Issue] Tests for std APIs #2785

Closed
10 tasks done
eladb opened this issue Jun 4, 2023 · 2 comments · Fixed by #4432
Closed
10 tasks done

[Tracking Issue] Tests for std APIs #2785

eladb opened this issue Jun 4, 2023 · 2 comments · Fixed by #4432
Assignees
Labels

Comments

@eladb
Copy link
Contributor

eladb commented Jun 4, 2023

The PR #2783 introduces placeholders for tests for all std types under sdk_tests.

mergify bot pushed a commit that referenced this issue Jun 6, 2023
Static namespaced methods, such as the ones vended as part of the Wing SDK have the form `namespace.Class.method()`. In order to be able to call this method we need to capture the class object at runtime (also known as the "inflight type").

Since this is a dot delimited string (`"namespace.Class"`), we need to mangle it in order to be able to pass it through the capture mechanism. So we represent these types as `"namespace_Class"` within the inflight code and then call `namespace.Class._toInflightType()` on the preflight side (which is how static methods are supported for non-namespaced types).

Then, we must add a `_toInflightType()` static method to `std` and `util` classes, which will `require()` the correct SDK javascript file and return the type itself. Added a test to make sure this is covered for future SDK classes.

### Resolves

* Fixes #2576

### Follow ups

* #2782
* #2785

### Misc

* Added `WING_TARGET` to cloud function environments (for all targets).
* Created an initial set of SDK tests for `std` types.
* Some renames in `jsify.rs` to normalize the mental model a little.
* Switch the implementation of `Boolean.fromJson` from a macro to an actual method (just for the fun of it).
* Reduced progress logs from `wing test` by default and add a `--progress` option to enable.
* Prelude: #2799

## Checklist

- [x] Title matches [Winglang's style guide](https://docs.winglang.io/contributors/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [x] Tests added (always)
- [x] Docs updated (only required for features)
- [x] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Monada Contribution License](https://docs.winglang.io/terms-and-policies/contribution-license.html)*.
@staycoolcall911 staycoolcall911 added the good first issue Good for newcomers label Jun 12, 2023
@revitalbarletz revitalbarletz self-assigned this Jun 13, 2023
@staycoolcall911 staycoolcall911 changed the title Missing tests for std APIs [Tracking Issue] Tests for std APIs Jun 19, 2023
@revitalbarletz
Copy link
Contributor

Set tests last by @WeepingClown13!

@mergify mergify bot closed this as completed in #4432 Oct 6, 2023
mergify bot pushed a commit that referenced this issue Oct 6, 2023
Adding tests for the standard library container type Set.
closes #4372, which in turn also finishes and closes #2785.

## Checklist

- [ ] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [ ] Description explains motivation and solution
- [ ] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*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)*.
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.35.8.

mergify bot pushed a commit that referenced this issue Oct 9, 2023
Adding missing `Json` tests for tracking issue #2785

*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)*.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants