Re: [tap] "Nested TAP" in the draft

Aristotle Pagaltzis <> Tue, 01 June 2010 06:31 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 4FC4128C129 for <>; Mon, 31 May 2010 23:31:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[BAYES_50=0.001]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id FFonr+MqiFn9 for <>; Mon, 31 May 2010 23:31:44 -0700 (PDT)
Received: from ( []) by (Postfix) with SMTP id 8F10C28C144 for <>; Mon, 31 May 2010 23:31:43 -0700 (PDT)
Received: (qmail invoked by alias); 01 Jun 2010 06:31:30 -0000
Received: from (EHLO klangraum) [] by (mp040) with SMTP; 01 Jun 2010 08:31:30 +0200
X-Authenticated: #163624
X-Provags-ID: V01U2FsdGVkX1/Wb61JiUvWd6b2FGJ9HB3GHcwZgJTMSyHLyLAc5U pKzK39uBWOjsjM
Date: Tue, 1 Jun 2010 08:28:06 +0200
From: Aristotle Pagaltzis <>
Message-ID: <>
References: <> <>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Y-GMX-Trusted: 0
Subject: Re: [tap] "Nested TAP" in the draft
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Test Anything Protocol WG discussions <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 01 Jun 2010 06:31:45 -0000

* Salve J Nilsen <> [2010-03-05 17:05]:
> Ovid said:
> >One unanswered question regarding nested TAP: are skip and
> >todo allowed on summary test lines?
> SKIP means "I expect this test to fail, so I won't run it, but
> it's result should be read as ok anyway." If a set of subtests
> should be summarized with "SKIP", we'll have to know a few
> things about it:
> 1) Are ALL the subtests "SKIPped"?
>  - In this case I think it's reasonable to summarize with a "ok
>    # SKIP" if all subtests were ok, or a "not ok # SKIP" if one
>    of them failed.
> 2) Are SOME of the subtests SKIPped, while others are regular
>    tests?
>  - A pass or a fail in the regular subtests here would throw
>    off the summary. If all SKIPped subtest pass, but one
>    regular subtest fails, should this be summarized as "not ok
>    # SKIP" or "not ok"? Same question goes if both a SKIPped
>    and a regular subtest fails.
>  - If all subtests succeed, should it be reported as "ok" or
>    "ok # SKIP"?
>  - One way to clean up the summary is to define a "summary
>    priority." Which reports are the most important/general?
>    (E.g. regular > SKIP > TODO; the most "important" fail ends
>    up in the summary)
>  - Another way is to require a warning when the subset result
>    is ambiguous
>  - A third way is to extend the protocol to give a more
>    detailed report on what the subtest results were. :-P
> 3) Are NONE of the subtests SKIPped?
>  - Summarizing a subset with no SKIPs as SKIPped sounds very
>    much like an error to me. :)
> I think the case for TODOs are pretty similar, which leaves us
> with the question "How to summarize a mixed result?"
> - If all subtests pass, then the summary should be a pass.
> - If at least one regular (non-SKIP, non-TODO) subtest fails,
>   then the entire subset is summarized with a fail.
> - If at least one SKIP subtest fails, but no regular tests,
>   then the summary should be a failed SKIP (not ok # SKIP.) --
>   Treat it as one SKIPped test.
> - If at least one TODO subtest fails, but no regular tests or
>   SKIPped tests fail, then the subset should be reported as
>   passed, with a warning ("not ok # TODO Reason".) -- Treat it
>   as one TODO test.
> - If there is a mismatch between subtests and summary (e.g.
>   summary is given as a failed TODO, but there are failed SKIP
>   tests) then this should be a protocol error.
> - Salve, throwing in some thoughts to get things going.. :)

Personally this seems to me like too much cleverness.

Don’t forget that the nested TAP is produced on the emitter side.

Keep in mind the two primary (mutually supporting) principles of

• That the emitter can be almost completely stupid

• That TAP is descriptive, i.e. merely records results, without
  assigning any particular judgement/interpretation to them

Strictly speaking, even the mere fact that nested TAP requires
the emitter to produce a summary line is a watering down of these
principles: the emitter takes on some aspects of a harness. If we
cannot avoid this, then we should at least minimise the amount of
subtlety involved in emitting this summary line.

The fact that there is a summary line is a backcompat concession
to old harnesses. Personally I would even consider making it some
kind of fixed `not ok # TODO` or such, and *require* harnesses to
look inside the nested sequence if they understand it – so that
emitters could remain completely stupid. Or maybe put this up to
the discretion of the emitter and tell new harnesses never to
rely on the summary. Not sure what exactly would be the best
course of action…

*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}
#Aristotle Pagaltzis // <>