Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve testing with stats and errors per test section
* TestRunner: separated the running of each "section" of a test into its own try-catch so that we can evaluate each section separately even if another section failed (e.g. evaluate all examples even if one test in "facts" throws an exception). I've added tests that exercise this "new feature". * TestResults: refactored it a bit so that TestResults now has the three sections and the old TestResults becomes TestSectionResults. Also, TestSectionResults now has only *one* error, since that's what we get when there's an exception evaluating the Pkl code. * SimpleReport: * Separated reporting of each test section so that it's easy to see which facts or which examples fail. * Added a "stats line" to the module and section levels that reports how many tests / assertions pass/fail. Note that, when reporting errors, there's no stats for the section since the error is all the info we get. Similarly, when examples fail, there's no stats because each example is converted into its own test so there are no failed assertions to report, it's all-or-nothing. * For the examples converted to tests, when multiple examples share the same name I've also added a counter ("# 1" and so on) so that it's easier to identify which one is failing. * JUnitReport: fixed the reporting of failures as it wasn't consistent with "tests": the tests were the number of tests that we run but "failures" were the number of assertions that failed.
- Loading branch information