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

fix(sdk): unable to use util.exec in preflight #7019

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Conversation

tsuf239
Copy link
Contributor

@tsuf239 tsuf239 commented Aug 14, 2024

fixes: #6915

Checklist

  • Title matches Winglang's style guide
  • 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.

@tsuf239 tsuf239 requested a review from a team as a code owner August 14, 2024 10:26
Copy link

Thanks for opening this pull request! 🎉
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 standard library @chriscbr
Wing Console @skyrpex
Wing compiler and language design @chriscbr
VSCode extension and language server @chriscbr
Wing CLI @chriscbr
Documentation @boyney123
Examples @boyney123
Wing Playground @skyrpex

@monadabot
Copy link
Contributor

monadabot commented Aug 14, 2024

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

Last Updated (UTC) 2024-08-14 13:30

examples/tests/sdk_tests/util/exec.test.w Outdated Show resolved Hide resolved
libs/wingsdk/src/util/util.ts Show resolved Hide resolved
@monadabot
Copy link
Contributor

Benchmarks

Comparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 58ms±0.9 63ms±1.08 +5ms (+8.96%)🟥
hello_world.test.w -t sim 420ms±15.77 418ms±9.02 -2ms (-0.37%)⬜
hello_world.test.w -t tf-aws 1534ms±21.02 1554ms±19.58 +20ms (+1.33%)⬜
jsii_big.test.w -t sim 3010ms±16.56 3038ms±27.78 +27ms (+0.91%)⬜
jsii_big.test.w -t tf-aws 3196ms±23.68 3245ms±23.23 +49ms (+1.54%)⬜
functions_1.test.w -t sim 406ms±3.55 413ms±5.09 +7ms (+1.8%)⬜
functions_1.test.w -t tf-aws 874ms±10.11 871ms±8.66 -3ms (-0.34%)⬜
empty.test.w -t sim 375ms±3.6 380ms±9.09 +5ms (+1.33%)⬜
empty.test.w -t tf-aws 625ms±7.52 623ms±8.04 -2ms (-0.28%)⬜
functions_10.test.w -t sim 519ms±16.31 502ms±11.21 -17ms (-3.34%)⬜
functions_10.test.w -t tf-aws 2251ms±19.45 2207ms±19.21 -44ms (-1.96%)⬜
jsii_small.test.w -t sim 384ms±3.81 383ms±4.8 -2ms (-0.41%)⬜
jsii_small.test.w -t tf-aws 635ms±4.79 632ms±5.49 -3ms (-0.46%)⬜

⬜ 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 63ms 61ms 65ms 1ms 2ms
hello_world.test.w -t sim 418ms 397ms 440ms 9ms 13ms
hello_world.test.w -t tf-aws 1554ms 1515ms 1597ms 20ms 27ms
jsii_big.test.w -t sim 3038ms 2983ms 3078ms 28ms 39ms
jsii_big.test.w -t tf-aws 3245ms 3190ms 3308ms 23ms 32ms
functions_1.test.w -t sim 413ms 402ms 423ms 5ms 7ms
functions_1.test.w -t tf-aws 871ms 850ms 887ms 9ms 12ms
empty.test.w -t sim 380ms 360ms 402ms 9ms 13ms
empty.test.w -t tf-aws 623ms 612ms 650ms 8ms 11ms
functions_10.test.w -t sim 502ms 475ms 523ms 11ms 16ms
functions_10.test.w -t tf-aws 2207ms 2160ms 2243ms 19ms 27ms
jsii_small.test.w -t sim 383ms 368ms 390ms 5ms 7ms
jsii_small.test.w -t tf-aws 632ms 623ms 649ms 5ms 8ms
Last Updated (UTC) 2024-08-14 13:36

return {
stdout: stdout.toString(),
stderr: stderr.toString(),
stderr: "",
Copy link
Contributor

@Chriscbr Chriscbr Aug 21, 2024

Choose a reason for hiding this comment

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

Let's add a TODO comment or open an issue to note this limitation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no real limitation I think- the stderr is thrown in the catch statement if exists- and passed to the user :)
I think that it yields the same result of the promisify function

Copy link
Contributor

Choose a reason for hiding this comment

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

@tsuf239 I thought even if a command succeeds it can still emit to both stdout and stderr?

Copy link
Contributor

mergify bot commented Aug 22, 2024

Thanks for contributing, @tsuf239! This PR will now be added to the merge queue, or immediately merged if tsuf/exec-in-preflight is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Aug 22, 2024
@mergify mergify bot merged commit 9f49b16 into main Aug 22, 2024
15 checks passed
@mergify mergify bot deleted the tsuf/exec-in-preflight branch August 22, 2024 14:40
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.83.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use util.exec in preflight on Windows
4 participants