admin管理员组文章数量:1336281
I am testing some API endpoints of my Django app by running Playwright separately on a Ubuntu machine on my Github Action instance. Since I also want to get the coverage of the tests, I am starting my server this way:
- name: run backend server
run: poetry run coverage run ./manage.py runserver --no-reload
This results in a single process being started.
Now, in order to collect the coverage data, I need to gracefully stop my django server, as force killing the process would also interrupt coverage
and executing coverage combine
would produce an error.
I have tried the following commands, but they all fail to stop the server
kill -SIGINT $DJANGO_PID
kill -SIGTERM $DJANGO_PI
pkill -f "./manage.py runserver"
python -c "import os; import signal; print(os.kill($DJANGO_PID, signal.SIGTERM))"
Is there a different approach I can use ? or maybe I am starting the server the wrong way?
本文标签:
版权声明:本文标题:python - Coverage: How to gracefully stop a Django development server that runs on a Github Action Instance - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742407280a2469080.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论