Re: [tap] Valids subtests (was: RFC Status?)

"Bruno P. Kinoshita" <brunodepaulak@yahoo.com.br> Fri, 19 September 2014 12:46 UTC

Return-Path: <brunodepaulak@yahoo.com.br>
X-Original-To: tap@ietfa.amsl.com
Delivered-To: tap@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AA15F1A0117 for <tap@ietfa.amsl.com>; Fri, 19 Sep 2014 05:46:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.35
X-Spam-Level:
X-Spam-Status: No, score=-1.35 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, REPTO_QUOTE_YAHOO=0.646, URIBL_DBL_ABUSE_REDIR=0.001, URIBL_DBL_REDIR=0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yaWh6DlesiaK for <tap@ietfa.amsl.com>; Fri, 19 Sep 2014 05:46:21 -0700 (PDT)
Received: from nm13-vm4.bullet.mail.gq1.yahoo.com (nm13-vm4.bullet.mail.gq1.yahoo.com [98.136.218.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 630281A00FC for <tap@ietf.org>; Fri, 19 Sep 2014 05:46:21 -0700 (PDT)
Received: from [216.39.60.182] by nm13.bullet.mail.gq1.yahoo.com with NNFMP; 19 Sep 2014 12:46:20 -0000
Received: from [98.137.12.200] by tm18.bullet.mail.gq1.yahoo.com with NNFMP; 19 Sep 2014 12:46:20 -0000
Received: from [127.0.0.1] by omp1008.mail.gq1.yahoo.com with NNFMP; 19 Sep 2014 12:46:20 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 11847.89706.bm@omp1008.mail.gq1.yahoo.com
Received: (qmail 28856 invoked by uid 60001); 19 Sep 2014 12:46:19 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.br; s=s1024; t=1411130779; bh=fJQhG0uxMhaWf8dzuU7ChHkoD6xI4dMQGHvBa9Z11yg=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=OQvIcsl4Q5QxJu89N+Y4unJjLa4fLENUPSnfVL2S5B4bThGNHrIVKip6OTtWLHacfoqRhxM5MLrMhZGpIZJJ9aUoqvZM/ihlSCFb6vAP2ZRSUShGr7iKOYEXbu4JIWEE6S4nm8ZpxsErE7Gv76kpZWJ/3VSJoM2FNMdMM71EefI=
X-YMail-OSG: 7tb3w64VM1n_tiyYuIOESOEeUUsieSEqLG2SBSXDMvgl56x X1f_UnNwy9MPUVUQkN4jv5Fm7R4x5yC0rSg7.zaHT1FD3ZwxB.unHdDVjs2i f7R5ng5G30Ag8gWUcBzPD65nxb36sV5sVVH7VPMpgYhBRCNmZ4XDh64CSA17 SF42py75sGGs_nUCmICICDJBfGiIZ3fhitv49C0KYVQn66UCjeveEF09n58T _efVc0ZjNdXwCr.WjzY5tTQo5JlIWwrn.PBrvoUVGDY2PnHmG7K5_Tew_YLz y_3H5UI.VbU9IpPIwACOtJ9fe9CpYs7OK_yvsDMtYowvQ7_e9Ov2BeaQ72Wb nSbiXTZcZ4S51fq64wzNpLUZS6VHulBLMVgDgs0TeUVtTbmVIGS4Qyb13e3I ZH1CcOW.R5pVLTLeBhxiCBC6MKueSzFSA7AEFR6KExkIR_zs8qiJWbhj6qxb oe0AuqFdXUlNo9F_DhYJhLgOAiJdasHWUPCYEiCRdo8fvbOJ.oELpVsiVl4f H9dcnQkBJ_SkWtlHx9a2zTj4B4Mtjhw7qBcKeEZN4doK.sgB6TY0ea3bYFSQ 3hB7zUfF7mPxYu.WB_gfOVGhWLPbblr7nRxBtMjL3T5p0EznSv0u5DqdXSk. LqWe1lxSpq3P2gWkIs3T2dmUFZH1JHmcqFe40sGQ7QdZKgS19rpy3C4rWJyg KHKRa9y9iVD.Wk3rD6lnsfAi_EZdSSQuAUF2R5hyXzVkhqF9TIdbC4pXkIOi WCPRTqChRZDqDNcH3VovNOA2SW_DD3SfxfYHdtw6GUhlxDJuYqCgKIf2Z96n VIu1LmdgNEOFFSvA3zfLesIlWmGnZr6y.y6_6ugsYvRdhDJskiVBENzn.jWu 1lqX2JQRAqbQAg0g82tRYa1MRtOw3ni8w3zXy.roCo2AKNTTD6rSqxlRiYZF OlJZnhcuemGV71w--
Received: from [189.50.161.77] by web163506.mail.gq1.yahoo.com via HTTP; Fri, 19 Sep 2014 05:46:19 PDT
X-Rocket-MIMEInfo: 002.001, SGVsbG8gT3ZpZCwgCgo.IEluIGEgdGVzdCBoYWNrYXRob24gaW4gTm9yd2F5LCB3ZSBkaXNjdXNzZWQgY3JlYXRpbmcgYSBUQVAgZG9jdW1lbnQgdGhhdCB3b3VsZCBiZSBhIHNlcmllcyBvZiBUQVAgc25pcHBldHMgYW5kIGhvdyB0aGV5IHNob3VsZCBiZSBwYXJzZWQuIFRoZSBkb2N1bWVudCB3b3VsZCBiZSBZQU1MIG9yIHNvbWV0aGluZyBzaW1pbGFyIGFuZCBzaG91bGQgYWxsb3cgVEFQIGltcGxlbWVudG9ycyBpbiB2YXJpb3VzIGxhbmd1YWdlcyB0byBwYXJzZSB0aGUgVEFQIHNuaXBwZXRzIGFuZCBjb20BMAEBAQE-
X-Mailer: YahooMailWebService/0.8.203.696
References: <CAP4gcszybVr5Hw3mg=uTi8tqpA3wEVwo=zf2876RWhy_CmozZw@mail.gmail.com> <CAHhgV8jr6ZnsfUkpFC4OL0AwRX-aen7v-7KjcN3e0_19s7steg@mail.gmail.com> <1410980929.82809.YahooMailNeo@web126106.mail.ne1.yahoo.com> <1410981416.81953.YahooMailNeo@web163504.mail.gq1.yahoo.com> <CABFQKmObv0EG=iVhzPNYGKwK44k7QtEV+PfrvBnDjn35MjbzBg@mail.gmail.com> <1411114619.77920.YahooMailNeo@web126104.mail.ne1.yahoo.com>
Message-ID: <1411130779.24247.YahooMailNeo@web163506.mail.gq1.yahoo.com>
Date: Fri, 19 Sep 2014 05:46:19 -0700
From: "Bruno P. Kinoshita" <brunodepaulak@yahoo.com.br>
To: Ovid <curtis_ovid_poe@yahoo.com>, Andrew Rodland <andrew@cleverdomain.org>
In-Reply-To: <1411114619.77920.YahooMailNeo@web126104.mail.ne1.yahoo.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="-895122751-556386498-1411130779=:24247"
Archived-At: http://mailarchive.ietf.org/arch/msg/tap/dLc41Ytqj9BK1OOM8SfNKwXH3SE
Cc: "tap@ietf.org" <tap@ietf.org>
Subject: Re: [tap] Valids subtests (was: RFC Status?)
X-BeenThere: tap@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: "Bruno P. Kinoshita" <brunodepaulak@yahoo.com.br>
List-Id: Test Anything Protocol WG discussions <tap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tap>, <mailto:tap-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tap/>
List-Post: <mailto:tap@ietf.org>
List-Help: <mailto:tap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tap>, <mailto:tap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 19 Sep 2014 12:46:23 -0000

Hello Ovid, 

> In a test hackathon in Norway, we discussed creating a TAP document that would be a series of TAP snippets and how they should be parsed. The document would be YAML or something similar and should allow TAP implementors in various languages to parse the TAP snippets and compare their results to the document results. In other words, a language-agnostic test specification. Maybe now would be a good time to create one?

+1 for that, it would incrase compatibility between producer/consumers in different programming languages.

And we could derive from it a simple web page like JSON-LD has [1] and provide a more readable version as well.

Cheers, 
Bruno

[1] http://json-ld.org/test-suite/



>________________________________
> From: Ovid <curtis_ovid_poe@yahoo.com>
>To: Andrew Rodland <andrew@cleverdomain.org> 
>Cc: "tap@ietf.org" <tap@ietf.org> 
>Sent: Friday, September 19, 2014 5:16 AM
>Subject: Re: [tap] Valids subtests (was: RFC Status?)
> 
>
>
>Hi Andrew,
>
>
>In that, we agreed that it was desirable that the determination of whether a line was junk/unknown wasn't context sensitive.
>
>
>I've tried searching for where I said that, but I can't find it. Can you provide me with the quote so I can understand where the confusion lies? I may very well be mistaken here.
>
>
>I fully admit that subtests were never considered in the original formulation of junk lines, but I think my description of this as being valid and the eight space indented line being an unknown (and therefore discarded) line is correct:
>
>
>> ok 1 - foo
>>        ok 1 - bar indented too far
>> ok 2 - bar passed
>
>
>The reasoning works like this: historically it has always been the case that ok/not ok status is bound to the beginning of the string and even a single space in front of ok/not ok invalid. With a subtest, we make an exception if an only if it is indented exactly four spaces (in the context of the containing scope) and is parseable as TAP. Otherwise, writing a parser could be a nightmare. Consider:
>
>
>> ok
>> not ok
>> ok
>> 1..3
>
>
>Most people aren't aware of this, but that's a perfectly valid (but failing) TAP stream. While it's not recommended, the test numbers have always been optional. Here's the relevant line from the TAP grammar:
>
>
> test ::= status positiveInteger? description? directive?
>
>
>Because TAP is designed to be both human-readable and computer-parseable, there exists the unfortunate problem that sometimes it's just a touch harder to parse than normal and some of the plans for it might make life more difficult. For example, if we followed your suggestion, we would then have this scenario:
>
>
>> ok
>>        ok this is working now
>> ok bar passed
>
>> 1..2
>
>
>As currently described (by my understanding), the above is valid because the "ok this is working now" line is indented too far and thus discarded. This makes parsing much simpler. However, you argue that the above is invalid because the "ok" line is valid TAP in an invalid context. That makes sense, but consider the plans for structured diagnostics:
>
>
>> not ok # TODO darn it!
>>     --- 
>
>>     file     : t/foo.t
>>     datetime : 2015-01-23 01:23:45
>>     have     : 7
>
>>     want     : 8
>>     comment  : |
>
>>                 We still have an off by one error and it's not
>>                 ok that we still haven't tracked it down
>>     ...
>> ok bar passed
>
>> 1..2
>
>
>Parsers are not required to parse structured diagnostics (this allows older parsers to ignore them), but that last line of the comment above could be considered valid TAP in an invalid context and result in a parse error, even though the above is perfectly fine.
>
>
>The one thing I really don't want to see is for TAP to go down the YAML road of having a mind-bogglingly huge spec to cover all sorts of corner cases. This will block TAP adoption and make it much harder for everyone to get right. However, if we are strict about the four space rule and discarding unknown lines, any parser not compliant with that rule can (sort of) be ignored, but that means better communication about requirements.
>
>
>In a test hackathon in Norway, we discussed creating a TAP document that would be a series of TAP snippets and how they should be parsed. The document would be YAML or something similar and should allow TAP implementors in various languages to parse the TAP snippets and compare their results to the document results. In other words, a language-agnostic test specification. Maybe now would be a good time to create one?
>
>
>Best,
>Ovid
>--
>IT consulting, training, international recruiting
>     
  http://www.allaroundtheworld.fr/.
>Buy my book! - http://bit.ly/beginning_perl
>Live and work overseas - http://www.overseas-exile.com/
>
>
>
>On Friday, 19 September 2014, 5:58, Andrew Rodland <andrew@cleverdomain.org> wrote:
> 
>
>>
>>
>>> A few notes on this.
>>>
>>> For subtests, they are indented four spaces. Always four spaces. If they are
>>> indented eight spaces, you know they're a subtest of a subtest (assuming
>>> there's an intervening subtest. That means this is valid TAP, but there is
>>> no subtest because it's indented too far:
>>>
>>> ok 1 - foo
>>>     
    ok 1 - bar indented too far
>>> ok 2 - bar passed
>>>
>>> The "ok 1 - bar" line would be discarded as "unknown".
>>
>>I'm not trying to argue against established behavior, but I'd
 like to
>>point out that this disagrees with what you expressed in the previous
>>thread "More uncertainty about junk lines". In that, we agreed that it
>>was desirable that the determination of whether a line was
>>junk/unknown wasn't context sensitive. If it's potentially valid TAP
>>in any context, it's interpreted as that, and if that causes the TAP
>>document to be invalid, then so be it. If that holds true, then this
>>snippet is an error; it has a result in a subsubtest that lacks a plan
>>or a containing subtest.
>>
>>
>>Andrew
>>
>>
>>
>
>_______________________________________________
>tap mailing list
>tap@ietf.org
>https://www.ietf.org/mailman/listinfo/tap
>
>
>