From 5fcddafe237015a0bf9852dcf013b17fb3c6df2b Mon Sep 17 00:00:00 2001 From: Gyorgy Sarvari Date: Mon, 13 Apr 2026 16:42:35 +0200 Subject: [PATCH] python3-cbor2: return correct error code from run-ptest In case the test fails to even start executing, and there is no output on stdout, there are no logs stored of the test run, so the test log parser will not report a failure. Also, since the run-ptest command is a piped script, by default the last command's return code is set as the exit code, which is always 0. To report the result correctly return the test executions's return code as the exit code (instead of the last command in the pipe), and redirect the error output to standard out, to create a logfile that can be parsed after the execution. Signed-off-by: Gyorgy Sarvari --- meta-python/recipes-devtools/python/python3-cbor2/run-ptest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-python/recipes-devtools/python/python3-cbor2/run-ptest b/meta-python/recipes-devtools/python/python3-cbor2/run-ptest index b63c4de0d9..c951b418c5 100644 --- a/meta-python/recipes-devtools/python/python3-cbor2/run-ptest +++ b/meta-python/recipes-devtools/python/python3-cbor2/run-ptest @@ -1,3 +1,4 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +pytest -o log_cli=true -o log_cli_level=INFO 2>&1 | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +exit ${PIPESTATUS[0]}