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

test: use tsx for E2E tests instead of ts-node #25399

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

HowardBraham
Copy link
Contributor

@HowardBraham HowardBraham commented Jun 18, 2024

Description

On my computer, it took 17 seconds just to launch Mocha for an E2E test. Not launch a browser, not start chromedriver/Ganache, not withFixtures. 17 seconds just to launch Mocha and do nothing. And on CircleCI, this 17 seconds happens thousands of times per workflow.

A lot of this time was taken by ts-node, which has a very slow startup time. I switched to using tsx, which is much much faster.

CircleCI Insights on develop showing about 16k credits per workflow

CircleCI Insights on this branch showing about 12k credits per workflow

After this is merged and observed for a bit, it may make sense to rebalance some parallelism in config.yml.

Open in GitHub Codespaces

Related issues

Manual testing steps

  1. Locally run yarn test:e2e:single [TESTPATH] --browser=chrome
  2. Make sure it still works, and see if it starts faster than before this PR

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Co-authored-by: David Murdoch [email protected]

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [e3b7c7a]
Page Load Metrics (54 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6911089115
domContentLoaded9201231
load42735473
domInteractive9201231
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.38%. Comparing base (85783b1) to head (e3b7c7a).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25399   +/-   ##
========================================
  Coverage    65.38%   65.38%           
========================================
  Files         1382     1382           
  Lines        54765    54765           
  Branches     14367    14367           
========================================
  Hits         35807    35807           
  Misses       18958    18958           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HowardBraham HowardBraham marked this pull request as ready for review June 18, 2024 22:17
@HowardBraham HowardBraham requested a review from a team as a code owner June 18, 2024 22:17
@HowardBraham HowardBraham requested a review from Gudahtt June 18, 2024 22:17
Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

🚀

@Gudahtt
Copy link
Member

Gudahtt commented Jun 18, 2024

Fascinating, that's a significant improvement. I wonder how it's so much faster.

I see that tsx uses esbuild under the hood, maybe that's a significant factor. I've given the documented esbuild-related limitations a quick review, and none of them seem like a concern for our tests.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@HowardBraham HowardBraham merged commit da4b61c into develop Jun 18, 2024
85 checks passed
@HowardBraham HowardBraham deleted the e2e/use-tsx branch June 18, 2024 22:31
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 18, 2024
@metamaskbot metamaskbot added release-12.0.0 Issue or pull request that will be included in release 12.0.0 and removed release-12.1.0 Issue or pull request that will be included in release 12.1.0 labels Jul 30, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-12.0.0 on PR. Adding release label release-12.0.0 on PR and removing other release labels(release-12.1.0), as PR was cherry-picked in branch 12.0.0.

@HowardBraham HowardBraham added contributor experience An issue that impacts, or planned improvement to, the contributor experience. and removed team-contributor-experience labels Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contributor experience An issue that impacts, or planned improvement to, the contributor experience. release-12.0.0 Issue or pull request that will be included in release 12.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants