The issue I’m running into is that if all tests pass, nothing is displayed even coverage
. I’d like to always see the results of both pytest
and coverage
when container updates.
I have the following in my devspace.yaml
:
...
- name: ${API}-ut
imageSelector: ${APP_NAME}/${API_DEV}-ut
localSubPath: ./${API}
excludeFile: .dockerignore
waitInitialSync: true
onUpload:
exec:
- command: coverage run --omit='src/manage.py,src/config/*,*/.venv/*,*/*__init__.py,*/tests.py,*/admin.py,*/migrations/*,*/apps.py' -m pytest -m=ut
- command: coverage report -m
...
I’ve tried adding these flags in the `… pytest -m ut:
--capture=fd
--capture=sys
--capture=no
--capture=tee-sys
-s (shortcut for --capture=no)
I can see them being called in the logs:
...
[api-ut] Upstream - Execute command 'coverage run --omit='src/manage.py,src/config/*,*/.venv/*,*/*__init__.py,*/tests.py,*/admin.py,*/migrations/*,*/apps.py' -m pytest -m=ut'
...
[api-ut] Upstream - Execute command 'coverage report -m'
...
But no results or report displays in the terminal.
If I make a test result in an error or failure, then I do see an output, but no coverage
I believe due to exit status 1
.
How would I update this so that results are always shown?