winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.75k stars 186 forks source link

fix(sdk): remove redundant test constructs from construct tree #6642

Closed yoav-steinberg closed 3 weeks ago

yoav-steinberg commented 3 weeks ago

This relates to #3168

Our framework duplicates the test environment for each test statement. The environment includes the tests themselves, so the cloud.Function resources created for each test are duplicated for each test. So given n tests we have n^2 cloud functions. This blows up the number of resources. This PR removes the unused Test (cloud.Function) resources generated in each test environment making test deployment much faster.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

github-actions[bot] commented 3 weeks ago

Thanks for opening this pull request! :tada: Please consult the contributing guidelines for details on how to contribute to this project. If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon
monadabot commented 3 weeks ago

Console preview environment is available at https://wing-console-pr-6642.fly.dev :rocket:

Last Updated (UTC) 2024-06-05 18:32
monadabot commented 3 weeks ago

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜ | Benchmark | Before | After | Change | | :-- | --: | --: | --: | | version | 60ms±0.58 | 62ms±0.75 | +2ms (+3.8%)🟥 | | functions_10.test.w -t sim | 540ms±33.81 | 544ms±10.88 | +5ms (+0.87%)⬜ | | functions_10.test.w -t tf-aws | 2246ms±26.74 | 2275ms±35.23 | +29ms (+1.28%)⬜ | | hello_world.test.w -t sim | 428ms±4.65 | 439ms±6.78 | +10ms (+2.4%)⬜ | | hello_world.test.w -t tf-aws | 1525ms±6.94 | 1530ms±12.57 | +4ms (+0.27%)⬜ | | functions_1.test.w -t sim | 425ms±6.49 | 431ms±5.21 | +5ms (+1.19%)⬜ | | functions_1.test.w -t tf-aws | 880ms±7.18 | 881ms±5.59 | +1ms (+0.12%)⬜ | | jsii_big.test.w -t sim | 2936ms±11.83 | 2939ms±20.19 | +3ms (+0.11%)⬜ | | jsii_big.test.w -t tf-aws | 3179ms±15.93 | 3160ms±21.29 | -19ms (-0.59%)⬜ | | empty.test.w -t sim | 387ms±3.14 | 384ms±3.55 | -2ms (-0.62%)⬜ | | empty.test.w -t tf-aws | 627ms±4.46 | 637ms±7.3 | +10ms (+1.65%)⬜ | | jsii_small.test.w -t sim | 403ms±3.71 | 399ms±5.75 | -4ms (-0.98%)⬜ | | jsii_small.test.w -t tf-aws | 651ms±4.14 | 649ms±6.16 | -2ms (-0.34%)⬜ | ⬜ Within 1.5 standard deviations 🟩 Faster, Above 1.5 standard deviations 🟥 Slower, Above 1.5 standard deviations _Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI._
Results |name|mean|min|max|moe|sd| |----|----|----|----|----|----| |version|62ms|61ms|64ms|1ms|1ms| |functions_10.test.w -t sim|544ms|519ms|565ms|11ms|15ms| |functions_10.test.w -t tf-aws|2275ms|2199ms|2368ms|35ms|49ms| |hello_world.test.w -t sim|439ms|423ms|457ms|7ms|9ms| |hello_world.test.w -t tf-aws|1530ms|1513ms|1569ms|13ms|18ms| |functions_1.test.w -t sim|431ms|417ms|441ms|5ms|7ms| |functions_1.test.w -t tf-aws|881ms|872ms|894ms|6ms|8ms| |jsii_big.test.w -t sim|2939ms|2893ms|2987ms|20ms|28ms| |jsii_big.test.w -t tf-aws|3160ms|3122ms|3218ms|21ms|30ms| |empty.test.w -t sim|384ms|374ms|393ms|4ms|5ms| |empty.test.w -t tf-aws|637ms|618ms|649ms|7ms|10ms| |jsii_small.test.w -t sim|399ms|387ms|416ms|6ms|8ms| |jsii_small.test.w -t tf-aws|649ms|638ms|667ms|6ms|9ms|
Last Updated (UTC) 2024-06-05 18:27