You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a touchy subject that can lead to bugs as already stated in the code comment below and in #2702.
I would propose some kind of escape hatch for library authors where we can remove the filtering entirely. Using a specific env variable for example.
Expose an option directly in vitest config, to specify the flags to be passed to the workers.
Additional context
I am working on adding first class vitest support to CodSpeed, I started the work at CodSpeedHQ/codspeed-node#26. In order to have automated flame graphs with each benchmark, we need to pass a few additional v8 args to the workers.
I managed to get it working with a patch of vitest removing the filtering.
However, I tested it with the default pool: 'threads' and got an error because one of the flags was not supported, highlighting that allowing all flags for every pool method is definitely not the way to go.
I would gladly do a PR if and when we agree on what API to expose 😃
Clear and concise description of the problem
I need to pass execution flags to the workers to fully support
vitest
on CodSpeed (more details below). At this time, execution flags are all filtered out except--cpu-prof
and--heap-prof
.The flags are described here: https://github.com/CodSpeedHQ/codspeed-node/blob/707a076f6178125fa1042f4a4decd51d11b03b56/packages/core/src/introspection.ts#L5-L21
Suggested solution
It is a touchy subject that can lead to bugs as already stated in the code comment below and in #2702.
I would propose some kind of escape hatch for library authors where we can remove the filtering entirely. Using a specific env variable for example.
The change would need to be done in
vitest/packages/vitest/src/node/pool.ts
Lines 63 to 67 in 29299f3
Alternative
Expose an option directly in
vitest
config, to specify the flags to be passed to the workers.Additional context
I am working on adding first class
vitest
support to CodSpeed, I started the work at CodSpeedHQ/codspeed-node#26. In order to have automated flame graphs with each benchmark, we need to pass a few additional v8 args to the workers.I managed to get it working with a patch of
vitest
removing the filtering.With
pool: 'forks'
, all the flags needed by CodSpeed are working, as this job is working https://github.com/CodSpeedHQ/codspeed-node/actions/runs/6668657521/job/18124687199.However, I tested it with the default
pool: 'threads'
and got an error because one of the flags was not supported, highlighting that allowing all flags for every pool method is definitely not the way to go.I would gladly do a PR if and when we agree on what API to expose 😃
Validations
The text was updated successfully, but these errors were encountered: