vmware / splinterdb

High Performance Embedded Key-Value Store
https://splinterdb.org
Apache License 2.0
680 stars 57 forks source link

Add initial support for message logging levels, used in unit-tests. #541

Closed gapisback closed 1 year ago

gapisback commented 1 year ago

This commit slightly adjusts the way output messages from C-unit-tests will be printed. Introduce initial set of message logging levels, initially scoped only for use in unit-tests.

For test cases that invoke print / diagnostic code, add support for VERBOSE=7, under which (voluminous) output will be generated. For CI-runs, which set env-var VERBOSE=1, this change will suppress generating large outputs which would otherwise (potentially) cause browsing of test output files to fail.

Default behaviour that unit-tests will print no messages remains. Existing env-var VERBOSE=1, we continue to only print error messages.


NOTE: This PR only partially address the issues raised under issue #534 .

Currently, the main requirement for getting this re-work into /main is to suppress large outputs coming out from splinter_test test_splinter_print_diags, which is one of the test cases exercising print diagnostic code.

There are a few more draft PRs in the pipeline which are adding more such test cases invoking print code. The outputs from those tests, when added to /main will further clog up the test output files in CI, making browsing difficult.

So, this PR lays down an interim solution, introducing nascent support for log-message levels, which can be 'controlled' by existing env-var VERBOSE.

This way, we now have a solution for print-diagnostics test cases even while retaining the desired behaviour that most unit-tests are silent except for specialize unit-tests (misc_test, limitations_test) which want to print outputs from error messages, for example.

netlify[bot] commented 1 year ago

Deploy Preview for splinterdb canceled.

Name Link
Latest commit 8035cc0e60b9ac3fa96973538f0c836f22aa18e8
Latest deploy log https://app.netlify.com/sites/splinterdb/deploys/63e3b598b2a0520008ab0e7d
gapisback commented 1 year ago

You are right, @rosenhouse -- A change I made in a hurry to limitations_test.c had regressed behaviour. It's fixed now w/ the latest upload.

gapisback commented 1 year ago

@rosenhouse -- I cleaned up the code / comments based on our discussion this morning. Have run some sanity tests to verify that the outputs are coming out 'as expected'. Just pushed a new commit.

Please take a final look and re-test to ensure that things are working as we expected / converged on.

rosenhouse commented 1 year ago

I have applied the CI config changes here to our Concourse server, so the new VERBOSE: 3 level should be used along with this code the next time CI is triggered.