Skip to content

test: allow passing args to executable

To set up CI jobs for https://github.com/nodejs/node/pull/5181 there has to be a way to pass an argument to the Node executable at test time. The makefile supports the TEST_CI_ARGS environment variable, but the test harness (test.py) provides no facility to further pass the argument to the executable under test.

There is a "--special-command" argument, but it is only able to suffix or prefix the existing command line in the format [node, test] so it is insufficient to produce commands in the form [node, node_args, test]. In this PR I've introduced an extra argument to the test harness called --node-args which can be used to pass commands verbatim.

Some support for this feature already existed in test/init.py in the form of the "additional" argument, however none of the individual test modules' testcfg.py make use of it, so in the interest of minimal footprint I've opted to directly set this value form test.py, instead of passing it through as a constructor argument.

There is an additional complication in "test-cluster-debug-port.js" which for reasons that are unclear refuses to run if any arguments are passed to the process. I've simply relaxed this requirement.

Merge request reports

Loading