Skip to content

ci: fix exclude regex handling in linux sanitizer workflow#6799

Merged
hkaiser merged 1 commit intoTheHPXProject:masterfrom
ArivoliR:fix-linux-sanitizer
Nov 11, 2025
Merged

ci: fix exclude regex handling in linux sanitizer workflow#6799
hkaiser merged 1 commit intoTheHPXProject:masterfrom
ArivoliR:fix-linux-sanitizer

Conversation

@ArivoliR
Copy link
Copy Markdown
Contributor

@ArivoliR ArivoliR commented Nov 10, 2025

Fixes CI failure that was caused by a test that was meant to be excluded.

Proposed Changes

Replaces the broken multiline --exclude-regex command in the Linux sanitizer workflow with a proper Bash variable construction.
Concatenates both test names (transpose_block_numa and 1d_wave_equation) into a single $EXCLUDE variable before calling ctest.

Any background context you want to provide?

The test tests.examples.quickstart.1d_wave_equation was intended to be excluded from the sanitizer workflow but was still being executed and failing in CI due to a broken exclude regex.

Checklist

  • Verified CI workflow changes.

@ArivoliR ArivoliR requested a review from hkaiser as a code owner November 10, 2025 19:06
@StellarBot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@hkaiser
Copy link
Copy Markdown
Contributor

hkaiser commented Nov 10, 2025

Wouldn't a similar change be needed for the other CIs that explude some of the tests as well? Also, could you please elaborate why the original regex was 'broken'?

@ArivoliR
Copy link
Copy Markdown
Contributor Author

The issue arises from Linux shells having the following behaviour:

➜  workflows git:(master) echo "tests.examples.quickstart.1d_wave_equation|\
                                tests.examples.transpose.transpose_block_numa"
tests.examples.quickstart.1d_wave_equation|				tests.examples.transpose.transpose_block_numa

When a |\ continuation is followed by indentation or spaces, bash on linux preserves those spaces as literal characters inside the string rather than treating it as a true line continuation. This causes the actual regex passed to ctest to contain unintended whitespace, because of which all the tests except the first line of the multi line regex are skipped.

This issue does not arise in macOS workflows. I think this is because the macos shell handles the indentations by trimming it and concatenating the lines unlike the linux shell.

The new approach of code that I've written, using a variable ensures all patterns are concatenated into a single string before execution, independent of shell behavior.

          EXCLUDE="tests.examples.transpose.transpose_block_numa|"
          EXCLUDE+="tests.examples.quickstart.1d_wave_equation"

I’ve checked the other CI workflows and most of them use single-line --exclude-regex definitions and are unaffected. This issue only occurs in workflows that use multi-line regex on linux workflows.

Please do let me know if you’d like me to apply the same change to the macOS workflow files as well, so that all CI setups stay consistent and work the same way across systems.

@ArivoliR
Copy link
Copy Markdown
Contributor Author

I noticed that in linux_release_static.yml, multiple --exclude-regex flags are used separately instead of a multiline call, and that approach seems to work reliably. Would you prefer I update this workflow to follow that pattern instead?

            --exclude-regex tests.examples.transpose.transpose_block_numa \
            --exclude-regex tests.examples.quickstart.hello_world_1 \
            --exclude-regex tests.examples.quickstart.distributed.tcp.custom_serialization

@ArivoliR ArivoliR changed the title ci: fix exclude regex handling in sanitizer workflow ci: fix exclude regex handling in linux sanitizer workflow Nov 10, 2025
@hkaiser
Copy link
Copy Markdown
Contributor

hkaiser commented Nov 10, 2025

When a |\ continuation is followed by indentation or spaces, bash on linux preserves those spaces as literal characters inside the string rather than treating it as a true line continuation. This causes the actual regex passed to ctest to contain unintended whitespace, because of which all the tests except the first line of the multi line regex are skipped.

Urgs - excellent catch. It seems to be a 'feature' of the github action yml parser as it works just fine on the CircleCI environment.

I noticed that in linux_release_static.yml, multiple --exclude-regex flags are used separately instead of a multiline call, and that approach seems to work reliably. Would you prefer I update this workflow to follow that pattern instead?

Yes, that seems to be a good idea! Thanks!

Signed-off-by: ArivoliR <arivoli2005@gmail.com>
@ArivoliR ArivoliR force-pushed the fix-linux-sanitizer branch from d7b1ece to 99bf5de Compare November 10, 2025 22:45
Copy link
Copy Markdown
Contributor

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ArivoliR
Copy link
Copy Markdown
Contributor Author

Urgs - excellent catch. It seems to be a 'feature' of the github action yml parser as it works just fine on the CircleCI environment.

The macOS workflow behavior still doesn't seem to add up. For example:

            --exclude-regex \
          "tests.examples.quickstart.1d_wave_equation|\
          tests.examples.transpose.transpose_block_numa|\
          tests.performance.local.wait_all_timings|\
          ...

in macos_debug_fetch_boost works perfectly fine, with the intended test properly excluded. Could it be that the github action yaml parser works differently for macOS and linux?

I’ve updated the workflow to use separate --exclude-regex flags as discussed. Thank you for your quick response!

@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.95%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (afcbb5b) 273067 235146 86.11%
Head commit (99bf5de) 195028 (-78039) 166101 (-69045) 85.17% (-0.95%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6799) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@hkaiser hkaiser merged commit 87f7e5f into TheHPXProject:master Nov 11, 2025
75 checks passed
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.

3 participants