Skip to content

Commit

Permalink
Collect coverage from DiracX demo
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Sep 25, 2023
1 parent 07fda54 commit beccb6a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Start demo
run: |
git clone https://github.com/DIRACGrid/diracx-charts.git ../diracx-charts
../diracx-charts/run_demo.sh --exit-when-done $PWD
../diracx-charts/run_demo.sh --enable-coverage --exit-when-done $PWD
- name: Debugging information
run: |
DIRACX_DEMO_DIR=$PWD/../diracx-charts/.demo
Expand All @@ -74,9 +74,26 @@ jobs:
fi
- name: Run pytest
run: |
pytest . --demo-dir ../diracx-charts/ --cov-report=xml:coverage.xml --junitxml=report.xml
pytest . --demo-dir ../diracx-charts/ --cov-report=xml:coverage-pytest.xml --junitxml=report.xml
- name: Collect demo coverage
run: |
DIRACX_DEMO_DIR=$PWD/../diracx-charts/.demo
export KUBECONFIG=${DIRACX_DEMO_DIR}/kube.conf
export PATH=${DIRACX_DEMO_DIR}:$PATH
# Shutdown the pods so we collect coverage data
for pod_name in $(kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|rabbitmq|opensearch)'); do
kubectl delete pod/"${pod_name}"
done
# Combine the coverage data from the demo and make an XML report
coverage_rcfile=$(mktemp)
echo -e '[paths]\nsource =\n src/\n */site-packages/\n /diracx_source/*/src/' > "${coverage_rcfile}"
coverage_data=$(mktemp)
coverage combine --data-file "${coverage_data}" "${DIRACX_DEMO_DIR}"/coverage-reports/*
coverage xml -o coverage-demo.xml --data-file "${coverage_data}" --rcfile="${coverage_rcfile}"
- name: Upload coverage report
uses: codecov/[email protected]
with:
files: ./coverage-pytest.xml,./coverage-demo.xml

mypy:
runs-on: ubuntu-latest
Expand Down

0 comments on commit beccb6a

Please sign in to comment.