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?

本文标签: