I'm writing some fuzz tests with testthat, i.e., tests with random inputs. The purpose of this is to diversify the test set and try out edge cases. These tests succeed most of the time, but might occasionally fail, and in those cases I need to know what the input to the test was, so that I can refine the code (or test) to handle it properly.
Do I need a custom reporter to arrange this? Is extending CheckReporter a good or bad idea? Is there any documentation on writing reporters? (I can probably muddle through from the source, but pointers are always helpful!)
Thanks, but I only want to print the input on failure, otherwise the report will be very noisy, and surely only testthat’s internals know whether the test has failed? Is there a failure hook that I’ve missed?