Compare commits

...

7 Commits

Author SHA1 Message Date
shamoon
f71fe9356f Include js coverage output in artifact to check it 2025-09-19 10:18:55 -07:00
shamoon
70d88d4b9c Try checking & copying frontend coverage files 2025-09-19 09:19:27 -07:00
shamoon
0b2294133d Revert "Add step to display coverage directory structure in CI"
This reverts commit c0af82a6c3.
2025-09-19 09:17:38 -07:00
shamoon
c0af82a6c3 Add step to display coverage directory structure in CI 2025-09-19 09:01:06 -07:00
Trenton H
30455d16bf Include hidden files and change coverage to relative 2025-09-18 08:55:34 -07:00
Trenton H
52bf66781e Uploads the merged coverage data too 2025-09-18 08:38:11 -07:00
Trenton H
e042f77658 Try adjusting code paths 2025-09-17 07:15:32 -07:00
3 changed files with 26 additions and 3 deletions

View File

@@ -374,9 +374,32 @@ jobs:
# Merge frontend coverage from all shards
- name: Merge frontend coverage
run: |
# Find all coverage-final.json files from the shards, exit with error if none found
shopt -s nullglob
files=(coverage/frontend-coverage-*/coverage/coverage-final.json)
if [ ${#files[@]} -eq 0 ]; then
echo "No frontend coverage JSON found under coverage/" >&2
exit 1
fi
# Create .nyc_output directory and copy each shard's coverage JSON into it with a unique name
mkdir -p .nyc_output
npx nyc merge coverage .nyc_output/out.json
for coverage_json in "${files[@]}"; do
shard=$(basename "$(dirname "$(dirname "$coverage_json")")")
cp "$coverage_json" ".nyc_output/${shard}.json"
done
npx nyc merge .nyc_output .nyc_output/out.json
npx nyc report --reporter=lcovonly --report-dir coverage
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: merged-coverage
path: |
merged-backend-coverage.xml
.nyc_output/*
coverage/lcov.info
retention-days: 7
if-no-files-found: error
include-hidden-files: true
- name: SonarQube Analysis
uses: SonarSource/sonarqube-scan-action@v5
env:

View File

@@ -254,6 +254,7 @@ PAPERLESS_DISABLE_DBHANDLER = "true"
PAPERLESS_CACHE_BACKEND = "django.core.cache.backends.locmem.LocMemCache"
[tool.coverage.run]
relative_files = true
source = [
"src/",
]

View File

@@ -4,8 +4,7 @@ sonar.projectName=Paperless-ngx
sonar.projectVersion=1.0
# Source and test directories
sonar.sources=src/,src-ui/src/
sonar.tests=src/,src-ui/src/
sonar.sources=src/,src-ui/
sonar.test.inclusions=**/test_*.py,**/tests.py,**/*.spec.ts,**/*.test.ts
# Language specific settings