kunit: kunit_tool: Fix invalid result when build fails
PATCH 1/1 kunit: kunit_tool: Fix invalid result when build fails
When separating out different phases of running tests[1] (build/exec/parse/etc), the format of the KunitResult tuple changed (adding an elapsed_time variable). This is not populated during a build failure, causing kunit.py to crash.
This fixes [1] to probably populate the result variable, causing a failing build to be reported properly.
--- tools/testing/kunit/kunit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/testing/kunit/kunit.py +3 -1
@@ -82,7 +82,9 @@ def build_tests(linux: kunit_kernel.LinuxSourceTree, request.make_options) build_end = time.time() if not success: - return KunitResult(KunitStatus.BUILD_FAILURE, 'could not build kernel') + return KunitResult(KunitStatus.BUILD_FAILURE, + 'could not build kernel', + build_end - build_start) if not success: return KunitResult(KunitStatus.BUILD_FAILURE, 'could not build kernel',
Signature · 1 line
2.27.0.290.gba653c62da-goog
Quoted 6 lines · David Gow
When separating out different phases of running tests[1] (build/exec/parse/etc), the format of the KunitResult tuple changed (adding an
elapsed_timevariable). This is not populated during a build failure, causingkunit.pyto crash.
Quoted 7 lines
This fixes [1] to probably populate the result variable, causing a failing build to be reported properly.
Signed-off-by David Gow <[email protected]>
Oh wow! This is an old issue.
Nice work!