Skip to content

Commit

Permalink
Use xdist to produce summary of the failures
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvassilev committed Mar 13, 2023
1 parent f68cdf3 commit 4620d0c
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,32 +212,14 @@ jobs:
make all || true
python -m pip install --upgrade pip
python -m pip install pytest
export PASSED=0
export NO_OF_TESTS=0
export SETUP_PLAN=$(python -m pytest --setup-plan | grep -o -P '(?<=test\/).*?(?=\ \(fixtures)')
echo ::group::Test Status
set +e
for test in ${SETUP_PLAN} ; do
NO_OF_TESTS=$((NO_OF_TESTS+1))
(
python -m pytest -s $test >> test.log 2>&1
)
if [[ $? -eq 0 ]]; then
PASSED=$((PASSED+1))
echo "$test PASSED"
else
echo "$test FAILED"
fi
done
set -e
echo ::endgroup::
echo "TEST SUMMARY: $PASSED out of $NO_OF_TESTS tests passed"
python -m pip install pytest-xdist
echo ::group::Test Logs
cat test.log
python -m pytest -n auto -sv --max-worker-restart 512 | tee test.log 2>&1
echo ::endgroup::
if [[ $PASSED -ne $NO_OF_TESTS ]]; then
exit 1
fi
echo "TEST SUMMARY: \n"
tail -n2 test.log
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
Expand Down

0 comments on commit 4620d0c

Please sign in to comment.