public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC v1 0/6] kunit: Add test attributes API
@ 2023-06-10  0:51 Rae Moar
  2023-06-10  0:51 ` [RFC v1 1/6] kunit: Add test attributes API structure Rae Moar
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Rae Moar @ 2023-06-10  0:51 UTC (permalink / raw)
  To: shuah, davidgow, dlatypov, brendan.higgins
  Cc: linux-kselftest, kunit-dev, linux-kernel, keescook,
	linux-hardening, jstultz, tglx, sboyd, Rae Moar

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
particularly slow memcpy tests
(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.

Note that this could intersect with the discussions on how to format
test-associated data in KTAP v2 that I am also involved in
(https://lore.kernel.org/all/20230420205734.1288498-1-rmoar@google.com/).

If the overall idea seems good, I'll make sure to add tests/documentation,
and more patches marking existing tests as slow to the patch series.

Thanks!
Rae

Rae Moar (6):
  kunit: Add test attributes API structure
  kunit: Add speed 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

 include/kunit/attributes.h             |  41 ++++
 include/kunit/test.h                   |  62 ++++++
 kernel/time/time_test.c                |   2 +-
 lib/kunit/Makefile                     |   3 +-
 lib/kunit/attributes.c                 | 280 +++++++++++++++++++++++++
 lib/kunit/executor.c                   |  89 ++++++--
 lib/kunit/executor_test.c              |   8 +-
 lib/kunit/kunit-example-test.c         |   9 +
 lib/kunit/test.c                       |  17 +-
 lib/memcpy_kunit.c                     |   8 +-
 tools/testing/kunit/kunit.py           |  34 ++-
 tools/testing/kunit/kunit_kernel.py    |   6 +-
 tools/testing/kunit/kunit_tool_test.py |  41 ++--
 13 files changed, 536 insertions(+), 64 deletions(-)
 create mode 100644 include/kunit/attributes.h
 create mode 100644 lib/kunit/attributes.c


base-commit: fefdb43943c1a0d87e1b43ae4d03e5f9a1d058f4
-- 
2.41.0.162.gfafddb0af9-goog


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-06-13 20:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-10  0:51 [RFC v1 0/6] kunit: Add test attributes API Rae Moar
2023-06-10  0:51 ` [RFC v1 1/6] kunit: Add test attributes API structure Rae Moar
2023-06-10  8:29   ` David Gow
2023-06-13 20:36     ` Rae Moar
2023-06-10  0:51 ` [RFC v1 2/6] kunit: Add speed attribute Rae Moar
2023-06-10  8:29   ` David Gow
2023-06-13 20:37     ` Rae Moar
2023-06-10  0:51 ` [RFC v1 3/6] kunit: Add ability to filter attributes Rae Moar
2023-06-10  8:29   ` David Gow
2023-06-13 20:42     ` Rae Moar
2023-06-13 20:26   ` Kees Cook
2023-06-13 20:58     ` Rae Moar
2023-06-10  0:51 ` [RFC v1 4/6] kunit: tool: Add command line interface to filter and report attributes Rae Moar
2023-06-10  8:29   ` David Gow
2023-06-13 20:44     ` Rae Moar
2023-06-10  0:51 ` [RFC v1 5/6] kunit: memcpy: Mark tests as slow using test attributes Rae Moar
2023-06-10  8:29   ` David Gow
2023-06-13 20:44     ` Rae Moar
2023-06-10  0:51 ` [RFC v1 6/6] kunit: time: Mark test " Rae Moar
2023-06-10  8:29 ` [RFC v1 0/6] kunit: Add test attributes API David Gow
2023-06-13 20:34   ` Rae Moar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox