Fix macOS CI: replace GNU-only grep -P with POSIX-compatible awk/grep -E in Stage 3#77
Conversation
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Chris-Wolfgang
left a comment
There was a problem hiding this comment.
@copilot since it was working on step 1 and 2 do we just need to update step 3 on the mac?
You're correct — the actual failure was only in Stage 3 (macOS). Lines 706–707 were the ones running on Lines 150, 201, and 266–267 are in Stage 1 ( |
Chris-Wolfgang
left a comment
There was a problem hiding this comment.
@copilot Can you put back the changes for step 1 and 2 and just leave 3
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Done. Reverted Stage 1/2 back to the original |
…overlet-collector-reference
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
…Stage 3 only Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
…fix-grep-issues-in-workflow
…-workflow Fix macOS grep -P incompatibility in Stage 3 coverage threshold enforcement (pr.yaml)
Description
macOS runners use BSD grep, which does not support
-P(Perl-compatible regex). Thegrep -oPusages in the Stage 3 macOS coverage gate inpr.yamlfail withinvalid option, breaking the coverage threshold enforcement step even when coverage is 100%. Stage 1 (Linux) and Stage 2 (Windows) were not affected — Linux uses GNU grep (which supports-P) and Windows uses PowerShell.Changes —
.github/workflows/pr.yamlgrep -oP '^[^ ]+'andgrep -oP '[0-9]+(?=%)'with POSIX-compatible alternatives that work on BSD grep:awk '{print $1}'grep -oE '[0-9]+%' | tail -1 | tr -d '%'Stage 1 and Stage 2 are unchanged and continue to use the original
grep -oPforms, which work correctly on their respectiveubuntu-latestandwindows-latestrunners.Type of change
How Has This Been Tested?
grep -oE+tr -d '%'produces identical output to the Perl lookahead variant on both GNU and BSD toolchainsChecklist
Screenshots (if applicable)
Additional context
No changes to test projects, coverage configuration, or any source code — only the Stage 3 macOS shell parser logic in the workflow was modified.
Original prompt
Stage 3 (macOS) for GitHub Actions CI fails on the coverage threshold enforcement step because the build script uses GNU-specific 'grep -P' (Perl regex support) and '-oP', which are not supported on macOS's BSD grep. As a result, parsing CoverageReport/Summary.txt fails with an invalid option error, and the pipeline exits with error code 2 even though coverage is 100%.
Solution:
No changes needed to test or coverage configuration — only Bash parser logic.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: check this repo
Assistant: Here's a summary of the repository Chris-Wolfgang/ETL-Abstractions:
If you need any details on its structure, current issues, CI configuration, or run into build/test errors, let me know and I can retrieve or investigate more specific information for you!
User: check that repo to determine why I am getting the no tests found error
Assistant: Your test project and files do exist in the repository—specifically, at
tests/Wolfgang.Etl.Abstractions.Tests.Unit/Wolfgang.Etl.Abstractions.Tests.Unit.csproj, and there are manyFactunit tests present.However, the recurring CI message "❌ No test projects found in ./tests directory!" points to a CI/CD script issue—not missing test files.
Root Cause Likely:
mapfilerequires Bash. If the step defaults to sh, it will always fail../testsexists).Recommendations
1. Make Sure You're Using Bash in Your Workflow Step
In your
.github/workflows/YAML:Note: That last line is critical:
shell: bash.2. Confirm Paths and Working Directory
Make sure this step is not running in a subfolder (like
src/,examples/, etc.). It should run from the root where thetestsfolder exists.3. Ensure Proper Repository Checkout
Earlier in your workflow, add:
Summary Table
You can view and modify your workflow file to apply these fixes.
Want the exact lines to add or update for your workflow YAML? Let me know!
See full code search for 'test' in this repository. (for deeper analysis)
User: check the pr.yaml file for isses and make sure it is looking on the correct place
Assistant: Here’s what the relevant part of your
.github/workflows/pr.yamldoes, based on the search:Test project discovery:
**I...
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.