From 0db1d6b5da514f05af0a45a1f1edf3d36b8cb5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <323649642+oc-tmueller@users.noreply.github.com> Date: Fri, 23 Oct 2026 10:54:56 +0200 Subject: [PATCH] test: match expected failures that Behat reports with a line suffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Behat can print a failed scenario as 'features/suite/file.feature:9 (on line 15)'. Behat 3.34 does so for every failed scenario, where 3.13 printed the bare path. run.sh checks that every listed expected failure really failed by grepping for the path at the end of the line, so with Behat 3.34 each expected failure was reported as 'expected to fail but did not fail' and the run failed. Allow the optional suffix, keeping file.feature:9 distinct from file.feature:902. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com> --- tests/acceptance/run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/run.sh b/tests/acceptance/run.sh index 0411904dba5..bc6815a42c8 100755 --- a/tests/acceptance/run.sh +++ b/tests/acceptance/run.sh @@ -565,9 +565,12 @@ function run_behat_tests() { # FAILED_SCENARIO_PATHS - for example looking for apiComments/comments.feature:9 # we want to match lines like: # tests/acceptance/features/apiComments/comments.feature:9 + # tests/acceptance/features/apiComments/comments.feature:9 (on line 15) # but not lines like:: # tests/acceptance/features/apiComments/comments.feature:902 - echo "${FAILED_SCENARIO_PATHS}" | grep ${SUITE_SCENARIO}$ > /dev/null + # Behat can append " (on line N)", the line of the failed step: 3.34 does it + # for every failed scenario, while 3.13 printed these paths without it. + echo "${FAILED_SCENARIO_PATHS}" | grep -E "${SUITE_SCENARIO}( [(]on line [0-9]+[)])?$" > /dev/null if [ $? -ne 0 ] then echo "Info: Scenario ${SUITE_SCENARIO} was expected to fail but did not fail."