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

build: do not build with code cache for core coverage collection #54633

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Aug 29, 2024

Disable code cache for built-ins when are building Node.js to collect test coverage of built-ins, as code caching makes the V8 coverage collection less precises (specifically, all the functions deserialized from the code cache will not have block-level coverage data).

Data from local testing:

Before:

% Stmts % Branch % Funcs % Lines
95.58 94.43 95.19 95.58

After:

% Stmts % Branch % Funcs % Lines
95.93 94.77 96.03 95.93

Disable code cache for built-ins when are building Node.js to
collect test coverage of built-ins, as code caching makes the
V8 coverage collection less precises (specifically, all the
functions deserialized from the code cache will not have
block-level coverage data).

Data from local testing:

Before:

---------|----------|---------|---------
 % Stmts | % Branch | % Funcs | % Lines
---------|----------|---------|---------
   95.58 |    94.43 |   95.19 |   95.58
---------|----------|---------|---------

After:

---------|----------|---------|---------
 % Stmts | % Branch | % Funcs | % Lines
---------|----------|---------|---------
   95.93 |    94.77 |   96.03 |   95.93
---------|----------|---------|---------
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. labels Aug 29, 2024
@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 29, 2024
@RedYetiDev RedYetiDev added the coverage Issues and PRs related to native coverage support. label Aug 29, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 29, 2024
@nodejs-github-bot
Copy link
Collaborator

@daeyeon
Copy link
Member

daeyeon commented Aug 31, 2024

We're guiding to use make coverage-run-js to run just the JS tests. Should we also consider suggesting using a node build with code cache disabled for this?

node/BUILDING.md

Lines 398 to 404 in 4c844a2

If you only want to run the JavaScript tests then you do not need to run
the first command (`./configure --coverage`). Run `make coverage-run-js`,
to execute JavaScript tests independently of the C++ test suite:
```bash
make coverage-run-js
```

@joyeecheung
Copy link
Member Author

Should we also consider suggesting using a node build with code cache disabled for this?

That document already suggests to build it with ./configure --coverage

@daeyeon
Copy link
Member

daeyeon commented Sep 1, 2024

The document seems to indicate that if one only focuses on improving JavaScript builtins coverage, there's no need to build with ./configure --coverage. I might be misunderstanding this, though. In any case, this isn't a blocker.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2024
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Sep 5, 2024

@jasnell jasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 7, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 7, 2024
@nodejs-github-bot nodejs-github-bot merged commit 3d410f8 into nodejs:main Sep 7, 2024
66 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3d410f8

aduh95 pushed a commit that referenced this pull request Sep 12, 2024
Disable code cache for built-ins when are building Node.js to
collect test coverage of built-ins, as code caching makes the
V8 coverage collection less precises (specifically, all the
functions deserialized from the code cache will not have
block-level coverage data).

Data from local testing:

Before:

---------|----------|---------|---------
 % Stmts | % Branch | % Funcs | % Lines
---------|----------|---------|---------
   95.58 |    94.43 |   95.19 |   95.58
---------|----------|---------|---------

After:

---------|----------|---------|---------
 % Stmts | % Branch | % Funcs | % Lines
---------|----------|---------|---------
   95.93 |    94.77 |   96.03 |   95.93
---------|----------|---------|---------

PR-URL: #54633
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. coverage Issues and PRs related to native coverage support. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants