Skip to content

Commit 122e7dc

Browse files
committed
Merge branch 'master' into next
# Conflicts: # package.json # test/HarmonyModulesHelpers.unittest.js # test/StatsTestCases.test.js # yarn.lock
2 parents ae504ae + 0c4d69b commit 122e7dc

54 files changed

Lines changed: 248 additions & 319 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.istanbul.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
instrumentation:
2+
excludes:
3+
- "**/*.runtime.js"

‎.travis.yml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ matrix:
1717
env: NO_WATCH_TESTS=1 JOB_PART=lint
1818
- os: linux
1919
node_js: "8"
20-
env: NO_WATCH_TESTS=1 JOB_PART=test
20+
env: NO_WATCH_TESTS=1 JOB_PART=integration
21+
- os: linux
22+
node_js: "8"
23+
env: NO_WATCH_TESTS=1 JOB_PART=unit
2124
- os: linux
2225
node_js: "6"
23-
env: NO_WATCH_TESTS=1 JOB_PART=test
26+
env: NO_WATCH_TESTS=1 JOB_PART=integration
2427
- os: linux
2528
node_js: "4"
26-
env: NO_WATCH_TESTS=1 JOB_PART=test
29+
env: NO_WATCH_TESTS=1 JOB_PART=integration
2730
- os: osx
2831
node_js: "8"
29-
env: NO_WATCH_TESTS=1 JOB_PART=test
32+
env: NO_WATCH_TESTS=1 JOB_PART=integration
3033
allow_failures:
3134
- os: osx
3235
fast_finish: true
@@ -38,7 +41,7 @@ script: npm run travis:$JOB_PART
3841

3942
after_success:
4043
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
41-
- cat ./coverage/coverage.json | node_modules/codecov.io/bin/codecov.io.js
44+
- bash <(curl -s https://codecov.io/bash) -F $JOB_PART
4245
- rm -rf ./coverage
4346

4447
notifications:

‎appveyor.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ branches:
99
init:
1010
- git config --global core.autocrlf input
1111

12-
clone_depth: 50
13-
1412
# what combinations to test
1513
environment:
1614
matrix:
1715
- nodejs_version: 8
18-
job_part: test
16+
job_part: unit
17+
- nodejs_version: 8
18+
job_part: integration
1919
- nodejs_version: 6
20-
job_part: test
20+
job_part: integration
2121

2222
install:
2323
- ps: Install-Product node $env:nodejs_version x64
@@ -36,3 +36,4 @@ test_script:
3636
- npm --version
3737
- yarn --version
3838
- cmd: npm run appveyor:%job_part%
39+
- cmd: npm install -g codecov && codecov -F %job_part%

‎codecov.yml‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,29 @@ coverage:
66
range: "70...100"
77
status:
88
project:
9-
default:
9+
default: off
10+
integration:
11+
flags: integration
1012
target: auto
13+
unit:
14+
flags: unit
15+
target: 0%
1116
patch:
12-
default:
13-
target: auto
17+
default: off
18+
integration:
19+
flags: integration
20+
target: 90%
21+
base: pr
22+
unit:
23+
flags: unit
24+
target: 0%
25+
base: pr
1426
changes:
15-
default:
16-
branches: null
17-
comment: off
27+
default: off
28+
integration:
29+
flags: integration
30+
target: 0%
31+
unit:
32+
flags: unit
33+
target: 0%
34+
comment: off

‎open-bot.yaml‎

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ rules:
5959

6060

6161

62-
# Report specific error message if mocha fails
62+
# Report specific error message if mocha for integration tests fails
6363
- filters:
6464
ensure:
6565
value: "{{report_ci}}"
@@ -71,7 +71,7 @@ rules:
7171
state: "failed"
7272
allow_failure: false
7373
config:
74-
env: JOB_PART=test
74+
env: JOB_PART=integration
7575
fetch: travis_job.log
7676
string_cleanup:
7777
id: logResult
@@ -97,6 +97,46 @@ rules:
9797

9898

9999

100+
# Report specific error message if mocha for unit tests fails
101+
- filters:
102+
ensure:
103+
value: "{{report_ci}}"
104+
equals: yep
105+
commit: true
106+
status:
107+
context: "continuous-integration/travis-ci/pr"
108+
travis_job:
109+
state: "failed"
110+
allow_failure: false
111+
config:
112+
env: JOB_PART=unit
113+
fetch: travis_job.log
114+
string_cleanup:
115+
id: logResult
116+
value: "{{{fetch}}}"
117+
remove:
118+
- "^[\\s\\S]+?\\d+\\s+pending\n+"
119+
- "npm ERR!.*\n"
120+
- "\n*=============================================================================\n[\\s\\S]*"
121+
actions:
122+
comment:
123+
identifier: "ci-result"
124+
message: |-
125+
@{{commit.author.login}} Please review the following output log for errors:
126+
127+
``` text
128+
{{{logResult}}}
129+
```
130+
131+
Instead of updating these (outdated?) unit tests, you can choose to delete them and add integration tests instead. That would be great.
132+
133+
See [complete report here]({{status.target_url}}).
134+
set:
135+
id: report_ci
136+
value: nope
137+
138+
139+
100140
# Report specific error message if linting fails
101141
- filters:
102142
ensure:
@@ -164,7 +204,7 @@ rules:
164204
pull_request:
165205
mergeable: true
166206
status:
167-
context: "codecov/patch"
207+
context: "codecov/patch/integration"
168208
ensure:
169209
value: "{{status.state}}"
170210
equals: "success"
@@ -181,7 +221,7 @@ rules:
181221
pull_request:
182222
mergeable: true
183223
status:
184-
context: "codecov/patch"
224+
context: "codecov/patch/integration"
185225
ensure:
186226
value: "{{status.state}}"
187227
equals: "failure"
@@ -193,7 +233,7 @@ rules:
193233
pull_request:
194234
mergeable: true
195235
status:
196-
context: "codecov/patch"
236+
context: "codecov/patch/integration"
197237
ensure:
198238
value: "{{status.state}}"
199239
equals: "failure"

‎package.json‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "3.8.0",
3+
"version": "3.8.1",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
66
"dependencies": {
@@ -32,7 +32,6 @@
3232
"benchmark": "^2.1.1",
3333
"bundle-loader": "~0.5.0",
3434
"codacy-coverage": "^2.0.1",
35-
"codecov.io": "^0.1.2",
3635
"coffee-loader": "~0.7.1",
3736
"coffee-script": "^1.10.0",
3837
"coveralls": "^2.11.2",
@@ -57,6 +56,7 @@
5756
"raw-loader": "~0.5.0",
5857
"react": "^15.2.1",
5958
"react-dom": "^15.2.1",
59+
"rimraf": "^2.6.2",
6060
"script-loader": "~0.7.0",
6161
"should": "^11.1.1",
6262
"simple-git": "^1.65.0",
@@ -88,13 +88,17 @@
8888
"schemas/"
8989
],
9090
"scripts": {
91-
"test": "mocha test/*.test.js --max-old-space-size=4096 --harmony --trace-deprecation --check-leaks",
92-
"travis:test": "npm run cover:min",
91+
"test": "mocha test/*.test.js test/*.unittest.js --max-old-space-size=4096 --harmony --trace-deprecation --check-leaks",
92+
"test:integration": "mocha test/*.test.js --max-old-space-size=4096 --harmony --trace-deprecation --check-leaks",
93+
"test:unit": "mocha test/*.unittest.js --max-old-space-size=4096 --harmony --trace-deprecation --check-leaks",
94+
"travis:integration": "npm run cover:init && npm run cover:integration && npm run cover:report-min",
95+
"travis:unit": "npm run cover:init && npm run cover:unit && npm run cover:report-min",
9396
"travis:lint": "npm run lint-files && npm run nsp",
9497
"travis:benchmark": "npm run benchmark",
95-
"appveyor:test": "node node_modules\\mocha\\bin\\mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js",
98+
"appveyor:integration": "npm run cover:init && npm run cover:integration && npm run cover:report-min",
99+
"appveyor:unit": "npm run cover:init && npm run cover:unit && npm run cover:report-min",
96100
"appveyor:benchmark": "npm run benchmark",
97-
"circleci:test": "node node_modules/mocha/bin/mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js",
101+
"circleci:test": "node node_modules/mocha/bin/mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js test/*.unittest.js",
98102
"circleci:lint": "npm run lint-files && npm run nsp",
99103
"build:examples": "cd examples && node buildAll.js",
100104
"pretest": "npm run lint-files",
@@ -104,8 +108,13 @@
104108
"beautify-lint": "beautify-lint \"lib/**/*.js\" \"hot/**/*.js\" \"bin/**/*.js\" \"benchmark/*.js\" \"test/*.js\"",
105109
"nsp": "nsp check --output summary",
106110
"benchmark": "mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.benchmark.js -R spec",
107-
"cover": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha -- test/*.test.js",
108-
"cover:min": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' --report lcovonly node_modules/mocha/bin/_mocha -- test/*.test.js",
111+
"cover": "npm run cover:init && npm run cover:all && npm run cover:report",
112+
"cover:init": "rimraf coverage",
113+
"cover:all": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.test.js test/*.unittest.js",
114+
"cover:integration": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.test.js",
115+
"cover:unit": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover --report none node_modules/mocha/bin/_mocha -- test/*.unittest.js",
116+
"cover:report": "istanbul report",
117+
"cover:report-min": "istanbul report --report lcovonly",
109118
"publish-patch": "npm run lint && npm run beautify-lint && mocha && npm version patch && git push && git push --tags && npm publish"
110119
}
111120
}

‎schemas/webpackOptionsSchema.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,10 @@
969969
"type": "object",
970970
"additionalProperties": false,
971971
"properties": {
972+
"all": {
973+
"type": "boolean",
974+
"description": "fallback value for stats options when an option is not defined (has precedence over local webpack defaults)"
975+
},
972976
"context": {
973977
"type": "string",
974978
"description": "context directory for request shortening",
@@ -986,6 +990,14 @@
986990
"type": "boolean",
987991
"description": "add timing information"
988992
},
993+
"performance": {
994+
"type": "boolean",
995+
"description": "add performance hint flags"
996+
},
997+
"depth": {
998+
"type": "boolean",
999+
"description": "add module depth in module graph"
1000+
},
9891001
"assets": {
9901002
"type": "boolean",
9911003
"description": "add assets information"
@@ -1062,6 +1074,14 @@
10621074
"type": "boolean",
10631075
"description": "add the source code of modules"
10641076
},
1077+
"warnings": {
1078+
"type": "boolean",
1079+
"description": "add warnings"
1080+
},
1081+
"errors": {
1082+
"type": "boolean",
1083+
"description": "add errors"
1084+
},
10651085
"warningsFilter": {
10661086
"description": "Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions",
10671087
"$ref": "#/definitions/filter-types"

‎test/BinTestCases.test.js‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
const should = require("should");
55
const path = require("path");
66
const fs = require("fs");
7-
const spawn = require("child_process").spawn;
7+
const child_process = require("child_process");
8+
9+
function spawn(args, options) {
10+
if(process.env.running_under_istanbul) {
11+
args = [require.resolve("istanbul/lib/cli.js"), "cover", "--report", "none", "--print", "none", "--include-pid", "--dir", path.resolve("coverage"), "--", require.resolve("./helpers/exec-in-directory.js"), options.cwd].concat(args);
12+
options = Object.assign({}, options, {
13+
cwd: undefined
14+
});
15+
}
16+
return child_process.spawn(process.execPath, args, options);
17+
}
818

919
function loadOptsFile(optsPath) {
1020
// Options file parser from Mocha
@@ -73,7 +83,7 @@ describe("BinTestCases", function() {
7383
describe(testName, function() {
7484
it("should run successfully", function(done) {
7585
this.timeout(10000);
76-
const child = spawn(process.execPath, [cmd].concat(args), opts);
86+
const child = spawn([cmd].concat(args), opts);
7787

7888
child.on("close", function(code) {
7989
env.code = code;
@@ -100,15 +110,15 @@ describe("BinTestCases", function() {
100110
const stderr = convertToArrayOfLines(env.stderr);
101111
testAssertions(stdout, stderr, done);
102112
child.kill();
103-
}, 3000); // wait a little to get an output
113+
}, 8000); // wait a little to get an output
104114
});
105115
});
106116
} else {
107117
describe(testName, function() {
108118
before(function(done) {
109119
this.timeout(20000);
110120

111-
const child = spawn(process.execPath, [cmd].concat(args), opts);
121+
const child = spawn([cmd].concat(args), opts);
112122

113123
child.on("close", function(code) {
114124
env.code = code;

0 commit comments

Comments
 (0)