kunit: tool: fix --json output for skipped tests
authorDaniel Latypov <dlatypov@google.com>
Fri, 8 Oct 2021 23:24:21 +0000 (16:24 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 13 Dec 2021 20:33:30 +0000 (13:33 -0700)
commit9a6bb30a8830bb868b09629f0b9ad5d2b5fbb2f9
tree171bcc821de7a81b98a7d4a3d79d0b217be20684
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
kunit: tool: fix --json output for skipped tests

Currently, KUnit will report SKIPPED tests as having failed if one uses
--json.

Add the missing if statement to set the appropriate status ("SKIP").
See https://api.kernelci.org/schema-test-case.html:
  "status": {
      "type": "string",
      "description": "The status of the execution of this test case",
      "enum": ["PASS", "FAIL", "SKIP", "ERROR"],
      "default": "PASS"
  },
with this, we now can properly produce all four of the statuses.

Fixes: 5acaf6031f53 ("kunit: tool: Support skipped tests in kunit_tool")
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
tools/testing/kunit/kunit_tool_test.py