Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2889893imw; Wed, 6 Jul 2022 13:32:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u5vqNZ6U645wilHY9H0UIJJuA5dHGUQvYIYIdG8yGSSEhqMGyRNl3h+SHcRCTfMjbBulBA X-Received: by 2002:a63:88c3:0:b0:40d:5f26:bfa8 with SMTP id l186-20020a6388c3000000b0040d5f26bfa8mr35776694pgd.608.1657139536402; Wed, 06 Jul 2022 13:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657139536; cv=none; d=google.com; s=arc-20160816; b=S89Qg+G7nC9oCZzLr2KVbALgiRlJD3Azhlw9Tu13yQ1tisVT8mMCNVqmrSW+uqAe0a cyKJueJU1Wt+X03ITXqX5rXyseOoRPJ3HCeKeWXgKV64SlZzRC1/wXLxnaST0q5YpJdN Kj/3zrkq3g0GF5+Ag5In+oNoNbwedcMHtT0hUjFwrBSdz4d3rmE+mLbOoqoWkp1KNBsP IhUlMTI/f0PlF4aGGNqeW9+g5uVMweWWovaJ99m/VxnJVgi57lyogHjh8y/6sHo4t6Xt idIFJTDl+zEa3x3iZ+Ikn0BohcZtaTROHDNK+BY0aMgK46Z55W2vw9NUhSjPiizQvvLm MbLg== 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=s/tKQNx7+nrPdH0yxzOZpF+/pY4bKPXut4ezANEyBGU=; b=hnjVBpAgGrcUokKAg3ALCNhCjrrSyHEIV2EAs95C9KogPtdbgRCaxTCba8IQ16Y7en TEe0hmF7l7feqcoA0qC2U+XvlIzii+6cBP7CRTgt1JncqjO8GgRoUrngzrzN/XC/G0NM zZIBRWNmLUJyE4KkvHQ8CJD9BunIt69U3HpMv3msGy3QmEHos/Cz0th0XsEU1vnVD+gV u39EzaKviFsXnvayzhXIgvFy1gdAxRKt1xd5anOXDJw5dLdu/iOkkOTXqKPu3Dmr3GUv ISEhSFre0+yjFGEm9VT1WfrohhNyqBRJqOGl4veDf8Hv83QY73+F9i7k0aiXfCP2EjX9 unyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oMOR51YG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk6-20020a17090b4a0600b001eee0c42b51si34622876pjb.190.2022.07.06.13.32.03; Wed, 06 Jul 2022 13:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oMOR51YG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232212AbiGFUWf (ORCPT + 99 others); Wed, 6 Jul 2022 16:22:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbiGFUWe (ORCPT ); Wed, 6 Jul 2022 16:22:34 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D9F20F77 for ; Wed, 6 Jul 2022 13:22:33 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id q6so28929407eji.13 for ; Wed, 06 Jul 2022 13:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s/tKQNx7+nrPdH0yxzOZpF+/pY4bKPXut4ezANEyBGU=; b=oMOR51YGtPRJu9Q618/bSPmTNM5Kc8blSenFvdaztyvAeDeRRgmQqg32+u66QqI1hQ u/Svp9qcKsF7uxGLBv8+rfPpgqTW4lAhrg99nwwrefEfCm4zxEgyMf5m4l0dSUovqsDq BpDYuZr5FNGFCKsHvYz8qq4a8zYEiM+G6wVcc1YxsYPP+iGOnFo1y2zofhTZwERrGT7Q 1EowSTKxLPrkeT4815mrstyDFTrmzDMB8WqUYhVisDiIOHfh5RBNq3xnCcIf6ZWx/GMp 9SqYWYq7UV5GHAX+QquxVXWhfc0AttthcTH/vhBgZ2ujlsa/QXICbiJG8FOUqCMMK2qt qWqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s/tKQNx7+nrPdH0yxzOZpF+/pY4bKPXut4ezANEyBGU=; b=gYZw7SurUo3C0QqeVrm2Qkb+OqWBJjWBXqaCKWUbT//Cy/TfZfKVpJDdSIqkHLm7ng 8dOjxCYXpOHwF2JHt5gWa/c8BNmp2OYg7+GZ5NyoAIaN/9pgbwy2P/ThatXf5Q9+AXXM o7qFzLPOfjfVjMLHG9W/22qjPY/WQS0gp09bB7pYAVlPsBEwIU7NFSMdKUsvqZQ+//wH Kq8sp3iU0BbCM6QCij48kADf/MEyJLjw4K0hewIumSGzQmrS28W99ubmlek+bIA1QYDQ j/qWRgh867MXR83CUYEFwvuAc7OgHm1uCE4SUnZ3c/4O48kLsVZs3jjgzmjsJidoAHen gpMQ== X-Gm-Message-State: AJIora9gzRzUxGoG+YK/rEU+RQQlCrB2F331qwKFJciaJmf2sMq5Lihe STdqLkigV/0wM33uKYdqZoMap7THXxTKZpAUFs/d1m4RUq/IDGYw X-Received: by 2002:a17:906:cc96:b0:728:baf0:ba03 with SMTP id oq22-20020a170906cc9600b00728baf0ba03mr40255410ejb.52.1657138951883; Wed, 06 Jul 2022 13:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20220627221446.82157-1-dlatypov@google.com> In-Reply-To: <20220627221446.82157-1-dlatypov@google.com> From: Brendan Higgins Date: Wed, 6 Jul 2022 16:22:20 -0400 Message-ID: Subject: Re: [PATCH v3 1/3] kunit: tool: refactor internal kconfig handling, allow overriding To: Daniel Latypov Cc: davidgow@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 27, 2022 at 6:14 PM 'Daniel Latypov' via KUnit Development wrote: > > Currently, you cannot ovewrwrite what's in your kunitconfig via > --kconfig_add. > Nor can you override something in a qemu_config via either means. > > This patch makes it so we have this level of priority > * --kconfig_add > * kunitconfig file (the default or the one from --kunitconfig) > * qemu_config > > The rationale for this order is that the more "dynamic" sources of > kconfig options should take priority. > > --kconfig_add is obviously the most dynamic. > And for kunitconfig, users probably tweak the file manually or specify > --kunitconfig more often than they delve into qemu_config python files. > > And internally, we convert the kconfigs from a python list into a set or > dict fairly often. We should just use a dict internally. > We exposed the set transform in the past since we didn't define __eq__, > so also take the chance to shore up the kunit_kconfig.Kconfig interface. > > Example > ======= > > Let's consider the unrealistic example where someone would want to > disable CONFIG_KUNIT. > I.e. they run > $ ./tools/testing/kunit/kunit.py config --kconfig_add=CONFIG_KUNIT=n > > Before > ------ > We'd write the following > > # CONFIG_KUNIT is not set > > CONFIG_KUNIT_ALL_TESTS=y > > CONFIG_KUNIT_TEST=y > > CONFIG_KUNIT=y > > CONFIG_KUNIT_EXAMPLE_TEST=y > > And we'd error out with > > ERROR:root:Not all Kconfig options selected in kunitconfig were in the generated .config. > > This is probably due to unsatisfied dependencies. > > Missing: # CONFIG_KUNIT is not set > > After > ----- > We'd write the following > > # CONFIG_KUNIT is not set > > CONFIG_KUNIT_TEST=y > > CONFIG_KUNIT_ALL_TESTS=y > > CONFIG_KUNIT_EXAMPLE_TEST=y > > And we'd error out with > > ERROR:root:Not all Kconfig options selected in kunitconfig were in the generated .config. > > This is probably due to unsatisfied dependencies. > > Missing: CONFIG_KUNIT_EXAMPLE_TEST=y, CONFIG_KUNIT_TEST=y, CONFIG_KUNIT_ALL_TESTS=y > > Signed-off-by: Daniel Latypov > Reviewed-by: David Gow Reviewed-by: Brendan Higgins