Skip to content

Commit

Permalink
add debug step to list coverage files
Browse files Browse the repository at this point in the history
  • Loading branch information
sushi30 committed Sep 25, 2024
1 parent df4904a commit 9580ea6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/py-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ jobs:
env:
TESTCONTAINERS_RYUK_DISABLED: true

- name: List coverage files for debugging
run: |
echo "Listing coverage files:"
find . -type f -name ".coverage.*"
- name: Upload coverage artifact for Python tests
if: steps.test.outcome == 'success' && env.DEBUG == 'false'
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -160,18 +165,18 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
path: coverage

- name: Generate report
run: |
if [ ! -d "artifacts/coverage/3.9" ] || [ -z "$(ls -A artifacts/coverage/3.9/.coverage.*)" ]; then
if [ ! -d "coverage/3.9" ] || [ -z "$(ls -A coverage/3.9/.coverage.*)" ]; then
echo "No coverage files found in artifacts/coverage/3.9"
exit 1
fi
source env/bin/activate
python scripts/rewrite_coverage_files.py artifacts/coverage/3.9 env/lib/python3.9/site-packages/metadata
coverage combine --rcfile=ingestion/pyproject.toml --keep -a artifacts/coverage/3.9
python scripts/rewrite_coverage_files.py coverage/3.9 env/lib/python3.9/site-packages/metadata
coverage combine --rcfile=ingestion/pyproject.toml --keep -a coverage/3.9
coverage report --rcfile=ingestion/pyproject.toml
coverage xml --rcfile=ingestion/pyproject.toml -o ingestion/coverage.xml
sed -e "s/$(python -c "import site; import os; from pathlib import Path; print(os.path.relpath(site.getsitepackages()[0], str(Path.cwd())).replace('/','\/'))")/src/g" ingestion/coverage.xml >> ingestion/ci-coverage.xml
Expand Down
1 change: 0 additions & 1 deletion ingestion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ run_python_tests: ## Run all Python tests with coverage
coverage erase
$(MAKE) static-checks
nox -f $(INGESTION_DIR)/noxfile.py $(NOX_FLAGS) --report nox-all.json
coverage report --rcfile $(INGESTION_DIR)/pyproject.toml || true

.PHONY: sonar_ingestion
sonar_ingestion: ## Run the Sonar analysis based on the tests results and push it to SonarCloud
Expand Down

0 comments on commit 9580ea6

Please sign in to comment.