Skip to content

add TEZT_JOB_COUNT to control --job-count

Romain requested to merge romain-tezt-job-count into master

What

This MR makes it possible to specify the value of --job-count using environment variable TEZT_JOB_COUNT instead.

Why

#10 (closed)

How

By reading TEZT_JOB_COUNT and passing it to Clap as the default value of --job-count. This means that:

  • --help will show the value of TEZT_JOB_COUNT as the default value (if TEZT_JOB_COUNT is a positive integer)
  • --job-count has priority over TEZT_JOB_COUNT

Manually testing the MR

TEZT_JOB_COUNT=8 dune exec test/unix/main.exe -- -v

Observe that multiple tests are started before any ends.

TEZT_JOB_COUNT=8 dune exec test/unix/main.exe -- -v --job-count 1

Observe that --job-count has priority.

TEZT_JOB_COUNT=plop dune exec test/unix/main.exe -- --help | less -R

Observe that plop was ignored. You can also replace plop with a negative integer or 0 and see that those values are also ignored.

I didn't add a cram test because it would be a pain, I think.

Checklist

  • Update CHANGES.md. No need to document changes to documentation and tests.
  • Make sure all new values, types etc. are documented in .mli files and that the generated documentation looks ok.
  • Add tests in test/, if relevant.

Merge request reports