Skip to content

Commit 507e20d

Browse files
author
“jagnd1”
committed
add comprehensive debugging for coverage detection issue
- add detailed coverage file verification step with path analysis - enable sonar debug logging to see detailed coverage processing - analyze file paths in coverage.xml vs actual project structure - this should help identify why cobertura sensor completes in 142ms
1 parent 0ab5a5f commit 507e20d

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/sonarcloud.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,27 @@ jobs:
130130
rm pki_service/pki.pid
131131
fi
132132
133-
- name: verify coverage files
133+
- name: verify coverage files and debug paths
134134
run: |
135-
echo "Checking for coverage files..."
135+
echo "=== Checking for coverage files ==="
136136
ls -la testing/ | grep -E "(coverage\.xml|test-results\.xml)" || echo "Coverage files not found in testing/"
137+
138+
echo "=== Coverage file analysis ==="
137139
if [ -f testing/coverage.xml ]; then
138140
echo "Coverage file found with $(wc -l < testing/coverage.xml) lines"
139-
head -10 testing/coverage.xml
141+
echo "Coverage file size: $(ls -lh testing/coverage.xml | awk '{print $5}')"
142+
echo "=== First 15 lines of coverage.xml ==="
143+
head -15 testing/coverage.xml
144+
echo "=== Sample file paths from coverage.xml ==="
145+
grep 'filename=' testing/coverage.xml | head -5
140146
else
141147
echo "ERROR: coverage.xml not found!"
142148
fi
149+
150+
echo "=== Current working directory structure ==="
151+
find . -name "*.py" -path "./crypto_service/*" | head -3
152+
find . -name "*.py" -path "./pki_service/*" | head -3
153+
find . -name "*.py" -path "./common/*" | head -3
143154
144155
- name: sonarcloud scan
145156
uses: SonarSource/sonarcloud-github-action@master

testing/sonar-project.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ sonar.exclusions=**/test_*.py,**/tests/**,**/*_test.py,**/test.py,testing/**,dep
1919
# test execution and coverage (paths relative to project root)
2020
sonar.python.coverage.reportPaths=testing/coverage.xml
2121
sonar.python.xunit.reportPath=testing/test-results.xml
22+
# enable debug logging for coverage detection
23+
sonar.log.level=DEBUG
2224

2325
# language and encoding
2426
sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)