Skip to content

test: make test-os-checked-function work without test harness

Rodrigo Muino Tomonari requested to merge github/fork/Trott/test-improve-2 into master

First commit:

test: delay loading 'os' in test/common module

There is a test that doesn't load the common module initially because it
needs to monkey-patch the 'os' module. I think it would be a good idea
to minimize the side-effects of loading common anyway, so let's defer
loading 'os' unless/until it's actually needed.

Second commit:

test: make test-os-checked-function work without test harness

Most tests in `test/parallel` work when invoked with `node` rather than
`tools/test.py` but not test-os-checked-function because it doesn't load
the `common` module initially, which means it won't get re-spawned with
the necessary flags (in the Flags: comment, in this case
--expose_internals). Now that common delays loading 'os' until it needs
to load it, this test can load the common module and it will work from
the command line without the test harness. Additionally, we now can
remove a comment disabling a lint rule.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading