]> git.baikalelectronics.ru Git - kernel.git/commit
kunit: tool: readability tweaks in KernelCI json generation logic
authorDaniel Latypov <dlatypov@google.com>
Thu, 24 Feb 2022 19:20:34 +0000 (11:20 -0800)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 4 Apr 2022 21:22:15 +0000 (15:22 -0600)
commit96a96478f7f514e39e90ac0c2ef733eb9129a085
tree8210d2242ae24a20470156e0af67a700e2c5fe90
parentc2a4cb29370cc7e24264bae2e8af6aef66ed1de4
kunit: tool: readability tweaks in KernelCI json generation logic

Use a more idiomatic check that a list is non-empty (`if mylist:`) and
simplify the function body by dedenting and using a dict to map between
the kunit TestStatus enum => KernelCI json status string.

The dict hopefully makes it less likely to have bugs like commit
86275f7ec5de ("kunit: tool: fix --json output for skipped tests").

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_json.py