File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments