DARMA-tasking / LB-analysis-framework

Analysis framework for exploring, testing, and comparing load balancing strategies
Other
3 stars 1 forks source link

GitHub action passes even when Python error is raised in tox run #377

Closed pierrepebay closed 1 year ago

pierrepebay commented 1 year ago

Relative import path Python error fixed in #373 was not causing the GitHub actions to be marked as failing: https://github.com/DARMA-tasking/LB-analysis-framework/actions/runs/4569049204/jobs/8064831145#step:7:1627, if other errors appear will the tox run be marked as passing as well ?

tlamonthezie commented 1 year ago

If a unit test is failing then the job is failing as expected (unittest fails then tox returns an error code) https://github.com/DARMA-tasking/LB-analysis-framework/actions/runs/4807421528/jobs/8556225391

If there is a python error like invalid import in a unit testing module then unit tests also fail https://github.com/DARMA-tasking/LB-analysis-framework/actions/runs/4807512147/jobs/8556371469

The error occured in coverage and it seems to be related to how python loads packages in that case. To use relative imports without errors in coverage call, it is possible by setting the -t argument in the coverage command call like this

coverage run --source $(pwd)/src -m unittest discover -s $(pwd)/tests -p "test*.py" becomes coverage run --source $(pwd)/src -m unittest discover -s $(pwd)/tests -p "test*.py" -t $(pwd)