Skip to content

Commit

Permalink
test: use tsx for E2E tests instead of ts-node (#25399)
Browse files Browse the repository at this point in the history
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](https://app.circleci.com/insights/github/MetaMask/metamask-extension/workflows/test_and_release/overview?branch=develop&reporting-window=last-24-hours)

[CircleCI Insights on this branch showing about 12k credits per workflow](https://app.circleci.com/insights/github/MetaMask/metamask-extension/workflows/test_and_release/overview?branch=e2e%2Fuse-tsx&reporting-window=last-24-hours)

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

---------

Co-authored-by: David Murdoch
<187813+davidmurdoch@users.noreply.github.com>
  • Loading branch information
HowardBraham authored Jun 18, 2024
1 parent 40c0f02 commit da4b61c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion test/e2e/.mocharc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// This file exists to add mocha configuration options specific to our
// E2E Test suite.
module.exports = {
require: ['test/e2e/e2e-mocha-setup.js'],
// Registers tsx so that we may use the same TypeScript features in
// E2E tests that we use elsewhere in our code.
require: ['tsx/esm'],
'node-option': ['import=tsx'],
};
5 changes: 0 additions & 5 deletions test/e2e/e2e-mocha-setup.js

This file was deleted.

0 comments on commit da4b61c

Please sign in to comment.