Draft: WASM/Test: improve testing with kernels (POC)
Context
This is a proof of concept to improve kernel facilities when testing in lib_scoru_wasm (following comments from @ovidiudeac (!6428 (comment 1116461979), !6428 (comment 1116461986)) and @lthms (!6428 (comment 1116311722))
It improves the testing in two parts:
- kernels are no longer filename but directly a lazily read kernel. I've made the choice to make it lazy to avoid reading ALL the kernels at the startup of the tests, but still read them only once (especially
unreachable
that is used extensively). - instrument
test_with_kernel
to actually return an Alcotest test. Instead of a plain string for the test name, it takes a format of type(string -> string, unit, string) format
to print the used kernel nicely, for example:"Testing %s kernel before being stuck"
.
Manually testing the MR
dune exec src/lib_scoru_wasm/test/test_scoru_wasm.exe
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