HarrisKirk / blue-green-dreams

2 stars 1 forks source link

Ensure that an abnormal exit of gwa.py results in a failed test.sh #10

Closed HarrisKirk closed 1 year ago

HarrisKirk commented 1 year ago

To test this condition, simply add a sys.exit(1) before exit temporarily and revert the commit if the build fails (as expected)

HarrisKirk commented 1 year ago

A non-zero exit code does not fail the build

Next: how to trigger a failure?

HarrisKirk commented 1 year ago

The docker run command will start the command in the CMD which is CMD ["flask", "--app", "gwa/app.py", "run"]

If the CMD exits , the container will also exit and also does not show up in the docker container ls -a list. Hmmm

Some questions arise about how to launch flask. In background mode? If so, how to tell if the (background) process exited or not.

The areas needing more research are

The next todo is to create some experiments to understand how processes work in docker - especially with respect to daemon or background processes.

NOTE - it might be better to switch to using gunicorn since it already works

HarrisKirk commented 1 year ago

We are using gunicorn now. And there is a test.sh script that is working properly.

So I think the todo on this ticket is to simply force a failure in the python code and make sure that the test.sh fails.