Repository navigation
Make reporters cope with sparse streams and plain TAP - #16
Merged
Merged
Conversation
A test that didn't pass need only give a message, and not every producer gives even that. Rubytest gives no exception class, and a backtrace only for errors, which made the markdown and html reporters raise. A failed test from plain TAP has no exception section at all, which made every reporter raise. The exception section is now filled in before a reporter sees the test. tap reporter: print a line for omitted and to-do tests, with SKIP and TODO directives, so the lines match the plan (#14). outline: list them too. outline and markdown: handle tests outside of any case. Plain TAP input: accept a version line and streams that open with a test line or comment, turn SKIP and TODO directives into omit and todo, number unnumbered tests, and give complete final counts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
trans
added a commit
that referenced
this pull request
Nov 21, 2026
Fix reporters on sparse streams and plain TAP input (#16 onto master)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #15 (its base is
modernize); merge that first.Found by running every reporter against real streams: rubytest 0.11's TAP-Y and TAP-J, minitap's on Minitest 5.25, and plain TAP.
Reporters raised on tests that say little
TAP-Y/J requires only a
messagein a non-passing test'sexceptionsection.markdownraised for a failure without an exception class,htmlfor one without a backtrace. Rubytest gives no class, and a backtrace only for errors.outlineandmarkdownraised for tests outside of any case, as in plain TAP.The exception section is now filled in before a reporter sees the test, and the two reporters start with a level.
tapreporter and #14It printed the plan and then no line for omitted or to-do tests, so a stream with either came out short. It now prints
ok N - label # SKIP reasonandnot ok N - label # TODO reason. With no count at the start of the stream, the plan goes at the end. Closes #14.outlinenow lists those tests too, with the reason.Plain TAP input
TAP version 13as the first line was rejected as "Not a recognized TAP stream". It is accepted, as is a stream that starts with a test line or a comment.# SKIPand# TODOdirectives becomeomitandtodo, with the reason as the message.Checked
Three new demos cover this: all ten reporters on a sparse TAP-Y stream and on plain TAP, the adapter's handling of the version line and directives, and #14.
qed -Ilib demo/passes (5 demos, 42 steps) on Ruby 3.4.9. All ten reporters also run without raising on seven sample streams from rubytest, minitap and plain TAP.Not changed
A test with the status
skip, which minitap emits and which isn't in the specification, is still treated as a to-do, though minitap counts it as an omission.🤖 Generated with Claude Code