From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2B70C433FE for ; Fri, 4 Dec 2020 18:09:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6481022C7D for ; Fri, 4 Dec 2020 18:09:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387930AbgLDSJQ (ORCPT ); Fri, 4 Dec 2020 13:09:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387781AbgLDSJM (ORCPT ); Fri, 4 Dec 2020 13:09:12 -0500 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B599C061A51 for ; Fri, 4 Dec 2020 10:08:32 -0800 (PST) Received: by mail-il1-x142.google.com with SMTP id v3so6015774ilo.5 for ; Fri, 04 Dec 2020 10:08:32 -0800 (PST) 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=2y9rMaTERSSbE3OXGqqbUsdHNdPLIzXX1XRh3Jkau1k=; b=hkAoZhEqm+cFDrEHKCgOCGlY53/fkNmwKUKLaEWejjjD0Y8jEZ7z1Q6bgfhAoF8kZS Pv97SVv4FbUAnZJEGD5CWGEb2f68M0mfQVMsJMHdqMEDfeXQ2ybczOObDNzCqDVjvN6b SiAAZ8Eh9WxSenubdHzVl9HKkiwXbC1ZIsiB9Skjs034nuOjLe003uMuWpRdt38chuo1 hm89QoH2iEUH5hJOEChfzgiXoc1DluQFtdUOo4lto+X9Qf2dlwMKBou18fGmvIo/xBym bwrD5yAeAihmeJjlOEmxlPAy7dZGZOmSoA280aHMV5E2amXTB4Ex7vHE6KuWdSgRJcJ1 I+tQ== 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=2y9rMaTERSSbE3OXGqqbUsdHNdPLIzXX1XRh3Jkau1k=; b=N34h71VC6lG1YN30EbIR0ENpb4SfJ194HH5XbJ/8gyZyTsKYYn3vFtBmn3OMZoM8x0 tYDnj7kYNE40tEREp/adAUKIDBxEOk4G/A1al/xG6m9pltiRdjgNfDRvGVRc/NnyIUvt PBNN6t4mrxqxhqZ2ufkeT+s732UjrWC1o0wiI6L3bsfa+KwIHAxmWR415YKo3A60VUJQ 5/uoelx7ve9LaMG3hZSoDSdamxHQEJz5OZDjDoZTy3+cSp/qp3T6MUNxoKMUgBgjiSus dKimCqXDCXAIag5vnnowekLg5pOgcYhpywTmi1Vai+rHznhGlIVIg0oI6jFOhf7bxL4K 3lRg== X-Gm-Message-State: AOAM532Vj7+WBHnJHeDh3VqGycgHd89dIs+9T9eYEt3FcVcPX8C8pBWH TtBG/mPcgguqYeGX1/kH4mm+2XAL7ZBmjwlAGd8LZA== X-Google-Smtp-Source: ABdhPJylHSF7vRowIeU00yP3tAwRQyuVs+VtC98SOYyu6nFDRYQ8VOjPM2UExmg/FfGAhMaZDd8PWNF4kX06ZoQI7w0= X-Received: by 2002:a92:bf09:: with SMTP id z9mr7828239ilh.194.1607105311699; Fri, 04 Dec 2020 10:08:31 -0800 (PST) MIME-Version: 1.0 References: <20201203194127.1813731-1-dlatypov@google.com> <20201203194127.1813731-2-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Fri, 4 Dec 2020 10:08:20 -0800 Message-ID: Subject: Re: [PATCH 2/3] kunit: tool: fix minor typing issue with None status To: David Gow Cc: Brendan Higgins , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 3, 2020 at 8:17 PM David Gow wrote: > > On Fri, Dec 4, 2020 at 3:41 AM Daniel Latypov wrote: > > > > This seems good to me, but I have a few questions, particularly around > the description. > > > The code to handle aggregating statuses didn't check that the status > > actually got set. > > I don't understand what you mean here. Does this refer to > Test{Case,Suite}::status potentially being None, and that not being > supported properly in bubble_up_{suite_,test_case_,}errors(), or > something else? Either way, I can't see any additional code to "check" > that the status has been set. As far as I can tell everything except > the default to SUCCESS is a no-op, or am I missing something? mypy (rightly) sees the type is TestStatus or None and complains we don't bother handling None, so we risk a crash in the tool. The status will be none until we explicitly assign a value to it later, which we always do currently, afaict. This change just avoids that by giving it a default value to make mypy happy, which shouldn't change behaviour at all right now. There is no other (potential) behavioural change. > > > Default the value to SUCCESS. > > I'm a little iffy about defaulting this to success, but I think it's > okay for now: the skip test support will eventually change this to a > SKIPPED value. Sounds good! > > > > > This sorta follows the precedent in commit 3fc48259d525 ("kunit: Don't > > fail test suites if one of them is empty"). > > > > Also slightly simplify the code and add type annotations. > > > > Signed-off-by: Daniel Latypov > > --- > > Otherwise, the actual code changes all seem sensible, and it worked > fine when I tested it, so: > > Reviewed-by: David Gow > > -- David