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

--experimental-test-coverage cannot be used with --test #47669

Closed
piranna opened this issue Apr 22, 2023 · 7 comments · Fixed by #47686
Closed

--experimental-test-coverage cannot be used with --test #47669

piranna opened this issue Apr 22, 2023 · 7 comments · Fixed by #47686
Labels
known limitation Issues that are identified as known limitations. test_runner Issues and PRs related to the test runner subsystem.

Comments

@piranna
Copy link
Contributor

piranna commented Apr 22, 2023

Version

v20.0.0

Platform

Linux executive 5.19.0-40-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 23 21:39:15 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

test

What steps will reproduce the bug?

Running node --test lookup for tests in the current project folder. When adding the --experimental-test-coverage flag I get the error node: --experimental-test-coverage cannot be used with --test, and if I remove the --test flag and left the --experimental-test-coverage flag alone, it throws me to a REPL without looking for the tests. Only way to run the tests with code coverage is by executing it explicitly with node --experimental-test-coverage test.js, passing test files as arguments.

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

When running node --experimental-test-coverage, it should implicitly call --test and look for the test files, or allow to have both --test and --experimental-test-coverage flags in the same command.

What do you see instead?

Error node: --experimental-test-coverage cannot be used with --test, or a REPL if I remove the --test flag.

Additional information

No response

@richardlau
Copy link
Member

#47651 mentions it is the first step towards addressing this.

@richardlau
Copy link
Member

This is a documented limitation which looks like it's being worked on.

node/doc/api/test.md

Lines 423 to 432 in 7b39e80

The test runner's code coverage functionality has the following limitations,
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
`--experimental-test-coverage`.
* Source maps are not supported.
* Excluding specific files or directories from the coverage report is not
supported.

@cjihrig
Copy link
Contributor

cjihrig commented Apr 22, 2023

FWIW, I should have a PR to address this soon - possibly in the next day or so.

@piranna
Copy link
Contributor Author

piranna commented Apr 22, 2023

#47651 mentions it is the first step towards addressing this.

Thanks for clarifying, subscribed to that PR.

@MoLow MoLow added known limitation Issues that are identified as known limitations. test_runner Issues and PRs related to the test runner subsystem. labels Apr 22, 2023
nodejs-github-bot pushed a commit that referenced this issue Apr 28, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: #47686
Fixes: #47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
yjl9903 pushed a commit to yjl9903/node that referenced this issue Apr 28, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: nodejs#47686
Fixes: nodejs#47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
yjl9903 pushed a commit to yjl9903/node that referenced this issue Apr 28, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: nodejs#47686
Fixes: nodejs#47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
yjl9903 pushed a commit to yjl9903/node that referenced this issue Apr 29, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: nodejs#47686
Fixes: nodejs#47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this issue May 2, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: #47686
Fixes: #47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos pushed a commit that referenced this issue May 3, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: #47686
Fixes: #47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@muturgan
Copy link

muturgan commented Jun 3, 2023

will it be added in version 18?

@piranna
Copy link
Contributor Author

piranna commented Jun 3, 2023

will it be added in version 18?

It's already included.

danielleadams pushed a commit that referenced this issue Jul 6, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: #47686
Fixes: #47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this issue Jul 6, 2023
This commit adds support for combining code coverage reports
in the test runner. This allows coverage to be collected for
child processes, and by extension, the test runner CLI.

PR-URL: nodejs#47686
Fixes: nodejs#47669
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@ccucui
Copy link

ccucui commented Jul 7, 2023

Hi guys, any release date of the fix for v18?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known limitation Issues that are identified as known limitations. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants