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

Use "validateLogs" for preset-env's debug fixtures #10401

Merged

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This PR makes preset-env's debug-fixtures use the new functionality introduced in #10326

This has two main advantages:

  1. We don't need to maintain two separate fixture runners
  2. It greatly improves the tests duration, becase we don't need to spawn a new child process for each test in order to capture its stdout/stderr:

time yarn jest preset-env before this PR:

Test Suites: 10 passed, 10 total
Tests:       2 skipped, 384 passed, 386 total
Snapshots:   0 total
Time:        25.902s
Ran all test suites matching /preset-env/i.
Done in 27.22s.
yarn jest preset-env  52,17s user 4,80s system 207% cpu 27,490 total

time yarn jest preset-env after this PR:

Test Suites: 9 passed, 9 total
Tests:       2 skipped, 400 passed, 402 total
Snapshots:   0 total
Time:        5.299s
Ran all test suites matching /preset-env/i.
Done in 6.46s.
yarn jest preset-env  19,86s user 1,61s system 318% cpu 6,742 total

time yarn jest before this PR:

Test Suites: 146 passed, 146 total
Tests:       116 skipped, 9670 passed, 9786 total
Snapshots:   34 passed, 34 total
Time:        54.118s
Ran all test suites.
Done in 55.34s.
yarn jest  439,57s user 22,30s system 832% cpu 55,495 total

time yarn jest after this PR:

Test Suites: 145 passed, 145 total
Tests:       116 skipped, 9686 passed, 9802 total
Snapshots:   34 passed, 34 total
Time:        40.294s
Ran all test suites.
Done in 41.35s.
yarn jest  406,04s user 19,17s system 1021% cpu 41,623 total

NOTES:

  • Many debug-fixtures contained two input files. I split them in two different fixtures
  • The Successfully compiled 1 file with Babel. disappeared from stdout, because it wasn't printed by preset-env but by @babel/cli
  • Some options.json or stdout.txt files are reported as "new" or "deleted" by git. It's just because of the fixtures I duplicated, or because git doesn't properly track renames of small files with many updates.

@nicolo-ribaudo nicolo-ribaudo added area: tests PR: Internal 🏠 A type of pull request used for our changelog categories labels Sep 6, 2019
Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

Awesome, been on the list from when we first wrote preset-env :)

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11479/

@nicolo-ribaudo nicolo-ribaudo merged commit 3e8a5c5 into babel:master Sep 6, 2019
@nicolo-ribaudo nicolo-ribaudo deleted the preset-env-debug-fixtures-no-cp branch September 6, 2019 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants