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

Add a RunOnEventLoop method to modulestest.Runtime #3181

Merged
merged 4 commits into from
Jul 11, 2023

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Jul 10, 2023

What?

This Pull Request adds a RunOnEventLoop method to the modulestest.Runtime, to facilitate testing code that should be dispatched to the event loop, such as code that returns promises.

Why?

While writing tests for the #3142, I stumbled upon this code from @mstoykov, with a TODO attached. I thought that as I was about to copy-paste that snippet anyway, I might as well do as instructed in TODO and move the code to the modulestest.Runtime class.

The TODO hinted at potential improvements without detailing that I'd be nonetheless happy to include if necessary 🤞🏻

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make ci-like-lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

@oleiade oleiade self-assigned this Jul 10, 2023
@oleiade oleiade requested review from mstoykov and removed request for imiric July 10, 2023 12:05
@oleiade oleiade changed the title Add a RunOnEventLoop method to modulestest.Runtime Add a RunOnEventLoop method to modulestest.Runtime Jul 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2023

Codecov Report

Merging #3181 (4154faf) into master (1b446a4) will increase coverage by 0.01%.
The diff coverage is 80.00%.

❗ Current head 4154faf differs from pull request most recent head 4f152fd. Consider uploading reports for the commit 4f152fd to get more accurate results

@@            Coverage Diff             @@
##           master    #3181      +/-   ##
==========================================
+ Coverage   72.78%   72.80%   +0.01%     
==========================================
  Files         256      256              
  Lines       19697    19703       +6     
==========================================
+ Hits        14337    14344       +7     
+ Misses       4464     4463       -1     
  Partials      896      896              
Flag Coverage Δ
ubuntu 72.72% <80.00%> (+<0.01%) ⬆️
windows 72.66% <80.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
output/cloud/expv2/output.go 64.77% <0.00%> (ø)
js/modulestest/runtime.go 100.00% <100.00%> (ø)
output/cloud/expv2/hdr.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@oleiade oleiade force-pushed the feature/modulestest-runtime-RunOnEventLoop branch from 2b84825 to 4f152fd Compare July 11, 2023 10:08
Copy link
Contributor

@olegbespalov olegbespalov left a comment

Choose a reason for hiding this comment

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

🚀

@olegbespalov olegbespalov added this to the v0.46.0 milestone Jul 11, 2023
@oleiade oleiade merged commit c2f09fc into master Jul 11, 2023
21 checks passed
@oleiade oleiade deleted the feature/modulestest-runtime-RunOnEventLoop branch July 11, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants