Re: [tap] RFC Status?

Ovid <curtis_ovid_poe@yahoo.com> Tue, 12 August 2014 07:49 UTC

Return-Path: <curtis_ovid_poe@yahoo.com>
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 DE6EC1A076F for <tap@ietfa.amsl.com>; Tue, 12 Aug 2014 00:49:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.065
X-Spam-Level:
X-Spam-Status: No, score=-2.065 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, J_CHICKENPOX_31=0.6, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.668, SPF_PASS=-0.001, URIBL_DBL_ABUSE_REDIR=0.001, URIBL_DBL_REDIR=0.001] autolearn=ham
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 M7BpQnDtkKUv for <tap@ietfa.amsl.com>; Tue, 12 Aug 2014 00:49:10 -0700 (PDT)
Received: from nm18-vm3.bullet.mail.ne1.yahoo.com (nm18-vm3.bullet.mail.ne1.yahoo.com [98.138.91.148]) (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 098F61A076E for <tap@ietf.org>; Tue, 12 Aug 2014 00:49:09 -0700 (PDT)
Received: from [98.138.226.180] by nm18.bullet.mail.ne1.yahoo.com with NNFMP; 12 Aug 2014 07:49:09 -0000
Received: from [98.138.226.162] by tm15.bullet.mail.ne1.yahoo.com with NNFMP; 12 Aug 2014 07:49:09 -0000
Received: from [127.0.0.1] by omp1063.mail.ne1.yahoo.com with NNFMP; 12 Aug 2014 07:49:09 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 239878.10813.bm@omp1063.mail.ne1.yahoo.com
Received: (qmail 80107 invoked by uid 60001); 12 Aug 2014 07:49:09 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1407829749; bh=FROjnuBMF+BFUvcvryW9BX5qYPfYjD7JQ0fvOym4dkw=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=QCfwOeF+CeAeTqzmvjtDXFp0af/Wk0IOY0fhlVcnjiylNdD2On2EHimBj7nCjIc2jmtNcz02bIlvL4K38h4R0mmwtgZMQtuaNm9LY4d2L5CkuMOX1rRMJA6J5U+hkHT4C5eS1Brl/lF06A3RQIWO1gzxowqfOxlltnVTY3E8zhc=
X-YMail-OSG: wD8akvEVM1kTkx2ARPoDmv_8rA2WvUUEJvxw7LkILkkqv.N PJNhgsXqsUKaUS8X3auLvl40dyP1cx_MVVFJqovX.iZTFHGZsJ0KWj.OCmhf PW8qXkIOGM82dc5qkvRY9WUILPBSZz2x1Nue1JQ8HNg.yI4pB0yS1pwjKTww k_k2Nc.9n7rFMy8hDnwD6Ce9kfZi9ZzGh7ItqIFbBkk1Q5fULuuBQaIY1_so CmgvkqlGtlSdom_3oi6N9rHzJfwdcp._dghTQdCJ.SAK003GZwL.69lSbCFE NrdujvoP6gnf63O0V53mRs9AuhgA46Rb8xKevH4R6wEAtBRPRg4z6PUwhouA 4Cc00TwZs5SKspxTspzsxHl9hvUO3WVH_psA9aVsDiphoJZQ1lPzfEsiOhN5 OkcAuVx5HHU0d8JkrrNPVF4gXshb86z7diKWaQZrDeFkeOPuS8MDW6sK.axX tN9Q5QQseYsadMGoW7gGM3e_XJkKz5_ypn1dhrFo516pHAWSyFAK59u78pRG LwuBpYwLuArTk3THrNX6gQDK69nbTvPpe3UFCXZR1e2yLXV.ZPjOQ5ZdihOq FHu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bSNjYXZlYXRzwqAsIGltcGx5aW5nIEFGQUlDVCB0aGEBMAEBAQE-
X-Mailer: YahooMailWebService/0.8.201.700
References: <CAP4gcszybVr5Hw3mg=uTi8tqpA3wEVwo=zf2876RWhy_CmozZw@mail.gmail.com> <7250AD76-F5DF-494C-8A00-B4320053EBE7@ggvaidya.com> <1407788544.42539.YahooMailNeo@web163506.mail.gq1.yahoo.com> <CAP4gcswppT=HEy4ew-TejcvJjWT8AwXXRjnG2ECZa7tWnbT7ZQ@mail.gmail.com>
Message-ID: <1407829749.48636.YahooMailNeo@web126105.mail.ne1.yahoo.com>
Date: Tue, 12 Aug 2014 00:49:09 -0700
From: Ovid <curtis_ovid_poe@yahoo.com>
To: Andrew de Andrade <andrew@deandrade.com.br>, "Bruno P. Kinoshita" <brunodepaulak@yahoo.com.br>
In-Reply-To: <CAP4gcswppT=HEy4ew-TejcvJjWT8AwXXRjnG2ECZa7tWnbT7ZQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="-588606924-720476938-1407829749=:48636"
Archived-At: http://mailarchive.ietf.org/arch/msg/tap/ob1I-AIghxHt6yyOvUY4VK5EdYA
X-Mailman-Approved-At: Tue, 12 Aug 2014 00:57:55 -0700
Cc: "tap@ietf.org" <tap@ietf.org>
Subject: Re: [tap] RFC Status?
X-BeenThere: tap@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Ovid <curtis_ovid_poe@yahoo.com>
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: Tue, 12 Aug 2014 07:49:13 -0000

Should the aggregate reporter report subtests as they are received or should it keep the subtest results that finish out of order in a buffer and always report the tests in a deterministic way? I did see this in the readme, https://github.com/Ovid/tap-stream#caveats , implying AFAICT that it is left up to the TAP aggregator consuming the stream to either report things in order with or without numbers (if desired) or out of order, but un-numbered. 
The following assumes that I correctly understood your question :)

Presumably an aggregate reporter either runs tests in order (in which case tests come back in order), or or runs them in parallel (in which case order is not guaranteed). Let's say that your test harness runs test programs A and B. It cannot control their output, so A and B must guarantee that they return valid TAP. What that means in the case of subtests is the following.


Let's say that A returns:
1..2
>ok 1 - We have lift off!
>not ok 2 - Houston, we have a problem
And B returns this:
ok 1 - Trap is set
>ok 2 - Trap is sprung
>ok 3 - Compromising photos of boss emailed
>1..3
With that, if we run in parallel, either of those TAP chunks can be returned first, but until the consumer receives the entire output from A or B (in whatever order), it can produce no output. It could, in theory, block on one, but this behavior isn't defined because the specification is about the TAP producers, not the consumers. Maybe that that should be rectified? (Or maybe it is also about the consumers and it's been too long since I worked on it and just plum forgot).

Assuming all goes well, the consumer can produce:
    1..2
>    ok 1 - We have lift off!
>    not ok 2 - Houston, we have a problem
>not ok 1 - A
>    ok 1 - Trap is set
>    ok 2 - Trap is sprung
>    ok 3 - Compromising photos of boss emailed
>    1..3
>ok 2 - B
>1..2
Or this:
    ok 1 - Trap is set
>    ok 2 - Trap is sprung
>    ok 3 - Compromising photos of boss emailed
>    1..3
>ok 1 - B
>    1..2
>    ok 1 - We have lift off!
>    not ok 2 - Houston, we have a problem
>not ok 2 - A
>1..2
Or (but not recommended):
not ok 1 - A
>ok 2 - B
>1..2
The latter is not recommended because you're throwing away information, but it should parse the same way as the previous ones with an older TAP parser because ok/not ok binds to the beginning of the line (and thus indented TAP is ignored).

In fact, you could put the 1..2 plans before the tests if you wanted to (also called a "leading plan").

The reason the nested TAP behavior isn't well-specified is because there were many arguments over it at conferences and hackathons, and then one day (I was in Norway, I think), I got tired of the arguments and just sat down and implemented a mostly backwards-compatible solution. Implementation trumps opinion, so I won.

Another thing to note about TAP is that we still don't have structured diagnostics. Again, this was largely because no one could agree on what they should look like. Some wanted producers to be able to output them in whatever format they wanted (JSON, YAML, XML, and so on). I argued that was madness and having a single standard would make parsing much easier. Putting that aside, there were also arguments about how and what information should be captured in said diagnostics. Filename and line number are clear, but what about tests for which that information doesn't make sense? Or what about a timestamp? Local time? GMT (useless)? UTC?

So there's lots of work to be done and lots of behavior to be nailed down. Fortunately, TAP's been going strong since the 1980s, but it's only been the past decade or so since it's been named and formally developed.

Ask any questions you like.

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 Monday, 11 August 2014, 23:31, Andrew de Andrade <andrew@deandrade.com.br> wrote:
 

>
>
>Yes, this all helps a bunch. I've been using substack's tape (https://github.com/substack/tape) and isaacs' tap (https://github.com/isaacs/node-tap) modules thus far. 
>
>
>tape currently supports v13, which as you pointed out Bruno, does not formally specify how nesting should work, and it does support defining tests in a nested way, but does not report them as nested. Instead, it simply updates the plan count and continues with everything flat/unindented and reports the plan count at the end. For example this code...
>
>
>```
>var test = require('tape');
>
>
>test('foobar', function(t) {
>  t.plan(3);
>  //var test = tape.createHarness();
>
>
>  t.ok(true, 'foo');
>  t.ok(true, 'bar');
>
>
>  t.test('fibble', function(tt) {
>    tt.plan(2);
>    tt.ok(true, 'wobble');
>    tt.ok(true, 'wizzle');
>  });
>});
>```
>...produces...
>
>
>```
>TAP version 13
># foobar
>ok 1 foo
>ok 2 bar
># fibble
>ok 3 wobble
>ok 4 wizzle
>
>
>1..4
># tests 4
># pass  4
>
>
># ok
>```
>
>
>What I did just find is an implementation from Ovid from earlier this year in March:
>
>
>http://blogs.perl.org/users/ovid/2014/03/perlqa-hackathon-in-lyon---day-1.html
>
>https://github.com/Ovid/tap-stream
>
>
>
>This stream approach is really nice, but the only thing that leaves me scratching my head is that is implies that asynchrony is permitted (parallelized tests, aggregation, out-of-order reporting), but I'm not exactly sure what the implications for this are for the aggregate tap producer. 
>
>
>Should the aggregate reporter report subtests as they are received or should it keep the subtest results that finish out of order in a buffer and always report the tests in a deterministic way? I did see this in the readme, https://github.com/Ovid/tap-stream#caveats , implying AFAICT that it is left up to the TAP aggregator consuming the stream to either report things in order with or without numbers (if desired) or out of order, but un-numbered. 
>
>
>Given my intended use case, buffering results so that results can always be reported numbered in order would be desirable, since I want to be able to diff TAP results across test runs under different conditions (e.g. different dependency versions). Has anyone done any work with diffing TAP results?
>
>Bruno, is tap4j purely synchronous or at least in order or can subtests be asynchronous and reported out of order?
>
>
>Seeing that Ovid is still actively working on this stuff (comments on tap on perlqa3 as recent as April this year), is it save to assume that there are ideas here that will make it into version 14? The test blocks you pointed to does reference version 14 in the example -->  https://web.archive.org/web/20110611083916/http://testanything.org/wiki/index.php/Test_Blocks
>
>
>
>_______________________________________________
>tap mailing list
>tap@ietf.org
>https://www.ietf.org/mailman/listinfo/tap
>
>
>