Skip to content

Commit

Permalink
[ci] Collect backend code coverage also during client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Feb 9, 2025
1 parent be626f2 commit ae9cd9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scripts/run_tests_backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo "Running setup"
sudo apt-get update
sudo apt-get install -y tor
npm install -g grunt grunt-cli
pip install coverage
pip3 install coverage

setupBackend
setupClient
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/scripts/run_tests_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ echo "Running setup"
sudo apt-get update
sudo apt-get install -y tor
npm install -g grunt grunt-cli
pip3 install coverage

setupBackend
setupClient

$GITHUB_WORKSPACE/backend/bin/globaleaks -z
cd $GITHUB_WORKSPACE/backend/ && coverage run ./bin/globaleaks -z -n &

sleep 5

# Running client tests locally
Expand All @@ -30,10 +33,14 @@ if [ $? -ne 0 ]; then
client_test_failed=1
fi

sed -i 's|SF:dist/|SF:client/|g' $GITHUB_WORKSPACE/client/cypress/coverage/lcov.info
killall coverage -9

sed -i 's|SF:dist/|SF:client/|g' $GITHUB_WORKSPACE/client/cypress/coverage/lcov.info
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l TypeScript -r $GITHUB_WORKSPACE/client/cypress/coverage/lcov.info

cd $GITHUB_WORKSPACE/backend && coverage xml
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Python -r $GITHUB_WORKSPACE/backend/coverage.xml

if [ $client_test_failed -eq 1 ]; then
echo "Client tests: FAILED"
exit 1
Expand Down

0 comments on commit ae9cd9e

Please sign in to comment.