Tezt: fail if ~uses does not exist
What
This MR adds a check in the Tezt wrapper to make tests fail early if the path of a ~uses
does not exist.
Why
Engineers who don't know that they have to compile, say, the risc V sandbox, would immediately know that they have to do, instead of getting weird errors during test execution. (The check does not ensure that your sandbox is up-to-date though.)
How
The check is added at the beginning of each test. An alternative that would fail even earlier was attempted here: !12554 (closed) and, while it worked, it was too hackish and would require deeper modifications to Tezt itself to make clean.
The behavior can be disabled / turned into warnings for specific Tezt executables with a configuration variable, like other checks from the Tezt wrapper.
Manually testing the MR
Remove tx_kernel.wasm
if it exists and run:
$ dune exec tezt/tests/main.exe -- kernel
qcheck random seed: 709274369
[14:05:58.577] TEST_SEED=571916481
[14:05:58.617] lib_bls12_381_polynomial random seed: 329128431
[14:05:58.649] consensus_rights_delay = 2 and preserved_cycles = 5
[14:05:58.696] Starting test: Paris: wasm_2_0_0 - tx kernel should run e2e (kernel_e2e)
[14:05:58.696] [error] In "tezt/tests/tx_sc_rollup.ml", test "Paris: wasm_2_0_0 - tx kernel should run e2e (kernel_e2e)" requires 'tx_kernel.wasm' which do(es) not exist.
[14:05:58.696] [FAILURE] (1/12, 1 failed) Paris: wasm_2_0_0 - tx kernel should run e2e (kernel_e2e)
[14:05:58.696] Try again with: _build/default/tezt/tests/main.exe --verbose --file tezt/tests/tx_sc_rollup.ml --title 'Paris: wasm_2_0_0 - tx kernel should run e2e (kernel_e2e)'
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR