Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp701128pxb; Thu, 30 Sep 2021 15:27:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSd12SnVq2G9TxNuVPeu18Be0jBgIv/jnOsVKvoowBJAt6vpHYbmo94N8rKfBgkuCjo2CE X-Received: by 2002:a63:ed4a:: with SMTP id m10mr7058381pgk.448.1633040842197; Thu, 30 Sep 2021 15:27:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633040842; cv=none; d=google.com; s=arc-20160816; b=jfuJa+i7dUeFt5xkylku7Q0UmV2AX+yhfserI/i08WJNLz3SSZOtl3EQWldD8k/o7x 5HquBBtQJvLX/cMA5FFjRS6RTvv/1/+z21m82o4UvWuYLxxxmmkWoU2o6J9ztlb1iYZK 6e7rJMMHocdVm4hs055X2cugNl+/La7DiiS4pcxJCkcKGAYl+FbaCeTIcl0h9gDgLrLZ ohVIzv+ZxdMN9l2BAYuUl00AZa9GM6izrybDU2vvjKY8tAD+nE8TZiNqYcnERVAJyrg8 GjAV0xU5vAk3VnezQj+F2VTS54zH+oiy3lDdCjvgmX2mx3ZY7NRyF3BpMj/Ksngph8z5 IYwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=XcWUiZrKPvcsO2JyZO05WjXmCKArwR1SUmaqLWJ1TH8=; b=iA49T3DMMu2IppxL2g+pEJFRlabgKeAjoN1LvrfeXPrRIhW4biCDglo5o1R2tpFHWa jeBd8LbUEIOmpiSIhnWQyKAEdCxQxndCJxJMNEmAw/zOI3W6xqnuktbtox1e7XGmyxSC X7Y1Vr264eLUUkAH3nMP55JJeNKG22LOqXL1Hdk+lzxSSoIGukTA/9VLUeruRjltu3Va CTLHRkxHbLKR4K+nXYtTFNH+Xt8oVcx4lznRebqGRS0mwy9+N7dlm5wcnAiP00pOmL+D eDsLK80hlo6k9n5ksYqG57sgCcJwBiV1q5g6Mqrc0AhUysXPlWF6W3aDsiamEHwBTpin E3fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=sKsGVMz2; 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 f9si6514174pjq.153.2021.09.30.15.27.08; Thu, 30 Sep 2021 15:27:22 -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=20210112 header.b=sKsGVMz2; 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 S229644AbhI3WWg (ORCPT + 99 others); Thu, 30 Sep 2021 18:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345914AbhI3WWf (ORCPT ); Thu, 30 Sep 2021 18:22:35 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8544C06176C for ; Thu, 30 Sep 2021 15:20:52 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 81-20020a251254000000b005b6220d81efso10632579ybs.12 for ; Thu, 30 Sep 2021 15:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=XcWUiZrKPvcsO2JyZO05WjXmCKArwR1SUmaqLWJ1TH8=; b=sKsGVMz2+yzKbIp/RGJtNRzunEBXXTIKXB1d256NaFkPCkx+gav3AAvoUzPocmg/XA ryYKc8ZjqqrrxazRYkISAL7RNlmrirot0VXFbnjgcN4TNa2ZLJiHF73v07Fk/Vg3F0iQ 8FYXaFxqp3rSWPTfKcQc4eksM8Y9Mm2DTL6TxDRiGd1LKpAFybKNsi1nc1n6+myUNvEp KRQ67gohr2D3+4Jys1wqeV1Adjkwc2eU2A1R+cwDHGi6hSpH4D3qZMkVEKh8m7t7HQTM wTafqDzsWFbOyFXdYuwMjNsxwLcRAQCUCz6/P40f9AyXSCxNsuENVi1AGLNMGmWJvr8I snRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=XcWUiZrKPvcsO2JyZO05WjXmCKArwR1SUmaqLWJ1TH8=; b=Z7g7JAqPcQj967GECraitI1yeuoofRFwYf1XYc7HCzMqX+WvJ4MphxGeJygUG5h4Rl OXZX0g0C1oJgdJLL1D1yOmlde9n0AmdLtDGSIzZJ+9X/0FwV/LNCf0NDpz4KU4qqke8X vjN3VK9l8ONGNoacE7n9NingOmCy1DhbUKHGZrjCjShlPkUXhnKU8XEx3/Ps4NH78dr8 o2sn1etbOTz6lZuoGkwVMaYMc6Ns3xlNTVEkcZXNgpNHn7RznAziUnAGHwbwJ5oxxnIN QQpoyWcXk17tVAAHMNcevRRg8TVpHniGm93RzWLjXpoFqMb79NlOceUzGIPFDHq7mEdK b/LA== X-Gm-Message-State: AOAM533T3JWdMfAP5mGU1NM7JXGRtmV2S6Y6YBV/7kNViBbVWFm1951r m1eYmRbnDpMr3PldJbv+ZlS9+GePRvtmXw== X-Received: from dlatypov.svl.corp.google.com ([2620:15c:2cd:202:39fa:d88:fb3b:880e]) (user=dlatypov job=sendgmr) by 2002:a25:fc05:: with SMTP id v5mr2022824ybd.120.1633040451780; Thu, 30 Sep 2021 15:20:51 -0700 (PDT) Date: Thu, 30 Sep 2021 15:20:44 -0700 Message-Id: <20210930222048.1692635-1-dlatypov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog Subject: [PATCH v4 0/3] kunit: allow running test suites/cases individually From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow running each suite or each test case alone per kernel boot. The motivation for this is to debug "test hermeticity" issues. This new --run_isolated flag would be a good first step to try and narrow down root causes. Context: sometimes tests pass/fail depending on what ran before them. Memory corruption errors in particular might only cause noticeable issues later on. But you can also have the opposite, where "fixing" one test causes another to start failing. Usage: $ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit --run_isolated=suite $ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit --run_isolated=test $ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit --run_isolated=test example The last one would provide output like ======== [PASSED] example ======== [PASSED] example_simple_test ============================================================ Testing complete. 1 tests run. 0 failed. 0 crashed. 0 skipped. Starting KUnit Kernel (2/3)... ============================================================ ======== [SKIPPED] example ======== [SKIPPED] example_skip_test # SKIP this test should be skipped ============================================================ Testing complete. 1 tests run. 0 failed. 0 crashed. 1 skipped. Starting KUnit Kernel (3/3)... ============================================================ ======== [SKIPPED] example ======== [SKIPPED] example_mark_skipped_test # SKIP this test should be skipped ============================================================ Testing complete. 1 tests run. 0 failed. 0 crashed. 1 skipped. See the last patch's description for a bit more detail. Meta: The first patch is from another series with just a reworded commit message, https://lore.kernel.org/linux-kselftest/20210805235145.2528054-2-dlatypov@google.com/ This patch series is based on Shuah's kunit branch: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/?h=kunit Changes: v1 -> v2: rebase onto Shuah's kunit branch, fix missing code in patch 1. v2 -> v3: fix mypy errors, drop test plan from output, fix pre-existing bug where kunit was not actually tracking test execution time (new patch 3). v3 -> v4: attempt to filter out non-KUnit dmesg output when getting list of test names, using this regex: ^[^\s.]+\.[^\s.]+$ Daniel Latypov (4): kunit: add 'kunit.action' param to allow listing out tests kunit: tool: factor exec + parse steps into a function kunit: tool: actually track how long it took to run tests kunit: tool: support running each suite/test separately lib/kunit/executor.c | 45 ++++++++- tools/testing/kunit/kunit.py | 134 +++++++++++++++++-------- tools/testing/kunit/kunit_tool_test.py | 40 ++++++++ 3 files changed, 173 insertions(+), 46 deletions(-) base-commit: 3b29021ddd10cfb6b2565c623595bd3b02036f33 -- 2.33.0.800.g4c38ced690-goog