From 1880e771a8b385615c6f97fc5282f0c11d599185 Mon Sep 17 00:00:00 2001 From: nabim777 Date: Fri, 12 Sep 2025 14:56:39 +0545 Subject: [PATCH 1/2] fix: correct regex on test script Signed-off-by: nabim777 --- tests/acceptance/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/run.sh b/tests/acceptance/run.sh index 85d9b0bc6eb..c8cf35a2bd1 100755 --- a/tests/acceptance/run.sh +++ b/tests/acceptance/run.sh @@ -264,7 +264,7 @@ function run_behat_tests() { # Thanks to https://en.wikipedia.org/wiki/Tee_(command) and # https://stackoverflow.com/questions/23416278/how-to-strip-ansi-escape-sequences-from-a-variable # for ideas. - FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b[^m]*m//g") + FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b\[[0-9;]*m//g" | sed 's/\(\.feature:[0-9]\+\).*/\1/') # If something else went wrong, and there were no failed scenarios, # then the awk, grep, sed command sequence above ends up with an empty string. From 0ade14c0e33267cb8863c84e5243b771b856cb6f Mon Sep 17 00:00:00 2001 From: nabim777 Date: Mon, 15 Sep 2025 16:33:13 +0545 Subject: [PATCH 2/2] tests: add comment for behat output format handling Signed-off-by: nabim777 --- tests/acceptance/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/acceptance/run.sh b/tests/acceptance/run.sh index c8cf35a2bd1..8e62f2efd12 100755 --- a/tests/acceptance/run.sh +++ b/tests/acceptance/run.sh @@ -261,6 +261,7 @@ function run_behat_tests() { FAILED_SCENARIO_PATHS_COLORED=`awk '/Failed scenarios:/',0 ${TEST_LOG_FILE} | grep -a feature` # There will be some ANSI escape codes for color in the FEATURE_COLORED var. # Strip them out so we can pass just the ordinary feature details to Behat. + # Also strip everything after ".feature:XX", including text such as "(on line xx)" added by Behat indicating the failing step's line number. # Thanks to https://en.wikipedia.org/wiki/Tee_(command) and # https://stackoverflow.com/questions/23416278/how-to-strip-ansi-escape-sequences-from-a-variable # for ideas.