Skip to content

Alcotezt 馃か: make lib_store/unix/test's output depend on Tezt log level

Arvid Jakobsson requested to merge arvid@alcotezt-shh--store into master

Context

Currently, lib_store/unix tests log wildly to stdout, creating noise in tezt logs.

This MR creates an Internal_event.SINK that logs through Tezt and that maps Internal_event log levels to Tezt log levels. Then I use it in lib_store.

Discussion

Not sure where to put tezt_sink.ml because I want to use it elsewhere :/ For now, put it with the test.

Manually testing the MR

dune exec src/lib_store/unix/test/main.exe -- -f src/lib_store/unix/test/test_store.ml --only 1 # no output
dune exec src/lib_store/unix/test/main.exe -- -f src/lib_store/unix/test/test_store.ml --only 1 --verbose # lots of output
dune exec src/lib_store/unix/test/main.exe -- -f src/lib_store/unix/test/test_store.ml --only 1 --log-file tezt.log # check that tezt.log contains the verbose output

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

Merge request reports