Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
6119289
test_runner: add initial code coverage support
cjihrig Dec 21, 2022
9b23309
doc,lib,src,test: rename --test-coverage
cjihrig Jan 8, 2023
bb14a2b
meta: move one or more collaborators to emeritus
nodejs-github-bot Feb 1, 2023
7e7e2d0
deps: update c-ares to 1.19.0
targos Feb 1, 2023
a66e7ca
test: add trailing commas in `test/internet`
aduh95 Feb 1, 2023
c7f29b2
test: add trailing commas in `test/known_issues`
aduh95 Feb 1, 2023
33a98c4
doc: update threat model based on discussions
mhdawson Jan 26, 2023
05ad792
async_hooks: remove experimental onPropagate option
jasnell Jan 27, 2023
b364b9b
benchmark: add trailing commas in `benchmark/fs`
aduh95 Feb 1, 2023
d556ccd
test: make more crypto tests work with BoringSSL
codebytere Feb 1, 2023
2c8c9f9
benchmark: add trailing commas in `benchmark/async_hooks`
aduh95 Feb 1, 2023
b31aabb
test_runner: top-level diagnostics not ommited when running with --test
pulkit-30 Feb 2, 2023
905a675
doc: add note about major release rotation
RafaelGSS Feb 2, 2023
b844a09
stream: dont access Object.prototype.type during TransformStream init
debadree25 Feb 2, 2023
31d3e3c
doc: fix -C flag usage
sxzz Feb 2, 2023
4cf4b41
stream: add suport for abort signal in finished() for webstreams
debadree25 Feb 2, 2023
c206853
stream: add pipeline() for webstreams
debadree25 Feb 2, 2023
c526f9f
test_runner: fix missing test diagnostics
MoLow Feb 2, 2023
51c6c61
tools: update ESLint custom rules to not use the deprecated format
aduh95 Feb 3, 2023
8b88d60
benchmark: add trailing commas in `benchmark/util`
aduh95 Feb 3, 2023
7760d40
benchmark: add trailing commas in `benchmark/net`
aduh95 Feb 3, 2023
897e3c2
benchmark: add trailing commas in `benchmark/module`
aduh95 Jan 30, 2023
0c2c322
doc: add deokjinkim to collaborators
deokjinkim Jan 31, 2023
aef57cd
doc: fix wrong location of `requestTimeout`'s default value
deokjinkim Feb 3, 2023
e77d538
src: allow embedder control of code generation policy
codebytere Feb 3, 2023
6cf860d
src: back snapshot I/O with a std::vector sink
joyeecheung Feb 3, 2023
faba8d4
test: add trailing commas in `test/js-native-api`
aduh95 Jan 25, 2023
a8a2d0e
src: add GetCurrentCipherName/Version to crypto_common
jasnell Dec 19, 2022
efc59d0
src: add KeyObjectHandle::HasInstance
jasnell Dec 19, 2022
95065c3
src: add additional utilities to crypto::SecureContext
jasnell Dec 19, 2022
6801d37
src: add snapshot support for embedder API
addaleax Dec 12, 2022
658d2f4
src: make build_snapshot a per-Isolate option, rather than a global one
addaleax Jan 24, 2023
683a1f8
src: allow snapshotting from the embedder API
addaleax Jan 24, 2023
731a7ae
async_hooks: add async local storage propagation benchmarks
legendecas Feb 3, 2023
17b3ee3
vm: properly support symbols on globals
dubzzz Feb 4, 2023
7f8b292
benchmark: add trailing commas in `benchmark/buffers`
aduh95 Feb 4, 2023
6c69ad6
benchmark: add trailing commas in `benchmark/misc`
aduh95 Feb 4, 2023
6bf7388
stream: allow transfer of readable byte streams
mrbbot Feb 4, 2023
6f24f06
timers: cleanup no-longer relevant TODOs in timers/promises
jasnell Feb 5, 2023
9d9b3f8
benchmark: add trailing commas in `benchmark/process`
aduh95 Feb 5, 2023
d6fbebd
url: remove unused `setURLConstructor` function
anonrig Feb 5, 2023
9a604d6
url: remove unused `URL::toObject`
anonrig Feb 5, 2023
129c9e7
url: remove unused `URL::ToFilePath()`
anonrig Feb 5, 2023
a7beac0
doc: enrich test command with executable
tony-go Feb 6, 2023
375bb22
doc: update test concurrency description / default values
richiemccoll Jan 31, 2023
00b81c7
src: replace icu with simdutf for char counts
anonrig Feb 2, 2023
f35f6d2
src: use simdutf utf8 to utf16 instead of icu
anonrig Feb 2, 2023
60c2a86
src: use string_view instead of std::string&
anonrig Feb 2, 2023
f72f643
src: remove unused includes from main thread
anonrig Feb 3, 2023
1a808a4
src: check return value of ftell()
tniessen Feb 6, 2023
3c5db8f
src: avoid leaking snapshot fp on error
tniessen Feb 6, 2023
17b82c8
meta: update AUTHORS
nodejs-github-bot Feb 6, 2023
c3325bf
src: make edge names in BaseObjects more descriptive in heap snapshots
joyeecheung Feb 6, 2023
89aa161
test: fix tap parser fails if a test logs a number
pulkit-30 Feb 6, 2023
7d6c27e
deps: add ada as a dependency
anonrig Jan 27, 2023
a51fe3c
url: replace url-parser with ada
anonrig Feb 6, 2023
c34bac2
src: allow blobs in addition to `FILE*`s in embedder snapshot API
addaleax Feb 6, 2023
148c5d9
tools: update lint-md-dependencies to rollup@3.13.0 vfile-reporter@7.0.5
nodejs-github-bot Feb 7, 2023
641e177
test: enable api-invalid-label.any.js in encoding WPTs
panva Feb 7, 2023
8590eb4
lib: add aborted() utility function
debadree25 Feb 7, 2023
cb9b9ad
meta: move one or more collaborators to emeritus
nodejs-github-bot Feb 8, 2023
d8c527f
http: use v8::Array::New() with a prebuilt vector
joyeecheung Feb 8, 2023
f91260b
stream: refactor to use `validateAbortSignal`
aduh95 Feb 8, 2023
35570e9
lib: tighten `AbortSignal.prototype.throwIfAborted` implementation
aduh95 Feb 8, 2023
da9ebaf
lib: predeclare Event.isTrusted prop descriptor
santigimeno Feb 8, 2023
31fb2e2
src: add fflush() to SnapshotData::ToFile()
addaleax Feb 8, 2023
7524871
benchmark: add trailing commas in `benchmark/http2`
aduh95 Feb 9, 2023
638d9b8
benchmark: add trailing commas in `benchmark/url`
aduh95 Feb 10, 2023
ff95eb7
benchmark: add trailing commas in `benchmark/crypto`
aduh95 Feb 10, 2023
c771d66
doc: fix test runner examples
richiemccoll Feb 10, 2023
c0983cf
deps: copy `postject-api.h` and `LICENSE` to the `deps` folder
RaisinTen Feb 9, 2023
4b89ec4
benchmark: add trailing commas in `benchmark/http`
aduh95 Feb 12, 2023
8ee9e48
tools: update doc to remark-html@15.0.2 to-vfile@7.2.4
nodejs-github-bot Feb 12, 2023
f87216b
tools: update lint-md-dependencies to rollup@3.15.0 to-vfile@7.2.4
nodejs-github-bot Feb 12, 2023
803f00a
tools: update eslint to 8.34.0
nodejs-github-bot Feb 12, 2023
217f2f6
test: add trailing commas in `test/pummel`
aduh95 Feb 12, 2023
7f2cdd3
http: add note about clientError event
ShogunPanda Feb 12, 2023
ffdd64d
doc: remove unused functions from example of `streamConsumers.text`
deokjinkim Feb 13, 2023
5d1a729
meta: update AUTHORS
nodejs-github-bot Feb 14, 2023
6b21170
benchmark: add trailing commas in `benchmark/path`
aduh95 Feb 14, 2023
aae0020
lib: enforce use of trailing commas for functions
aduh95 Feb 14, 2023
a0a6ee0
doc: add response.strictContentLength to documentation
marco-ippolito Feb 14, 2023
8b46c76
lib: enforce use of trailing commas in more files
aduh95 Feb 16, 2023
a740908
lib: delete module findPath unused params
sinkhaha Feb 17, 2023
633d3f2
stream: add abort signal for ReadableStream and WritableStream
debadree25 Feb 17, 2023
5b74811
test_runner: allow nesting test within describe
MoLow Feb 17, 2023
0f75633
test,crypto: update WebCryptoAPI WPT
panva Feb 8, 2023
e60d3f2
test: add WPTRunner support for variants and generating WPT reports
panva Feb 3, 2023
f62b58a
tools: add a daily wpt.fyi synchronized report upload
panva Feb 4, 2023
87df34a
tools: fix update-ada script
anonrig Feb 7, 2023
20cb13b
deps: update ada to v1.0.1
anonrig Feb 7, 2023
bdba600
src: remove icu usage from node_string.cc
anonrig Feb 17, 2023
b4deb2f
crypto: don't assume FIPS is disabled by default
mhdawson Feb 6, 2023
1cd22e7
tools: fix bug in `prefer-primordials` lint rule
aduh95 Feb 17, 2023
f390841
src: allow optional Isolate termination in node::Stop()
codebytere Feb 17, 2023
c4ca98e
test: cover publicExponent validation in OpenSSL
tniessen Feb 18, 2023
6a8b04d
doc: move bcoe to emeriti
Feb 18, 2023
2239e24
test: fix assertions in test-snapshot-dns-lookup*
tniessen Feb 18, 2023
164bfe8
src: add initial support for single executable applications
RaisinTen Feb 18, 2023
4aebee6
lib: do not crash using workers with disabled shared array buffers
BridgeAR Feb 18, 2023
a79a8bf
doc: add debadree25 to collaborators
debadree25 Feb 18, 2023
2ed3875
deps: update undici to 5.20.0
nodejs-github-bot Feb 18, 2023
6c99703
deps: update corepack to 0.16.0
nodejs-github-bot Feb 18, 2023
f192b83
esm: misc test refactors
GeoffreyBooth Feb 18, 2023
6ad01fd
test: fix `test-net-autoselectfamily` for kernel without IPv6 support
LiviaMedeiros Feb 18, 2023
6b64a94
stream: add trailing commas in stream source files
aduh95 Feb 18, 2023
7756438
stream: add trailing commas in webstream source files
aduh95 Feb 18, 2023
fa600fe
lib: add trailing commas in `internal/process`
aduh95 Feb 18, 2023
ddf5002
test_runner: parse non-ascii character correctly
mertcanaltin Feb 18, 2023
c781a48
build: do not disable inspector when intl is disabled
Trott Mar 30, 2021
e15ddba
build: add GitHub Action for coverage with --without-intl
Trott Mar 28, 2021
152a3c7
process: print versions by sort
himself65 Feb 18, 2023
60a6126
deps: upgrade npm to 9.5.0
npm-cli-bot Feb 18, 2023
00a428e
2023-02-21, Version 19.7.0 (Current)
MylesBorins Feb 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc,lib,src,test: rename --test-coverage
Add experimental to the name as requested during review.

PR-URL: #46017
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
  • Loading branch information
cjihrig authored and MylesBorins committed Feb 18, 2023
commit 9b23309f536e5c140048b533ae6bb9b4cc65c7dc
22 changes: 11 additions & 11 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,17 @@ added: v19.0.0

Use this flag to enable [ShadowRealm][] support.

### `--experimental-test-coverage`

<!-- YAML
added: REPLACEME
-->

When used in conjunction with the `node:test` module, a code coverage report is
generated as part of the test runner output. If no tests are run, a coverage
report is not generated. See the documentation on
[collecting code coverage from tests][] for more details.

### `--experimental-vm-modules`

<!-- YAML
Expand Down Expand Up @@ -1228,17 +1239,6 @@ Starts the Node.js command line test runner. This flag cannot be combined with
See the documentation on [running tests from the command line][]
for more details.

### `--test-coverage`

<!-- YAML
added: REPLACEME
-->

When used in conjunction with the `node:test` module, a code coverage report is
generated as part of the test runner output. If no tests are run, a coverage
report is not generated. See the documentation on
[collecting code coverage from tests][] for more details.

### `--test-name-pattern`

<!-- YAML
Expand Down
20 changes: 11 additions & 9 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,14 @@ internally.

## Collecting code coverage

When Node.js is started with the [`--test-coverage`][] command-line flag, code
coverage is collected and statistics are reported once all tests have completed.
If the [`NODE_V8_COVERAGE`][] environment variable is used to specify a
code coverage directory, the generated V8 coverage files are written to that
directory. Node.js core modules and files within `node_modules/` directories
are not included in the coverage report. If coverage is enabled, the coverage
report is sent to any [test reporters][] via the `'test:coverage'` event.
When Node.js is started with the [`--experimental-test-coverage`][]
command-line flag, code coverage is collected and statistics are reported once
all tests have completed. If the [`NODE_V8_COVERAGE`][] environment variable is
used to specify a code coverage directory, the generated V8 coverage files are
written to that directory. Node.js core modules and files within
`node_modules/` directories are not included in the coverage report. If
coverage is enabled, the coverage report is sent to any [test reporters][] via
the `'test:coverage'` event.

Coverage can be disabled on a series of lines using the following
comment syntax:
Expand Down Expand Up @@ -411,7 +412,8 @@ which will be addressed in a future Node.js release:

* Although coverage data is collected for child processes, this information is
not included in the coverage report. Because the command line test runner uses
child processes to execute test files, it cannot be used with `--test-coverage`.
child processes to execute test files, it cannot be used with
`--experimental-test-coverage`.
* Source maps are not supported.
* Excluding specific files or directories from the coverage report is not
supported.
Expand Down Expand Up @@ -1678,8 +1680,8 @@ added:
aborted.

[TAP]: https://testanything.org/
[`--experimental-test-coverage`]: cli.md#--experimental-test-coverage
[`--import`]: cli.md#--importmodule
[`--test-coverage`]: cli.md#--test-coverage
[`--test-name-pattern`]: cli.md#--test-name-pattern
[`--test-only`]: cli.md#--test-only
[`--test-reporter-destination`]: cli.md#--test-reporter-destination
Expand Down
6 changes: 3 additions & 3 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ Use the specified file as a security policy.
.It Fl -experimental-shadow-realm
Use this flag to enable ShadowRealm support.
.
.It Fl -experimental-test-coverage
Enable code coverage in the test runner.
.
.It Fl -no-experimental-fetch
Disable experimental support for the Fetch API.
.
Expand Down Expand Up @@ -391,9 +394,6 @@ Specify the minimum allocation from the OpenSSL secure heap. The default is 2. T
.It Fl -test
Starts the Node.js command line test runner.
.
.It Fl -test-coverage
Enable code coverage in the test runner.
.
.It Fl -test-name-pattern
A regular expression that configures the test runner to only execute tests
whose name matches the provided pattern.
Expand Down
6 changes: 4 additions & 2 deletions lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ function setupCodeCoverage() {
// Resolve the coverage directory to an absolute path, and
// overwrite process.env so that the original path gets passed
// to child processes even when they switch cwd. Don't do anything if the
// --test-coverage flag is present, as the test runner will handle coverage.
if (process.env.NODE_V8_COVERAGE && !getOptionValue('--test-coverage')) {
// --experimental-test-coverage flag is present, as the test runner will
// handle coverage.
if (process.env.NODE_V8_COVERAGE &&
!getOptionValue('--experimental-test-coverage')) {
process.env.NODE_V8_COVERAGE =
setupCoverageHooks(process.env.NODE_V8_COVERAGE);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/test_runner/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function createProcessEventHandler(eventName, rootTest) {
}

function configureCoverage(rootTest) {
if (!getOptionValue('--test-coverage')) {
if (!getOptionValue('--experimental-test-coverage')) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const {
exitCodes: { kGenericUserError },
} = internalBinding('errors');

const kFilterArgs = ['--test', '--test-coverage', '--watch'];
const kFilterArgs = ['--test', '--experimental-test-coverage', '--watch'];
const kFilterArgValues = ['--test-reporter', '--test-reporter-destination'];

// TODO(cjihrig): Replace this with recursive readdir once it lands.
Expand Down
5 changes: 3 additions & 2 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors,
if (test_runner_coverage) {
// TODO(cjihrig): This restriction can be removed once multi-process
// code coverage is supported.
errors->push_back("--test-coverage cannot be used with --test");
errors->push_back(
"--experimental-test-coverage cannot be used with --test");
}

if (syntax_check_only) {
Expand Down Expand Up @@ -555,7 +556,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
AddOption("--test",
"launch test runner on startup",
&EnvironmentOptions::test_runner);
AddOption("--test-coverage",
AddOption("--experimental-test-coverage",
"enable code coverage in the test runner",
&EnvironmentOptions::test_runner_coverage);
AddOption("--test-name-pattern",
Expand Down
14 changes: 8 additions & 6 deletions test/parallel/test-runner-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ function getCoverageFixtureReport() {
return report;
}

test('--test-coverage and --test cannot be combined', () => {
test('--experimental-test-coverage and --test cannot be combined', () => {
// TODO(cjihrig): This test can be removed once multi-process code coverage
// is supported.
const result = spawnSync(process.execPath, ['--test', '--test-coverage']);
const args = ['--test', '--experimental-test-coverage'];
const result = spawnSync(process.execPath, args);

// 9 is the documented exit code for an invalid CLI argument.
assert.strictEqual(result.status, 9);
assert.match(
result.stderr.toString(), /--test-coverage cannot be used with --test/
result.stderr.toString(),
/--experimental-test-coverage cannot be used with --test/
);
});

Expand All @@ -55,7 +57,7 @@ test('handles the inspector not being available', (t) => {
}

const fixture = fixtures.path('test-runner', 'coverage.js');
const args = ['--test-coverage', fixture];
const args = ['--experimental-test-coverage', fixture];
const result = spawnSync(process.execPath, args);

assert(!result.stdout.toString().includes('# start of coverage report'));
Expand All @@ -70,7 +72,7 @@ test('coverage is reported and dumped to NODE_V8_COVERAGE if present', (t) => {
}

const fixture = fixtures.path('test-runner', 'coverage.js');
const args = ['--test-coverage', fixture];
const args = ['--experimental-test-coverage', fixture];
const options = { env: { ...process.env, NODE_V8_COVERAGE: tmpdir.path } };
const result = spawnSync(process.execPath, args, options);
const report = getCoverageFixtureReport();
Expand All @@ -87,7 +89,7 @@ test('coverage is reported without NODE_V8_COVERAGE present', (t) => {
}

const fixture = fixtures.path('test-runner', 'coverage.js');
const args = ['--test-coverage', fixture];
const args = ['--experimental-test-coverage', fixture];
const result = spawnSync(process.execPath, args);
const report = getCoverageFixtureReport();

Expand Down