kunit: tool: refactor how we plumb metadata into JSON
authorDaniel Latypov <dlatypov@google.com>
Thu, 24 Feb 2022 19:20:35 +0000 (11:20 -0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 4 Apr 2022 21:22:23 +0000 (15:22 -0600)
commitee96d25f2fa657a29ab59345898dc4ff616cfe84
tree46d4bd7b0451b2f7f63d4cf9f89fac478e750446
parent6bd0f52ee8f400a558f1c0f33e1f3fd3ef4922a8
kunit: tool: refactor how we plumb metadata into JSON

When using --json, kunit.py run/exec/parse will produce results in
KernelCI json format.
As part of that, we include the build_dir that was used, and we
(incorrectly) hardcode in the arch, etc.

We'll want a way to plumb more values (as well as the correct `arch`),
so this patch groups those fields into kunit_json.Metadata type.
This patch should have no user visible changes.

And since we only used build_dir in KunitParseRequest for json, we can
now move it out of that struct and add it into KunitExecRequest, which
needs it and used to get it via inheritance.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/kunit/kunit.py
tools/testing/kunit/kunit_json.py
tools/testing/kunit/kunit_tool_test.py