All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rae Moar <rmoar@google.com>
To: shuah@kernel.org, davidgow@google.com, dlatypov@google.com,
	brendan.higgins@linux.dev
Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org, keescook@chromium.org,
	linux-hardening@vger.kernel.org, jstultz@google.com,
	tglx@linutronix.de, sboyd@kernel.org, Rae Moar <rmoar@google.com>
Subject: [RFC v2 0/9] kunit: Add test attributes API
Date: Fri,  7 Jul 2023 21:09:38 +0000	[thread overview]
Message-ID: <20230707210947.1208717-1-rmoar@google.com> (raw)

Hello everyone,

This is an RFC patch series to propose the addition of a test attributes
framework to KUnit.

There has been interest in filtering out "slow" KUnit tests. Most notably,
a new config, CONFIG_MEMCPY_SLOW_KUNIT_TEST, has been added to exclude a
particularly slow memcpy test
(https://lore.kernel.org/all/20230118200653.give.574-kees@kernel.org/).

This proposed attributes framework would be used to save and access test
associated data, including whether a test is slow. These attributes would
be reportable (via KTAP and command line output) and some will be
filterable.

This framework is designed to allow for the addition of other attributes in
the future. These attributes could include whether the test is flaky,
associated test files, etc.

This is the second version of the RFC I have added a few big changes:
- Change method for inputting filters to allow for spaces in filtering
  values
- Add option to skip filtered tests instead of not run or show them with
  the --filter_skip flag
- Separate the new feature to list tests and their attributes into both
  --list_tests (lists just tests) and --list_tests_attr (lists all)
- Add new attribute to store module name associated with test
- Add Tests to executor_test.c
- Add Documentation
- A few small changes to code commented on previously

I would love to hear about the new features. If the series seems overall
good I will send out the next version as an official patch series.

Thanks!
Rae

Rae Moar (9):
  kunit: Add test attributes API structure
  kunit: Add speed attribute
  kunit: Add module attribute
  kunit: Add ability to filter attributes
  kunit: tool: Add command line interface to filter and report
    attributes
  kunit: memcpy: Mark tests as slow using test attributes
  kunit: time: Mark test as slow using test attributes
  kunit: add tests for filtering attributes
  kunit: Add documentation of KUnit test attributes

 .../dev-tools/kunit/running_tips.rst          | 163 +++++++
 include/kunit/attributes.h                    |  50 +++
 include/kunit/test.h                          |  68 ++-
 kernel/time/time_test.c                       |   2 +-
 lib/Kconfig.debug                             |   3 +
 lib/kunit/Makefile                            |   3 +-
 lib/kunit/attributes.c                        | 406 ++++++++++++++++++
 lib/kunit/executor.c                          | 115 ++++-
 lib/kunit/executor_test.c                     | 119 ++++-
 lib/kunit/kunit-example-test.c                |   9 +
 lib/kunit/test.c                              |  27 +-
 lib/memcpy_kunit.c                            |   8 +-
 tools/testing/kunit/kunit.py                  |  80 +++-
 tools/testing/kunit/kunit_kernel.py           |   6 +-
 tools/testing/kunit/kunit_tool_test.py        |  39 +-
 15 files changed, 1022 insertions(+), 76 deletions(-)
 create mode 100644 include/kunit/attributes.h
 create mode 100644 lib/kunit/attributes.c


base-commit: 2e66833579ed759d7b7da1a8f07eb727ec6e80db
-- 
2.41.0.255.g8b1d071c50-goog


             reply	other threads:[~2023-07-07 21:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 21:09 Rae Moar [this message]
2023-07-07 21:09 ` [RFC v2 1/9] kunit: Add test attributes API structure Rae Moar
2023-07-18  7:38   ` David Gow
2023-07-18 21:01     ` Rae Moar
2023-07-19  8:31       ` David Gow
2023-07-07 21:09 ` [RFC v2 2/9] kunit: Add speed attribute Rae Moar
2023-07-18  7:38   ` David Gow
2023-07-18 18:31     ` Rae Moar
2023-07-07 21:09 ` [RFC v2 3/9] kunit: Add module attribute Rae Moar
2023-07-18  7:39   ` David Gow
2023-07-07 21:09 ` [RFC v2 4/9] kunit: Add ability to filter attributes Rae Moar
2023-07-18  7:39   ` David Gow
2023-07-18 20:40     ` Rae Moar
2023-07-07 21:09 ` [RFC v2 5/9] kunit: tool: Add command line interface to filter and report attributes Rae Moar
2023-07-18  7:39   ` David Gow
2023-07-18 20:42     ` Rae Moar
2023-07-07 21:09 ` [RFC v2 6/9] kunit: memcpy: Mark tests as slow using test attributes Rae Moar
2023-07-13  1:28   ` Kees Cook
2023-07-07 21:09 ` [RFC v2 7/9] kunit: time: Mark test " Rae Moar
2023-07-18  7:39   ` David Gow
2023-07-07 21:09 ` [RFC v2 8/9] kunit: add tests for filtering attributes Rae Moar
2023-07-10 18:07   ` Daniel Latypov
2023-07-12 21:24     ` Rae Moar
2023-07-07 21:09 ` [RFC v2 9/9] kunit: Add documentation of KUnit test attributes Rae Moar
2023-07-18  7:39   ` David Gow
2023-07-18 20:49     ` Rae Moar
2023-07-19  8:31       ` David Gow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230707210947.1208717-1-rmoar@google.com \
    --to=rmoar@google.com \
    --cc=brendan.higgins@linux.dev \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=jstultz@google.com \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.