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: don't use --runInBand and improve execution performance #2005

Merged
merged 1 commit into from Jun 10, 2019

Conversation

Projects
None yet
2 participants
@hiroppy
Copy link
Member

commented Jun 10, 2019

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

modify only

Motivation / Use-Case

Currently, the test's execution performance is too slow because we select serial execution.

Project: https://github.com/webpack/webpack-dev-server/projects/1#card-22555681

In this pr, we can use parallel execution.

Result

serial execution
Test Suites: 1 skipped, 49 passed, 49 of 50 total
Tests:       9 skipped, 419 passed, 428 total
Snapshots:   152 passed, 152 total
Time:        113.313s, estimated 173s
Ran all test suites.
parallel execution
Test Suites: 1 skipped, 49 passed, 49 of 50 total
Tests:       9 skipped, 419 passed, 428 total
Snapshots:   152 passed, 152 total
Time:        60.5s
Ran all test suites.

Strategy

Set the number of ports of each test

see https://github.com/webpack/webpack-dev-server/blob/feature/modify-jest/test/ports-map.js

The key is a file name and the value is the number of ports. We make it easy to change the number of ports flexibly.

globalSetup

see https://github.com/webpack/webpack-dev-server/blob/feature/modify-jest/globalSetupTest.js

We'll use many ports for parallel execution, so we have to make sure that all ports used at boot time are free.

Tests
const [port1, port2] = require('../ports-map')['file-name'];

Breaking Changes

no

Additional Info

NOTE: this pr targets #1996, not next

@hiroppy hiroppy requested a review from evilebottnawi as a code owner Jun 10, 2019

@hiroppy hiroppy referenced this pull request Jun 10, 2019

Merged

test: make use of async/await #1996

2 of 6 tasks complete
@codecov

This comment has been minimized.

Copy link

commented Jun 10, 2019

Codecov Report

Merging #2005 into feature/refactor-tests will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           feature/refactor-tests   #2005   +/-   ##
======================================================
  Coverage                    92.4%   92.4%           
======================================================
  Files                          28      28           
  Lines                        1067    1067           
  Branches                      324     324           
======================================================
  Hits                          986     986           
  Misses                         77      77           
  Partials                        4       4

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e0c340...35405a7. Read the comment docs.

@hiroppy hiroppy added the pr: next label Jun 10, 2019

@evilebottnawi
Copy link
Member

left a comment

Good job! Let's merge this in master, we will support webpack-dev-server@3 some time after release 4 version so to avoid problem with merge and releases better refactor tests in master

@hiroppy

This comment has been minimized.

Copy link
Member Author

commented Jun 10, 2019

@evilebottnawi I want to merge this to next branch. And I'll create a backport pr to master branch because this change has many conflicts between next and master. anyway, I cannot avoid resolving conflicts.

@evilebottnawi

This comment has been minimized.

Copy link
Member

commented Jun 10, 2019

@hiroppy 👍

@evilebottnawi
Copy link
Member

left a comment

Feel free to merge when CI green

@hiroppy hiroppy merged commit 50a9bb0 into feature/refactor-tests Jun 10, 2019

14 checks passed

codecov/patch Coverage not affected when comparing 0e0c340...35405a7
Details
codecov/project 92.4% remains the same compared to 0e0c340
Details
licence/cla Contributor License Agreement is signed.
Details
webpack.webpack-dev-server Build #20190610.1 succeeded
Details
webpack.webpack-dev-server (Lint) Lint succeeded
Details
webpack.webpack-dev-server (Linux node-10) Linux node-10 succeeded
Details
webpack.webpack-dev-server (Linux node-12) Linux node-12 succeeded
Details
webpack.webpack-dev-server (Linux node-8) Linux node-8 succeeded
Details
webpack.webpack-dev-server (Windows node-10) Windows node-10 succeeded
Details
webpack.webpack-dev-server (Windows node-12) Windows node-12 succeeded
Details
webpack.webpack-dev-server (Windows node-8) Windows node-8 succeeded
Details
webpack.webpack-dev-server (macOS node-10) macOS node-10 succeeded
Details
webpack.webpack-dev-server (macOS node-12) macOS node-12 succeeded
Details
webpack.webpack-dev-server (macOS node-8) macOS node-8 succeeded
Details

@hiroppy hiroppy deleted the feature/modify-jest branch Jun 10, 2019

hiroppy added a commit that referenced this pull request Jun 10, 2019

hiroppy added a commit that referenced this pull request Jun 10, 2019

hiroppy added a commit that referenced this pull request Jun 10, 2019

@hiroppy hiroppy referenced this pull request Jun 10, 2019

Open

feat(client): add clientMode option #1977

1 of 6 tasks complete

hiroppy added a commit that referenced this pull request Jun 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.