You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our code does a lot of logging, which makes it really hard to quickly tell which test failed when looking at our test output. Is there a way ppx_inline_test could hide stdout unless a test fails?
I looked into implementing this myself with Runtime.am_running_inline_test, but I would also need a way to know when a test starts and stops, and also know whether it passed or failed.
(One option is to get rid of all output when tests are running, but then it's really difficult to debug failing tests)
I could also implement my own test runner, but it's not clear to me what I would need to do there since the built-in runner just calls Ppx_inline_test_lib.Runtime.exit ().
The text was updated successfully, but these errors were encountered:
We use it for some things, but I don't think we would want logging to show up in our expect tests.
Right now what we've done to work around this is:
We had some tests that really don't belong inline, so we moved them to non-inline tests
I created a wrapper function Logger.in_test that redirects output and re-prints it if a test fails. The main annoyance here is that we have to add it to the top of every test that could potentially log something
Ok. ppx_expect has special support for configuring the test harness. For instance we use that to write expectation tests using the Async library. This is done by tweaking the Expect_test_config module that's in scope:
moduleExpect_test_config=structincludeExpect_test_configlet run = ...
end
Our code does a lot of logging, which makes it really hard to quickly tell which test failed when looking at our test output. Is there a way ppx_inline_test could hide stdout unless a test fails?
I looked into implementing this myself with
Runtime.am_running_inline_test
, but I would also need a way to know when a test starts and stops, and also know whether it passed or failed.(One option is to get rid of all output when tests are running, but then it's really difficult to debug failing tests)
I could also implement my own test runner, but it's not clear to me what I would need to do there since the built-in runner just calls
Ppx_inline_test_lib.Runtime.exit ()
.The text was updated successfully, but these errors were encountered: