Skip to content

Commit 1c2f238

Browse files
committed
Debugging coverage merge 3
1 parent b6ac8cb commit 1c2f238

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

β€Ž.github/workflows/coverage-check-parallel.ymlβ€Ž

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
9090
TEST_NAME=$(basename "${{ matrix.test_file }}" .py)
9191
COVERAGE_FILE="coverage-${TEST_NAME}-${{ matrix.mode }}.xml"
92-
COVERAGE_DATA=".coverage-${TEST_NAME}-${{ matrix.mode }}"
92+
COVERAGE_DATA="coverage-data-${TEST_NAME}-${{ matrix.mode }}"
9393
echo "TEST_NAME=$TEST_NAME" >> $GITHUB_ENV
9494
9595
# Clean any previous coverage data to avoid conflicts
@@ -139,14 +139,14 @@ jobs:
139139
ls -la .coverage* coverage-* 2>/dev/null || echo "No coverage files found"
140140
141141
echo "πŸ” Specifically checking for files to upload:"
142-
echo " .coverage-* files:"
143-
ls -la .coverage-* 2>/dev/null || echo " None found"
142+
echo " coverage-data-* files:"
143+
ls -la coverage-data-* 2>/dev/null || echo " None found"
144144
echo " coverage-*-${{ matrix.mode }}.xml files:"
145145
ls -la coverage-*-${{ matrix.mode }}.xml 2>/dev/null || echo " None found"
146146
147147
echo "πŸ” CRITICAL DEBUG: Checking exact upload patterns:"
148-
echo " Pattern '.coverage-*' matches:"
149-
find . -maxdepth 1 -name ".coverage-*" -type f 2>/dev/null || echo " No matches"
148+
echo " Pattern 'coverage-data-*' matches:"
149+
find . -maxdepth 1 -name "coverage-data-*" -type f 2>/dev/null || echo " No matches"
150150
echo " Pattern 'coverage-*-${{ matrix.mode }}.xml' matches:"
151151
find . -maxdepth 1 -name "coverage-*-${{ matrix.mode }}.xml" -type f 2>/dev/null || echo " No matches"
152152
@@ -160,7 +160,7 @@ jobs:
160160
with:
161161
name: coverage-${{ env.TEST_NAME }}-${{ matrix.mode }}
162162
path: |
163-
.coverage-*
163+
coverage-data-*
164164
coverage-*-${{ matrix.mode }}.xml
165165
if-no-files-found: warn
166166

@@ -222,8 +222,8 @@ jobs:
222222
echo " Contents:"
223223
ls -la "$artifact_dir" || echo " (empty or inaccessible)"
224224
225-
# Copy .coverage files
226-
for cov_file in "$artifact_dir"/.coverage-*; do
225+
# Copy coverage data files
226+
for cov_file in "$artifact_dir"/coverage-data-*; do
227227
if [ -f "$cov_file" ]; then
228228
cp "$cov_file" .
229229
COVERAGE_FILES_FOUND=$((COVERAGE_FILES_FOUND + 1))
@@ -241,18 +241,29 @@ jobs:
241241
fi
242242
done
243243
244-
echo "πŸ“Š SUMMARY: Found $COVERAGE_FILES_FOUND .coverage files"
245-
echo "Available .coverage files for merging:"
246-
ls -la .coverage-* 2>/dev/null || echo "❌ No .coverage-* files found"
244+
echo "πŸ“Š SUMMARY: Found $COVERAGE_FILES_FOUND coverage data files"
245+
echo "Available coverage data files for merging:"
246+
ls -la coverage-data-* 2>/dev/null || echo "❌ No coverage-data-* files found"
247247
248248
echo "Available XML files:"
249249
ls -la coverage-*.xml 2>/dev/null || echo "❌ No XML files found"
250250
251251
if [ $COVERAGE_FILES_FOUND -gt 0 ]; then
252252
echo "πŸ”„ Combining coverage data..."
253-
poetry run coverage combine .coverage-* || {
253+
254+
# Rename coverage-data-* files to .coverage format for combining
255+
for f in coverage-data-*; do
256+
if [ -f "$f" ]; then
257+
# Extract the suffix and create .coverage.suffix format
258+
suffix=$(echo "$f" | sed 's/coverage-data-/.coverage./')
259+
mv "$f" "$suffix"
260+
echo " πŸ“ Renamed $f to $suffix"
261+
fi
262+
done
263+
264+
poetry run coverage combine .coverage.* || {
254265
echo "❌ Coverage combine failed, checking individual files:"
255-
for f in .coverage-*; do
266+
for f in .coverage.*; do
256267
if [ -f "$f" ]; then
257268
echo " File: $f ($(stat -c%s "$f" 2>/dev/null || stat -f%z "$f") bytes)"
258269
file "$f" 2>/dev/null || echo " Cannot determine file type"

0 commit comments

Comments
Β (0)