Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp165691yba; Thu, 2 May 2019 22:41:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVNfEiPOWczQEnuxcvm7ny8txlmjOa2bxqG3X4m0bUnZXvrNrg3v1fVqQ/ghn9WiwKkuiu X-Received: by 2002:a63:4a5a:: with SMTP id j26mr7729025pgl.361.1556862102090; Thu, 02 May 2019 22:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556862102; cv=none; d=google.com; s=arc-20160816; b=MVSiIOcZgSe0B4SGDRUQdBZ6CuNnQo7pfbnbTx7b5om9UuG/C7zHoL5c4Mvfoh4+k+ sLg9BS4hqHH71TESIVs9exkl1yVXUhaGPmdXan3PgKUPzWs23koLGeaHAHHjxzu3gigK W5qRveY/JvDVxZ5JzLLbjkTeOmjOrL38kECXcR3nYZCJlPo5L55meZNQJRzdC+Bua91u vrizcNd9mDkSRWxEIVLuZj+RY2qVsgtj5cAtVwmDtI8K9WiBfA/I/mRm6FTzfZoGLgFo 9+UoM/reASSL17MoCUC4gMI8x+NkRXjJQr9d4twvE/xa0vPZhogMrSECHKYlpVCZRaXH FIfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kZWOLSmvOPvmN0LeT+tozEpaTTHy3QTyz4qZIAIbmM0=; b=SASZ0yGPpHG47Iz8gRX5oYfUfbLRVNA/VWUiJWoBRjbPmpqqTM2fdisRcbrFZoNEPa GJgRVWZbd2oiJIwLI9eTSoirvKGw73L0DcXg5NNhkZGgs3Pk4X2Chp/F+to9gomrZ16h dHwbZQSRG7zaUi2K6AaarhFG+X3XSzrVkwkp1a2GVfc6kLwBEgwX6ZmzfWZzC0z1aYQL EpbI3OTwrujr4/Z960XVBGjW6JCvrNubeXFUgjz3QUnWw2dD3vH3XZBg/83YywNo1OiP PfzC6dtk7Bpg9ANnJtS2Z6S0yzvARsCgo8864E77QsvLHfmPBNmmEzMTsYv1pzXvRtoD xRwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=N7EFpotF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id q1si1223701plr.14.2019.05.02.22.41.26; Thu, 02 May 2019 22:41:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=N7EFpotF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726396AbfECFgQ (ORCPT + 99 others); Fri, 3 May 2019 01:36:16 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:45192 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbfECFgQ (ORCPT ); Fri, 3 May 2019 01:36:16 -0400 Received: by mail-oi1-f195.google.com with SMTP id t189so3495395oih.12 for ; Thu, 02 May 2019 22:36:15 -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=kZWOLSmvOPvmN0LeT+tozEpaTTHy3QTyz4qZIAIbmM0=; b=N7EFpotFYGg4C2sBd5zzI2avRwh3PPTx3fD4+H7oEJe8ZfsOy0kgGpfPxkA4zmoBx2 jJNqMAkUJ8FNDn54/se4qXPA6zQHWWw/V/DPcF5SExi470sZ3c8qBLiDASkBwv7VdzOj SIqPwQSNWmticSh9jNC2HhIJfL5ALhPh6L2T+GBBW/bRLFZagZUXqj/PNkxkLIxfW03w 8JzD9/K8cjzuKxhXhpNfz0za/Y8NKzXa71tNWqgRxrVxR+QCApC61zPI5B6tTTYCJtpa TLr3KchoBTwIZnnrkZI2Ja4yZyY/3yr3UmYGVA3EV+h8Wvpgczoumb123yy7Tncadwh5 ZKZw== 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=kZWOLSmvOPvmN0LeT+tozEpaTTHy3QTyz4qZIAIbmM0=; b=RHORqK8RI53n+4vvbGwTRO9fp+xH9F08XxicN/pVHoGroYu+h1c3EEidjmthqUQAyK 1FeV4alVuvQLjx9e/rORz0ERo9H8PFwHqZs6dSVEy3EjyfcKv9O41k03swFfTlWayL5N eKtW6NK1M2ngo5H8kdAnu8J8aDDrDg+uRWJsg7+tKsgAbfPKCCwbGCrv1Dp6KLuvlIeE 8sukQL6GJvTb5oMTKErQuSA/YZ9ngfJObocOzZoWjm6yl21tIkdTbCx3RD75tkELru+p Vo431+s2xNgkMQDi6YtD20uKGbbfjxY9g4pr5LknWtvZlPDSjq+uI+jv8NicI3OXZgVJ qHVw== X-Gm-Message-State: APjAAAVsQVwIfR/kOdsgdISCrqK+lyetHdpvrK8VnrQSr+OjSnTrUfx1 bYn/BQpXX3Dqa5FMtuqUoHFGXSPRezdQ3DO1PpnYTQ== X-Received: by 2002:aca:4586:: with SMTP id s128mr4643568oia.148.1556861774441; Thu, 02 May 2019 22:36:14 -0700 (PDT) MIME-Version: 1.0 References: <20190501230126.229218-1-brendanhiggins@google.com> <20190501230126.229218-13-brendanhiggins@google.com> <20190502110220.GD12416@kroah.com> <1a5f3c44-9fa9-d423-66bf-45255a90c468@gmail.com> In-Reply-To: <1a5f3c44-9fa9-d423-66bf-45255a90c468@gmail.com> From: Brendan Higgins Date: Thu, 2 May 2019 22:36:03 -0700 Message-ID: Subject: Re: [PATCH v2 12/17] kunit: tool: add Python wrappers for running KUnit tests To: Frank Rowand Cc: Greg KH , Kees Cook , Kieran Bingham , Luis Chamberlain , Rob Herring , Stephen Boyd , shuah@kernel.org, devicetree , dri-devel , kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, Linux Kernel Mailing List , linux-kselftest@vger.kernel.org, linux-nvdimm , linux-um@lists.infradead.org, Sasha Levin , "Bird, Timothy" , Amir Goldstein , Dan Carpenter , Dan Williams , Daniel Vetter , Jeff Dike , Joel Stanley , Julia Lawall , Kevin Hilman , Knut Omang , Logan Gunthorpe , Michael Ellerman , Petr Mladek , Richard Weinberger , David Rientjes , Steven Rostedt , wfg@linux.intel.com, Felix Guo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 2, 2019 at 6:45 PM Frank Rowand wrote: > > On 5/2/19 4:45 PM, Brendan Higgins wrote: > > On Thu, May 2, 2019 at 2:16 PM Frank Rowand wrote: > >> > >> On 5/2/19 11:07 AM, Brendan Higgins wrote: > >>> On Thu, May 2, 2019 at 4:02 AM Greg KH wrote: > >>>> > >>>> On Wed, May 01, 2019 at 04:01:21PM -0700, Brendan Higgins wrote: > >>>>> From: Felix Guo > >>>>> > >>>>> The ultimate goal is to create minimal isolated test binaries; in the > >>>>> meantime we are using UML to provide the infrastructure to run tests, so > >>>>> define an abstract way to configure and run tests that allow us to > >>>>> change the context in which tests are built without affecting the user. > >>>>> This also makes pretty and dynamic error reporting, and a lot of other > >>>>> nice features easier. > >>>>> > >>>>> kunit_config.py: > >>>>> - parse .config and Kconfig files. > >>>>> > >>>>> kunit_kernel.py: provides helper functions to: > >>>>> - configure the kernel using kunitconfig. > >>>>> - build the kernel with the appropriate configuration. > >>>>> - provide function to invoke the kernel and stream the output back. > >>>>> > >>>>> Signed-off-by: Felix Guo > >>>>> Signed-off-by: Brendan Higgins > >>>> > >>>> Ah, here's probably my answer to my previous logging format question, > >>>> right? What's the chance that these wrappers output stuff in a standard > >>>> format that test-framework-tools can already parse? :) > > > > To be clear, the test-framework-tools format we are talking about is > > TAP13[1], correct? > > I'm not sure what the test community prefers for a format. I'll let them > jump in and debate that question. > > > > > > My understanding is that is what kselftest is being converted to use. > > > >>> > >>> It should be pretty easy to do. I had some patches that pack up the > >>> results into a serialized format for a presubmit service; it should be > >>> pretty straightforward to take the same logic and just change the > >>> output format. > >> > >> When examining and trying out the previous versions of the patch I found > >> the wrappers useful to provide information about how to control and use > >> the tests, but I had no interest in using the scripts as they do not > >> fit in with my personal environment and workflow. > >> > >> In the previous versions of the patch, these helper scripts are optional, > >> which is good for my use case. If the helper scripts are required to > > > > They are still optional. > > > >> get the data into the proper format then the scripts are not quite so > >> optional, they become the expected environment. I think the proper > >> format should exist without the helper scripts. > > > > That's a good point. A couple things, > > > > First off, supporting TAP13, either in the kernel or the wrapper > > script is not hard, but I don't think that is the real issue that you > > raise. > > > > If your only concern is that you will always be able to have human > > readable KUnit results printed to the kernel log, that is a guarantee > > I feel comfortable making. Beyond that, I think it is going to take a > > long while before I would feel comfortable guaranteeing anything about > > how will KUnit work, what kind of data it will want to expose, and how > > it will be organized. I think the wrapper script provides a nice > > facade that I can maintain, can mediate between the implementation > > details and the user, and can mediate between the implementation > > details and other pieces of software that might want to consume > > results. > > > > [1] https://testanything.org/tap-version-13-specification.html > > My concern is based on a focus on my little part of the world > (which in _previous_ versions of the patch series was the devicetree > unittest.c tests being converted to use the kunit infrastructure). > If I step back and think of the entire kernel globally I may end > up with a different conclusion - but I'm going to remain myopic > for this email. > > I want the test results to be usable by me and my fellow > developers. I prefer that the test results be easily accessible > (current printk() implementation means that kunit messages are > just as accessible as the current unittest.c printk() output). > If the printk() output needs to be filtered through a script > to generate the actual test results then that is sub-optimal > to me. It is one more step added to my workflow. And > potentially with an embedded target a major pain to get a > data file (the kernel log file) transferred from a target > to my development host. That's fair. If that is indeed your only concern, then I don't think the wrapper script will ever be an issue for you. You will always be able to execute a given test the old fashioned/manual way, and the wrapper script only summarizes results, it does not change the contents. > > I want a reported test failure to be easy to trace back to the > point in the source where the failure is reported. With printk() > the search is a simple grep for the failure message. If the > failure message has been processed by a script, and then the > failure reported to me in an email, then I may have to look > at the script to reverse engineer how the original failure > message was transformed into the message that was reported > to me in the email. Then I search for the point in the > source where the failure is reported. So a basic task has > just become more difficult and time consuming. That seems to be a valid concern. I would reiterate that you shouldn't be concerned by any processing done by the wrapper script itself, but the reality is that depending on what happens with automated testing/presubmit/CI other people might end up parsing and transforming test results - it might happen, it might not. I currently have a CI system set up for KUnit on my public repo that I don't think you would be offended by, but I don't know what we are going to do when it comes time to integrate with existing upstream CI systems. In anycase, I don't think that either sticking with or doing away with the wrapper script is going to have any long term bearing on what happens in this regard. Cheers