More Stupid Testing Ideas - Generating TAP from TAP

Ovid on 2007-12-10T15:36:14

Test results currently look something like this:

t/foo.t................. ok
t/bar.t................. ok
t/baz.t................. 23/?
#   Failed test at t/baz.t line 9
# Looks like you failed 2 tests out of 23
t/baz.t................. Dubious, test ...

Why do we do this instead of outputting TAP (using the proposed YAML diagnostics)?

ok 1     - t/foo.t
ok 2     - t/bar.t
not ok 3 - t/baz.t
  ---
  failed:
    - 2
    - 11
  ...

And we could even add diagnostics for the non-failing tests. This could be an alternate output, but now instead of external tools having to try and parse our ad-hoc Test::Harness output, we could have an alternate machine read-able output that those tools could use. Now if only we had a useful way to read that output ...

Of course, this would be optional output, not the default. I think this could simplify a lot of "meta" testing issues we seem to have. Of course, you could say "but the new Test::Harness provides that information anyway!" The problem is that it's not easy to stream this data to a remote machine or persist it for later. Being able to persist it as TAP would be useful (TAP::Harness::Archive is a different attempt to solve a similar problem).


excellent

rjbs on 2007-12-10T16:41:49

I'd wondered this myself in the past. It also occurs to me that it would be pretty keen to allow a verbose TAP-2-TAP harness to emit the contents of the individual tests as groups, so that your tests 1, 2, 3 could be expanded to three groups showing the results of the tests as a whole. If I recall correctly, groups are arbitrarily nestable, so a series of harnesses could run a very large test suite, producing a single comprehensive TAP document.

It would also be pretty keen to attach some metadata to each group, indicating monikers for rerunnable tests. Then one could write a nice little web or curses TAP browser with the ability to re-queue failed test groups on various levels. Then, plug that into Smolder...

I really need to make some more time to tap at this problem.

re: TAP on TAP action

markjugg on 2007-12-12T05:14:40

I think this a neat idea worth pursuing further.