Skip to content

Conversation

@prashant-gurung899
Copy link
Contributor

@prashant-gurung899 prashant-gurung899 commented Sep 15, 2025

Description

This PR reverts the behat version that was changed as temporary fix in this PR
And also fixes the regex to display the line number of failed tests -> A new feature introduced by Behat in 3.24.0.
New format in v3.24.0:

coreApiAuth/webDavMKCOLAuth.feature:42 (on line 50)

Previous versions v3.13:

coreApiAuth/webDavMKCOLAuth.feature:42

So this PR adds another sed command that removes everything after .feature:X, including the new (on line X) text.

Related Issue

Motivation and Context

How Has This Been Tested?

  • 🤖

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added

# 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/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why you have changed the first regex, but I think we can make the second easier to read and the whole thing easier to understand

Suggested change
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b\[[0-9;]*m//g" | sed 's/\(\.feature:[0-9]\+\).*/\1/')
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS_COLORED}" | sed "s/\x1b[^m]*m//g")
# some comment that explains what happens here, because the above comment only talks about the color codes
FAILED_SCENARIO_PATHS=$(echo "${FAILED_SCENARIO_PATHS}" | sed 's/\(on line \d+\)//')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both made easier to read ✔️

Copy link
Contributor Author

@prashant-gurung899 prashant-gurung899 Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That didnt work so sticking with the earlier regex pattern i.e. sed 's/\(\.feature:[0-9]\+\).*/\1/' that just get rids of everything after *.feature:55.
Please, re-review @individual-it

@individual-it
Copy link
Contributor

I don't think it worked as intended

@prashant-gurung899
Copy link
Contributor Author

I don't think it worked as intended

Hmmmm. I dont think the failures are because of Behat. Restarted the build.

@prashant-gurung899 prashant-gurung899 force-pushed the update-script branch 2 times, most recently from 20be11b to ce76750 Compare September 15, 2025 10:41
@prashant-gurung899
Copy link
Contributor Author

Converting to draft. The sed command is not working as expected.
Will re-request for review again later.
CC @individual-it

Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
@prashant-gurung899 prashant-gurung899 merged commit 0410c15 into main Sep 16, 2025
99 checks passed
@prashant-gurung899 prashant-gurung899 deleted the update-script branch September 16, 2025 06:33
@openclouders openclouders mentioned this pull request Sep 16, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update script to support Behat’s new failing line number output

3 participants