24544 Commits

Author SHA1 Message Date
Ouyang Yadong
616125c8b1 doc: add oyyd to collaborators
PR-URL: https://github.com/nodejs/node/pull/24300
Fixes: https://github.com/nodejs/node/issues/23955
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-11-11 18:33:29 +08:00
Ulises Santana Suárez
e201c305f0 test: fix arguments order in assert.strictEqual()
PR-URL: https://github.com/nodejs/node/pull/24192
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-11 15:22:17 +05:30
John Mc Quillan
5ad4c44e90 test: fix assert.strictEqual argument order
The arguments to assert.strictEqual in a number of calls were in the
wrong order. It is preferred that literal values are in the second
argument.

Updates test/parallel/test-fs-readStream.js

PR-URL: https://github.com/nodejs/node/pull/24172
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-11 14:41:41 +05:30
Marie Terrier
5e52e27a76 test : compare objects not identical by reference
PR-URL: https://github.com/nodejs/node/pull/24189
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-11 14:36:57 +05:30
Daniel Bevenius
faa584ab22 test: fix v8 Set/Get compiler warnings
PR-URL: https://github.com/nodejs/node/pull/24246
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-11 08:02:30 +01:00
Daniel Bevenius
344d33eef1 src: fix v8 compiler warnings in src
This commit changes the code to use the maybe version.

PR-URL: https://github.com/nodejs/node/pull/24246
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-11 08:02:30 +01:00
Richard Lau
19e5e78e9c build: lint commit message in separate Travis job
Move the first commit message linting to a separate Travis job. Run the
script in bash debug mode to capture any issues communicating with the
GitHub API (e.g. network issues, rate limits).

PR-URL: https://github.com/nodejs/node/pull/24254
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
2018-11-10 23:00:34 -08:00
Rich Trott
b5420c9577 test: move benchmark tests out of main test suite
Move benchmark tests (which are slow) out of the main test suite. We can
hopefully add them to node-daily-master so that they are still run daily
on CI.

PR-URL: https://github.com/nodejs/node/pull/24265
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10 22:44:26 -08:00
saurabhSiddhu
1e0005eac9 test: replacing fixture directory with temp
PR-URL: https://github.com/nodejs/node/pull/24077
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10 21:42:54 -08:00
Fedor Indutny
d4654d89be deps: introduce llhttp
llhttp is modern, written in human-readable TypeScript, verifiable, and
is very easy to maintain.

See: https://github.com/indutny/llhttp

PR-URL: https://github.com/nodejs/node/pull/24059
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-11-10 17:54:21 -05:00
Anna Henningsen
d3f02d0da3
stream: make .destroy() interact better with write queue
Make sure that it is safe to call the callback for `_write()`
even in the presence of `.destroy()` calls during that write.

In particular, letting the write queue continue processing would
previously have thrown an exception, because processing writes
after calling `.destroy()` is forbidden.

One test had to be modified to account for the fact that callbacks
for writes will now always be called, even when the stream
is destroyed during the process.

PR-URL: https://github.com/nodejs/node/pull/24062
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10 21:54:48 +01:00
Anna Henningsen
fb6c6692a8
net: partially revert "simplify Socket.prototype._final"
Partially revert b7e6ccd0cc60f20cc397e6ac0705bb3f38c7d225
because it broke a test that was added since its last CI run.

Refs: https://github.com/nodejs/node/pull/24075
Refs: https://github.com/nodejs/node/pull/23866

PR-URL: https://github.com/nodejs/node/pull/24288
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-11-10 21:54:15 +01:00
Berry de Witte
f77bb3cb00
test: increase coverage internal readline
PR-URL: https://github.com/nodejs/node/pull/24150
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10 19:44:13 +01:00
Anna Henningsen
b7e6ccd0cc
net: simplify Socket.prototype._final
Remove conditions that should be irrelevant since we started
using `_final`, as well as an extra `defaultTriggerAsyncIdScope()`
call which is unnecessary because there is an equivalent
scope already present on the native side.

PR-URL: https://github.com/nodejs/node/pull/24075
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-10 19:36:08 +01:00
Daniel Bevenius
9c6b7f7b1d
test: use NULL instead of 0 in common.h
This commit updates the macros in test/addons-napi/common.h to use NULL
instead of 0. This is very minor, but I had to look twice while going
through the code and finding what the macro was doing and comparing
with the struct definition. Using NULL makes it a little clearer I
think.

PR-URL: https://github.com/nodejs/node/pull/24104
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-09 16:15:51 -08:00
Refael Ackermann
d0e593e11e
build,tools: update make-v8.sh for s390x
PR-URL: https://github.com/nodejs/node/pull/23839
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-09 16:13:46 -08:00
Marcus Scott
e492f92ec5
test: move test-fs-watch-system-limit from sequential to pummel
PR-URL: https://github.com/nodejs/node/pull/23692
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-11-09 16:11:51 -08:00
Rich Trott
c17fef7ffb doc: edit BUILDING.md
Minor edits to BUILDING.md to keep sentences short and clear.

PR-URL: https://github.com/nodejs/node/pull/24243
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-10 08:53:13 -08:00
ivan.filenko
53d424a328 test: fix uses of deprecated assert.fail with multiple args
PR-URL: https://github.com/nodejs/node/pull/23673
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-10 11:45:41 -05:00
ivan.filenko
936ac681b2 test: use assert.strictEqual instead of assert.equal
PR-URL: https://github.com/nodejs/node/pull/23673
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-11-10 11:45:20 -05:00
Paul Isache
04ccc98de6
lib: combine contructor, tag, Object into a function
combine these parts into a function to be used in multiple parts

PR-URL: https://github.com/nodejs/node/pull/24171
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-10 17:12:42 +01:00
Nikita Malyschkin
8793e0de1d
test: add test for strictDeepEqual
PR-URL: https://github.com/nodejs/node/pull/24197
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-10 17:10:01 +01:00
Amer Alimanović
0f8d7a684f test: add coverage for systemerror set name
PR-URL: https://github.com/nodejs/node/pull/24200
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-10 19:11:18 +05:30
Alex Seifert
ef907bb4d9 test: fix order of arguments in assert.strictEqual
PR-URL: https://github.com/nodejs/node/pull/24145
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-10 19:07:01 +05:30
Grant Carthew
85f7af77ee doc: fix code examples in stream.md
* Replace `console.error()` with `console.log()`.
* Fix case and punctuation in logged output.

PR-URL: https://github.com/nodejs/node/pull/24112
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-11-10 14:00:17 +02:00
Anna Henningsen
71a4cb7d46
tracing: fix static destruction order issue
Sometimes, the `parallel/test-tracing-no-crash` would not work as
expected, at least on Windows, because there is a static destruction
race between tearing down the `NodeTraceWriter` instance and the
per-process options struct. If the per-process options were destroyed
before the `NodeTraceWriter`, the reference to the tracing filename
would be gone before opening the file was attempted.

This can be solved by creating a copy of the string when creating the
`NodeTraceWriter` instance rather than taking a reference.

Fixes: https://github.com/nodejs/node/issues/22523

PR-URL: https://github.com/nodejs/node/pull/24123
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-11-10 12:07:43 +01:00
razvanbh
f8c3e258fd test: add test for 'ERR_INVALID_CALLBACK'
PR-URL: https://github.com/nodejs/node/pull/24224
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-10 14:01:03 +05:30
Artur Daschevici
b88195716f test: add coverage for escape key switch case
PR-URL: https://github.com/nodejs/node/pull/24194
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-10 13:51:55 +05:30
Daniel Bevenius
d58a0c6285 test: fix NewFromUtf8 compiler warning
Currently there are a number of compiler warnings like the following:

../binding.cc:6:41:
warning: 'NewFromUtf8' is deprecated:
Use maybe version [-Wdeprecated-declarations]
  args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
                                        ^
/node/deps/v8/include/v8.h:2883:10:
note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATE_SOON(
         ^
/node/deps/v8/include/v8config.h:341:29:
note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^

This commit updates the code to use the maybe versions.

PR-URL: https://github.com/nodejs/node/pull/24216
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 21:26:31 -08:00
Paul Isache
a67e0a6fd2 test: change arguments order in strictEqual
Fix actual/expected ordering in test-net-eaddrinuse.

PR-URL: https://github.com/nodejs/node/pull/24156
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-09 21:15:26 -08:00
Jonah Polack
850cb5492d test: switch order of strictEqual arguments
PR-URL: https://github.com/nodejs/node/pull/24185
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-09 20:54:12 -08:00
Sam Roberts
3833d69936 doc: fix some inconsistent use of hostname
host names are DNS names, host addresses are IP addresses, and `host`
arguments and options can be either.

PR-URL: https://github.com/nodejs/node/pull/24199
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 20:50:02 -08:00
mzucker
6727f1c787 test: fix the arguments order in assert.strictEqual
This change was initiated from the NodeConfEU session.

PR-URL: https://github.com/nodejs/node/pull/24227
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 20:46:57 -08:00
mzucker
87d0aa8686 test: fix the arguments order in assert.strictEqual
This change was initiated from the NodeConfEU session.

PR-URL: https://github.com/nodejs/node/pull/24226
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 20:44:26 -08:00
Kevin Seidel
aba0c945eb test: fix order in assert.strictEqual to actual, expected
PR-URL: https://github.com/nodejs/node/pull/24184
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-11-09 20:41:29 -08:00
szabolcsit
2672582043 test: fix arguments order in assert.strictEqual
In the test test/parallel/test-http-client-upload.js test the
actual and expected arguments in assert.strictEqual() calls
were in the wrong order. Switched them around so the returned
value by the function is the first argument and the literal
value is the second argument.

PR-URL: https://github.com/nodejs/node/pull/24143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-11-10 09:46:09 +05:30
Sam Roberts
3b4159c8ed tls: remove unused arg to createSecureContext()
The context arg is unused by node or its test suites and undocumented.
Remove it.

PR-URL: https://github.com/nodejs/node/pull/24241
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 18:28:07 -08:00
Sam Roberts
624a242b05 test: simplify regression test for SEGV
Test was introduced in 08a5b442e4 as a regression test, and has evolved
since then. Simplify the test so that it doesn't rely on an undocumented
argument to tls.createSecureCredentials().

See: https://github.com/nodejs/node-v0.x-archive/issues/6690

Confirmation that this reworked test triggers the original bug:

	%) % node
	> process.version
	'v0.10.48'
	> credentials = crypto.createCredentials()
	{ context: {} }
	> context = credentials.context
	{}
	> notcontext = { setOptions: context.setOptions }
	{ setOptions: [Function: setOptions] }
	> notcontext.setOptions()
	node: ../src/node_object_wrap.h:61: static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>) [with T = node::crypto::SecureContext]: Assertion `handle->InternalFieldCount() > 0' failed.
	zsh: abort (core dumped)  node

PR-URL: https://github.com/nodejs/node/pull/24241
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 18:28:05 -08:00
Manish Poddar
3ffc84a46d test: fix assert argument order
PR-URL: https://github.com/nodejs/node/pull/24160
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-09 17:01:17 -08:00
alyssaq
08bd8233be src: reuse std::make_unique
Ref: 283a967e35

PR-URL: https://github.com/nodejs/node/pull/24132
Refs: 283a967e35
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
2018-11-09 16:58:40 -08:00
Sam Roberts
27cdb36b10 doc: describe what tls servername is for
Docs should describe the purpose of the option.

PR-URL: https://github.com/nodejs/node/pull/24236
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 16:22:18 -08:00
Sam Roberts
426ca0837a doc: clarify allowed encoding parameter types
This fixes the incorrect enumerations of their possible values, which
weren't up to date with the values actually supported. Also renamed
two arguments that used "format" when they meant "encoding".

PR-URL: https://github.com/nodejs/node/pull/24230
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-11-09 15:57:17 -08:00
Joyee Cheung
1698fc96af benchmark: support more options in startup benchmark
1. Add options to benchmark the startup performance of a node
  "instance" after running a script. By default there are two options:
  `test/fixtures/semicolon` which is basically an empty file,
  and `benchmark/fixtures/require-cachable` which require all
  the cachable modules before exiting. This allows us to measure
  the overhead of bootstrap in more scenarios.
2. Add options to benchmark the overhead of spinning
  node through a process and through a worker.

PR-URL: https://github.com/nodejs/node/pull/24220
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-11-09 15:55:19 -08:00
Joyee Cheung
5e1bf058f4 url: make the context non-enumerable
At the moment we expose the context as a normal property on the
prototype chain of URL or take them from the base URL
which makes them enumerable and considered
by assert libraries even though the context carries path-dependent
information that do not affect the equivalence of these objects.
This patch fixes it in a minimal manner by marking the context
non-enumerable as making it full private would require more
refactoring and can be done in a bigger patch later.

PR-URL: https://github.com/nodejs/node/pull/24218
Refs: https://github.com/nodejs/node/issues/24211
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09 15:53:32 -08:00
Mark Arranz
457cde3167 test: add error code tests in dgram test
Improve error validation in test-dgram-send-bad-arguments.

PR-URL: https://github.com/nodejs/node/pull/24215
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-11-09 15:48:11 -08:00
reineke-fox
8884a98ac0 test: fix order of arguments in test-delayed-require assertion
Fix order of arguments in equality assertion in
test-delayed-require.

PR-URL: https://github.com/nodejs/node/pull/24165
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-11-09 05:43:16 -08:00
Rich Trott
a4a2e9f737 test: fix flaky test-vm-timeout-escape-nexttick
Increase the VM timeout. If it is too small, the VM does not exit before
the code has a chance to create the problematic condition that causes
the timeout to be ignored.

Fixes: https://github.com/nodejs/node/issues/24120

PR-URL: https://github.com/nodejs/node/pull/24251
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-11-09 04:50:14 -08:00
Joyee Cheung
22f3ff9617
doc: remove legacy WPT integration guide
Point to the new guide in test/wpt/README.md instead.

PR-URL: https://github.com/nodejs/node/pull/24035
Refs: https://github.com/nodejs/node/issues/23192
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09 20:27:21 +08:00
Joyee Cheung
9858e331e3
test: initialize test/wpt to run URL and console .js tests
This patch:

- Creates a new test suite `wpt` that can be used to run a subset
  of Web Platform Tests
- Adds a `WPTRunner` in `test/common/wpt.js` that can run the WPT
  subset in `test/fixtures/wpt` with a vm and the WPT harness
  while taking the status file in `test/wpt/status` into account.
  Here we use a new format of status file (in JSON) to handle specific
  requirements (like ICU requirements) in the tests and to handle
  expected failures and TODOs.
- Adds documentation on how the runner and the update automation works
- Runs the WHATWG URL tests and the console tests with the new test
  runner.

With this patch we eliminates the need of copy-pasting with manual
modifications to update a large chunk of our WPT subset previously
maintained in `test/parallel`. Now the tests run in `test/wpt` can
be automatically updated with `git node wpt` without modifications
by the actual WPT harness instead of our home-grown mock.

There are still a few URL tests left that need to be migrated in the
upstream to be placed in .js instead of .html - we currently still use
the legacy harness mock in the test files.

PR-URL: https://github.com/nodejs/node/pull/24035
Refs: https://github.com/nodejs/node/issues/23192
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09 20:27:21 +08:00
Joyee Cheung
1357913180
test: use URL fixtures under test/fixtures/wpt/url/resources
Removes the following files:

- test/fixtures/url-tests.js
- test/fixtures/url-setter-tests.js
- test/fixtures/url-toascii.js

in favor of:

- test/fixtures/wpt/url/resources/urltestdata.json
- test/fixtures/wpt/url/resources/setters_tests.json
- test/fixtures/wpt/url/resources/toascii.json

Also removes dependency of `fixtures/url-tests.js` in http2 tests
and use `fixtures/person-large.jpg` instead since they are just
looking for a big enough file to transfer.

PR-URL: https://github.com/nodejs/node/pull/24035
Refs: https://github.com/nodejs/node/issues/23192
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-11-09 20:27:20 +08:00