Repository navigation
Report unchecked tests and count runtime errors - #275
DicksonWu654 wants to merge 2 commits into
Conversation
A property test whose cases are all discarded, or that random selection never picks, ended the run with "OK, properties passed" although it was never checked. Print a warning that names such tests instead of the OK line. Invariant testing does the same for invariants that were never selected. The exit code is unchanged. Runtime errors were logged as [FAIL] but not counted, so the statistics could show "FAILED x0" for a failed run. Count runtime errors from test functions, discard functions and invariants as failures, and runtime errors from public function calls in invariant testing as ignored calls. A runtime error in a discard function is now logged like other test failures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This makes sense. 👍I’d keep exit codes unchanged here and consider an opt-in |
|
Thanks! Agreed, exit codes stay unchanged here. I'll follow up with an opt-in |
Exit codes stay unchanged by default. With --fail-on-unchecked (config key fail_on_unchecked), a test or invariant that was never checked fails the run with exit code 1. The reporter emits an `unchecked` event with the names, and the CLI turns it into a failure only on request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Added the opt-in @hugo-stacks, Radu mentioned you'd know who maintains Rendezvous at Stacks Labs now. Could you point me to the right reviewer for #275, #276 and #277? Thanks! |
|
Hey @DicksonWu654 |
|
@DicksonWu654 For each of the PRs, can you briefly explain how your needs emerged, what's your use case, and give some context around what made you open this PRs? It'll help us assess the priority for each |
|
Thanks @hugo-stacks! I've added a short Context section at the top of #275, #276 and #277 explaining where each need came from and the use case. None of them are urgent, so please take your time. No rush at all. |
Context
I've been using Rendezvous to fuzz Clarity contracts, both on real projects'
existing Rendezvous tests and on contracts with known planted bugs that I use to
evaluate the fuzzer. Several properties have preconditions, and some runs ended
with "OK, properties passed" even though every case had been discarded, so
nothing was actually checked. If a green run is treated as evidence that a
contract was tested, a pass that tested nothing is the worst outcome. I also saw
runs that logged a runtime error but reported
FAILED x0.What
that selected it was discarded, or it was never selected), Rendezvous no
longer prints
OK, properties passed after N runs.. It prints a warningthat names those tests. Invariant testing does the same for an invariant
that was never selected. Exit codes are unchanged.
in property test functions, discard functions and invariants count as
FAILED. Runtime errors in public function calls during invariant testingcount as
IGNORED. Before this change they were logged, but thestatistics could show
FAILED x0for a run that failed on a runtime error.A runtime error in a discard function is now also logged as a
[FAIL]line.Why
A discarded case does not check anything, so a test whose cases were all
discarded was not tested at all. For example, on master,
rv . slice test --seed=3 --runs=40inexample/discards all 40 cases(
PASSED x0for all six tests) and still printsOK, properties passed after 40 runs.. With this change, it prints:The run statistics are the only summary of a run, so they should count
every failure that the log shows.
Opt-in failure
Exit codes are unchanged by default, because the CI example
rv . slice test(100 runs) would fail otherwise: with seeds 1 to 8, 4 to 6 of the 6 slice tests
had no passing case. With
--fail-on-unchecked(config keyfail_on_unchecked), a test or invariant that was never checked fails the runwith exit code 1. The reporter emits an
uncheckedevent with the names, andthe CLI turns it into a failure only when the flag is set.
Tests
outcome.tests.tsrunscheckPropertiesandcheckInvariantson atemporary Clarinet project that has no requirements. It covers in-place and
discard-function discards, a passing test next to an always-discarded one,
a normal pass, and an error result, a runtime error in the test and a
runtime error in the discard function, each counted once with bail. It
also covers false and runtime-error invariants counted once, and public
function runtime errors counted as ignored.
heatstroke.tests.tscovers the reporter warning for tests andinvariants, and the OK message when everything was checked.
app.tests.tsrunsrv . slice test --seed=3 --runs=40with and without--fail-on-uncheckedand checks the exit code.cli.tests.tsandconfig.tests.tscover the flag, the config key and its validation.npm test: 12 files, 177 tests pass. Format and lint are clean.🤖 Generated with Claude Code