[tap] Parse error vs failure

Michael G Schwern <schwern@pobox.com> Sat, 31 January 2009 20:18 UTC

Return-Path: <tap-bounces@ietf.org>
X-Original-To: tap-archive@ietf.org
Delivered-To: ietfarch-tap-archive@core3.amsl.com
Received: from [127.0.0.1] (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 52AAD3A684F; Sat, 31 Jan 2009 12:18:38 -0800 (PST)
X-Original-To: tap@core3.amsl.com
Delivered-To: tap@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 80D3F3A682D for <tap@core3.amsl.com>; Sat, 31 Jan 2009 12:18:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.435
X-Spam-Level:
X-Spam-Status: No, score=-2.435 tagged_above=-999 required=5 tests=[AWL=0.164, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5aqzNsALiFhf for <tap@core3.amsl.com>; Sat, 31 Jan 2009 12:18:32 -0800 (PST)
Received: from sasl.smtp.pobox.com (a-sasl-fastnet.sasl.smtp.pobox.com [207.106.133.19]) by core3.amsl.com (Postfix) with ESMTP id 04A5D3A688E for <tap@ietf.org>; Sat, 31 Jan 2009 12:18:30 -0800 (PST)
Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 9DAE8955E4 for <tap@ietf.org>; Sat, 31 Jan 2009 15:18:11 -0500 (EST)
Received: from [10.23.42.2] (unknown [69.64.236.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 26B5B955E3 for <tap@ietf.org>; Sat, 31 Jan 2009 15:18:10 -0500 (EST)
Message-ID: <4984B200.6060907@pobox.com>
Date: Sat, 31 Jan 2009 12:18:08 -0800
From: Michael G Schwern <schwern@pobox.com>
User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209)
MIME-Version: 1.0
To: tap@ietf.org
X-Enigmail-Version: 0.95.7
X-Pobox-Relay-ID: 48506F9A-EFD4-11DD-8921-CC4CC92D7133-02258300!a-sasl-fastnet.pobox.com
Subject: [tap] Parse error vs failure
X-BeenThere: tap@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Test Anything Protocol WG discussions <tap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tap>, <mailto:tap-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/pipermail/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>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tap-bounces@ietf.org
Errors-To: tap-bounces@ietf.org

In Oslo, when we came across an edge case that was considered nonsense, the
tendency was to say that its a parse error.  For example, "not ok 4 # SKIP",
because why would you fail a test that didn't run?  Also "1..0" without a
skip, because why would you not run any tests and yet not skip the test?

I think I brought this up earlier, but I want to make sure I have consensus.
I've been calling them failures (with a warning) rather than parse errors.
Why?  Because a parse error means the parser can not extract any information
and can't really tell the user anything but "syntax error at line X".  If your
parser starts guessing at what sort of syntax error it is, well, then it might
as well be grammar at that point.

Worse, a TAP document parser, parsing the full document at once rather than a
traditional line-by-line parser, might invalidate the whole stream and thus
can not extract any information.

If it's just a failure, the parser can get information out of it and has
flexibility about what to do and what action it can suggest the user take.

It complicates the grammar to allow "ok 4 # SKIP" but make "not ok 4 # SKIP" a
syntax error and adds in another special case for the parser.  With "not ok #
SKIP" as normal syntax the skip directive has no effect on the truthiness of
the test.

Consensus?  Generally prefer failure-with-warning over parse error for valid
but sort of nonsense output?


-- 
184. When operating a military vehicle I may *not* attempt something
     "I saw in a cartoon".
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
           http://skippyslist.com/list/

_______________________________________________
tap mailing list
tap@ietf.org
https://www.ietf.org/mailman/listinfo/tap