For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configuration

Lightweight V8 Coverage Mode uses the regular slnodejs settings (token, build session ID, lab ID, project root, proxy), passed as flags of slnodejs run / slnodejs mocha or as preload script variables. See the Command Reference and Configuration.

The settings below are specific to this mode or behave differently in it. They have no flag: set them as environment variables of the slnodejs command or of the process started with the preload script. Names are case-sensitive.

Settings

Variable
Default
Effect

SL_useLeanCoverageListener

off

true turns this mode on for slnodejs run, slnodejs mocha and the preload script.

NODE_V8_COVERAGE

.sl-cov in the working directory

Folder where Node.js writes coverage files. Set it to use another folder, for example a writable volume in a read-only container. The folder is created when it does not exist.

SL_COVERAGE_INTERVAL

10000

Milliseconds between two coverage writes of your program. 0 or a value that is not a number means the default.

SL_footprintsSendIntervalSecs

10

Seconds between two sends of the coverage the listener has read.

SL_footprintsQueueSize

2

Number of coverage files with hits that triggers a send before SL_footprintsSendIntervalSecs elapses.

SL_enableChildProcessPatcher

not set

Not set: your program writes coverage every interval; its child processes write only when they exit. true: child processes also write every interval. false: neither writes at the interval; do not use it in this mode. See Child processes.

SL_projectRoot / --projectRoot

working directory

Root that file paths are resolved against. Files outside it are not reported. See TypeScript and compiled output.

SL_EXECUTION_CONTEXT_FILE

sl-execution.json in the coverage folder

slnodejs mocha only: the file through which the Mocha reporter tells the listener which test stage is running. Change it only if the coverage folder is not writable.

SL_IN_PROCESS_COVERAGE_COLLECTION

No effect with slnodejs run, slnodejs mocha or the preload script.

SL_footprintsCollectIntervalSecs

No effect in this mode; SL_COVERAGE_INTERVAL sets the collection interval.

Files in the node_modules folder of the project root, and files matched by a .slignore file in the working directory, are not reported.

Logging

Logging works as for the rest of slnodejs: NODE_DEBUG=sl (console) or sl-file (file), and SL_LOG_LEVEL. See Troubleshooting → Turn on logs.

With SL_LOG_LEVEL=debug, the listener also writes a copy of every coverage batch it processes to a .sl-cov-tmp folder in the working directory. Attach it when you contact SeaLights support, then turn debug logging off: the folder grows with every batch.

Last updated

Was this helpful?