Skip to content

Commit eeb72e7

Browse files
authored
Merge pull request #11653 from owncloud/tests/backport-fix-test-script
[tests-only][full-ci] Backport 7.2 / fix the correct regex on test script
2 parents 5e6fdc2 + 5b8203c commit eeb72e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/acceptance/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,11 @@ function run_behat_tests() {
261261
FAILED_SCENARIO_PATHS_COLORED=`awk '/Failed scenarios:/',0 ${TEST_LOG_FILE} | grep -a feature`
262262
# There will be some ANSI escape codes for color in the FEATURE_COLORED var.
263263
# Strip them out so we can pass just the ordinary feature details to Behat.
264+
# Also strip everything after ".feature:XX", including text such as "(on line xx)" added by Behat indicating the failing step's line number.
264265
# Thanks to https://en.wikipedia.org/wiki/Tee_(command) and
265266
# https://stackoverflow.com/questions/23416278/how-to-strip-ansi-escape-sequences-from-a-variable
266267
# for ideas.
267-
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b[^m]*m//g")
268+
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b\[[0-9;]*m//g" | sed 's/\(\.feature:[0-9]\+\).*/\1/')
268269

269270
# If something else went wrong, and there were no failed scenarios,
270271
# then the awk, grep, sed command sequence above ends up with an empty string.

0 commit comments

Comments
 (0)