Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp935715pxv; Thu, 1 Jul 2021 12:42:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsyBdG3UFSQOz9TZ6XTPrnZ4twWH331hktm5d8k9YtWOXrs/IqOsJXqsy6yuzCUpxQyjBo X-Received: by 2002:a6b:b2c4:: with SMTP id b187mr822268iof.206.1625168570420; Thu, 01 Jul 2021 12:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625168570; cv=none; d=google.com; s=arc-20160816; b=qGmk0fBVUZem3JL1JIdpy4xIHDgmTRwbjyWtYNv/CQtagYzrDhK3rhrS4IkEKa3Nrw 0bZvWLLVZs8QlhsPuX/7QKveLJXj8a8mmFeIKDYKCy4ec+6qTrF6ti5W25ZkocQHQ6Zd yqF5t3HCIPkYUUYK4rj4+L6sLSDcTebFUN08HZ368Y0BJ34gNia8YfclctM4hYG9ifO9 VppykLltzdwz/K5OVF5bNuzjJenG9pkRIRTgnz9JdacupdFh1U+759/Z8W+3g3XJfp4N 1kYb/AHVbiN4g42oEwOIDRxYCm8t1oDoi2ZLWjl9wgqNZOEkLl4gJEwxlmF09XHiRhq3 JOSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nJcbG0Lztm5zUO4KSS6JbG8DSMcv2xjffIaUs/IPuG8=; b=RUn5p08DWD9rreJlwwHXjKBGckJpXA7N+tL7p+ogwLSVMvzmuQrsj+WoLwC0T7jTsx ooftT1L08o9Qrj1Tk1w1Jzy0meVL1km37OMiLuUU/HVr2PFE1VhQr6bAVtGpm3dbYV9M qcRJ0vI02g8FDHg2JNpoZIqfUZ32dizjigjoIACb+8bF2DCwl4dI8aSX5O721cu8gvJ+ P4C6trRacQqS6qz4ezALbNt0YKab+rPX6Bn220Y9y27fmsbf5Hz1bh+Tsxu9GinV3KKB HHnog0yIJrgIuXlX7tLXglvdi0vzib6srkcF6VaMwkqTgSR0xJZhSIv9vdDbTNLr/uG1 JPCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NppJJIEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si1030554jap.105.2021.07.01.12.42.38; Thu, 01 Jul 2021 12:42:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NppJJIEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbhGATnl (ORCPT + 99 others); Thu, 1 Jul 2021 15:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232845AbhGATnk (ORCPT ); Thu, 1 Jul 2021 15:43:40 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F1BBC061764 for ; Thu, 1 Jul 2021 12:41:09 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id in17-20020a17090b4391b0290170ba0ec7fcso7301052pjb.4 for ; Thu, 01 Jul 2021 12:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nJcbG0Lztm5zUO4KSS6JbG8DSMcv2xjffIaUs/IPuG8=; b=NppJJIEdya/aEG3IwmErYGiBOMgdUFUnJMU9HTI4GSxs09P8+t0QrX99EUBq/UtxM5 zG7oskh/M++GFmyQ6hHqU0qMGIF+O3YmJorfMZxAFOQ4QyImia/VfcR6Ht/ofveIbOCX W5fx7T5L72CY5E4f/boLsKdyMdYgIPI616z+LJ6kK+z5Eaz0rsNm8dBcXdi6Px0NpvbC zB1bTdNMDW9FLX6XWtlFUw3uhkmZv56omEp6Gx1P0DogmsYG9ueanHft2IHLguK8Um3z 9Tp8lXWxPFnzkwfhyAjQcsE4uV8WEHgXDudIezb+3jDaIJgttjoI1eBLQFqN4OjplY0q 6O3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nJcbG0Lztm5zUO4KSS6JbG8DSMcv2xjffIaUs/IPuG8=; b=KJlmEGVjrdJb5QN69sjkJGlon1i/MnjmAXGvre8fOAy+2FeU2rc7BJJTelXfChPEYB goIe1xrurxut3Km1zJ7C0GXTKL8oSaRzT746YSy3IWPnbHVJ/jMupqKBdvQYuxxTSF21 7VTTOFzLx0tt8y/sH/2MrQbI+lowfCrPwBHal5eLXfq1rBz9C+EGmNldO1U/G3pteO3v 5ducbW1q2xENXz3ewXJwOiyDzm8JOKXFum23Y9wBPDG4g9CfVAZrKPyGxEEGVQOSKwu8 mys0hTr2LzqCCeby5b4bgASgSfVwkAoB7Sjf2IxaNPuXdjsqLWFRFIjTdtQmgrYxSQ6a 3AdQ== X-Gm-Message-State: AOAM530eB3itpjOELyCuXu8sl3KPNZTpAbALi9+W26DKnVbC6uLVgqWY WcU7uTZrGjCsXlcnj6B5zEYS0hlNLPCLiw6+1Thjng== X-Received: by 2002:a17:90a:1941:: with SMTP id 1mr11633636pjh.217.1625168468317; Thu, 01 Jul 2021 12:41:08 -0700 (PDT) MIME-Version: 1.0 References: <20210701175231.1734589-1-rmoar@google.com> In-Reply-To: <20210701175231.1734589-1-rmoar@google.com> From: Brendan Higgins Date: Thu, 1 Jul 2021 12:40:57 -0700 Message-ID: Subject: Re: [PATCH v2] kunit: tool: Fix error messages for cases of no tests and wrong TAP header To: Rae Moar Cc: davidgow@google.com, dlatypov@google.com, shuah@kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 1, 2021 at 10:52 AM Rae Moar wrote: > > This patch addresses misleading error messages reported by kunit_tool in > two cases. First, in the case of TAP output having an incorrect header > format or missing a header, the parser used to output an error message of > 'no tests run!'. Now the parser outputs an error message of 'could not > parse test results!'. > > As an example: > > Before: > $ ./tools/testing/kunit/kunit.py parse /dev/null > [ERROR] no tests run! > ... > > After: > $ ./tools/testing/kunit/kunit.py parse /dev/null > [ERROR] could not parse test results! > ... > > Second, in the case of TAP output with the correct header but no > tests, the parser used to output an error message of 'could not parse > test results!'. Now the parser outputs an error message of 'no tests > run!'. > > As an example: > > Before: > $ echo -e 'TAP version 14\n1..0' | ./tools/testing/kunit/kunit.py parse > [ERROR] could not parse test results! > > After: > $ echo -e 'TAP version 14\n1..0' | ./tools/testing/kunit/kunit.py parse > [ERROR] no tests run! > > Additionally, this patch also corrects the tests in kunit_tool_test.py > and adds a test to check the error in the case of TAP output with the > correct header but no tests. > > Signed-off-by: Rae Moar > Reviewed-by: David Gow > Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins