Skip to content

Commit e862eec

Browse files
joyeecheungtargos
authored andcommittedOct 2, 2024
build: do not build with code cache for core coverage collection
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>
1 parent f5c65d0 commit e862eec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎configure.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,9 @@ def configure_node(o):
13891389
o['variables']['node_use_node_snapshot'] = b(
13901390
not cross_compiling and not options.shared)
13911391

1392-
if options.without_node_code_cache or options.without_node_snapshot or options.node_builtin_modules_path:
1392+
# Do not use code cache when Node.js is built for collecting coverage of itself, this allows more
1393+
# precise coverage for the JS built-ins.
1394+
if options.without_node_code_cache or options.without_node_snapshot or options.node_builtin_modules_path or options.coverage:
13931395
o['variables']['node_use_node_code_cache'] = 'false'
13941396
else:
13951397
# TODO(refack): fix this when implementing embedded code-cache when cross-compiling.

0 commit comments

Comments
 (0)
Please sign in to comment.