Fix find -quit missing -print causing coverage report generation to silently skip#74
Merged
Chris-Wolfgang merged 2 commits intomainfrom Mar 12, 2026
Merged
Conversation
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix coverage report generation in CI for macOS and Linux
Fix Mar 11, 2026
find -quit missing -print causing coverage report generation to silently skip
Chris-Wolfgang
approved these changes
Mar 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes CI coverage report generation in .github/workflows/pr.yaml by correcting the find usage so the “Generate coverage report” step actually detects coverage files and runs reportgenerator.
Changes:
- Add
-printbefore-quitin the Linux (Stage 1) coverage-file detection. - Add
-printbefore-quitin the macOS (Stage 3) coverage-file detection.
You can also share your feedback on Copilot code review. Take the survey.
Chris-Wolfgang
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
find -quitterminates on first match but emits no output without-print, so the pipe togrep -q .always fails —reportgeneratornever runs,CoverageReport/Summary.txtis never created, and the coverage threshold step always fails with❌ Coverage report not generated!.Fix: Add
-printbefore-quitin both affected locations:release.yamlis unaffected — it uses PowerShellGet-ChildItemwhich has no equivalent issue.Type of change
How Has This Been Tested?
find -print -quit | grep -q .pattern locally outputs the matched filename and returns exit code 0 when a match exists, and exit code 1 when no match existsChecklist
Screenshots (if applicable)
Additional context
Original prompt
Bug
The "Generate coverage report" steps in
.github/workflows/pr.yamlfor Stage 1 (Linux) and Stage 3 (macOS) use a brokenfind | greppattern that prevents the coverage report from ever being generated. This causes the subsequent "Enforce 90% coverage threshold" step to fail with❌ Coverage report not generated!.Root Cause
The
findcommand uses-quitwithout-print, so it never outputs anything forgrepto match:When
finduses-quit, it terminates as soon as it finds the first match — but without-print, it does not output the filename. Since nothing is piped togrep,grep -q .always fails, thereportgeneratorcommand is skipped,CoverageReport/Summary.txtis never created, and the next step fails.Fix
Add
-printbefore-quitin both locations so thatfindoutputs the matched filename before quitting:Locations to change in
.github/workflows/pr.yamlBoth lines have the identical broken pattern and need the identical fix.
Note
The
release.yamlfile does NOT have this bug — it uses PowerShellGet-ChildIteminstead offind, which works correctly.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Why am I getting this error on my pr.yaml
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet tool install -g dotnet-reportgenerator-globaltool
shell: /usr/bin/bash -e {0}
env:
CODECOV_MINIMUM: 90
DOTNET_ROOT: /usr/share/dotnet
You can invoke the tool using the following command: reportgenerator
Tool 'dotnet-reportgenerator-globaltool' (version '5.5.3') was successfully installed.
0s
0s
Run if [ ! -f "CoverageReport/Summary.txt" ]; then
if [ ! -f "CoverageReport/Summary.txt" ]; then
echo "❌ Coverage report not generated!"
exit 1
fi
echo "Coverage Summary:"
cat CoverageReport/Summary.txt
echo ""
THRESHOLD=${CODECOV_MINIMUM:-90}
FAILED=0
while IFS= read -r line; do
if echo "$line" | grep -qE '^[^ ]+.*[0-9]+%$' && ! echo "$line" | grep -q '^Summary'; then
MODULE=$(echo "$line" | grep -oP '^[^ ]+')
PERCENT=$(echo "$line" | grep -oP '[0-9]+(?=%)' | tail -1)
echo "Checking module: '$MODULE' - Coverage: ${PERCENT}%"
if [ "$PERCENT" -lt "$THRESHOLD" ]; then
echo " ❌ FAIL: Below ${THRESHOLD}% threshold"
FAILED=1
else
echo " ✅ PASS: Meets ${THRESHOLD}% threshold"
fi
fi
done < CoverageReport/Summary.txt
if [ "$FAILED" -ne 0 ]; then
echo ""
echo "=========================================="
echo "❌ COVERAGE GATE FAILED"
echo "=========================================="
echo "One or more modules are below ${THRESHOLD}% coverage."
echo "Stage 1 failed. Windows and macOS tests will NOT run."
exit 1
fi
echo ""
echo "=========================================="
echo "✅ COVERAGE GATE PASSED"
echo "=========================================="
echo "All modules meet ${THRESHOLD}% coverage threshold."
echo "Proceeding to Stage 2 (Windows tests)."
shell: /usr/bin/bash -e {0}
env:
CODECOV_MINIMUM: 90
DOTNET_ROOT: /usr/share/dotnet
❌ Coverage report not generated!
Error: Process completed with exit code 1.
Assistant:
Let me look at your PR workflow file and test configuration to understand why the coverage report isn't being generated.
Assistant: Now let me check if there's a
coverlet.runsettingsfile and what the test projects look like:Assistant: The issue is in Stage 1 (Linux), specifically in the "Generate coverage report" step (lines 239–248). Here's the root cause:
The Problem:
find | grepdoesn't work as expectedThe command
find ... -quit | grep -q .is flawed. Whenfinduses-quit, it terminates as soon as it finds the first match — but it doesn't print anything because there's no-printaction. The-quitaction tells `...This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.