Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
73 stars 32 forks source link

Automate testing under Docker #347

Closed robjwells closed 3 years ago

robjwells commented 3 years ago

This set of changes will make it easier for people developing via Docker to run the tests.

The whole pytest suite can be run with make test, and you can pass arguments to pytest by adding ARGS="pytest args" afterwards. I’ve added a couple of lines to the readme to explain this.

I’ve added a docker-compose-specific testing config file under /test/ which sets the Redis host correctly, as otherwise most of the tests fail with a connection error when the app tries to connect to Redis on 127.0.0.1.

There’s also a minor whitespace change in the readme that was picked up by pre-commit.

Previously this PR used a docker-compose service for the tests, but I’ve force-pushed a new set of changes after realising this causes the tests to be run when docker-compose up is invoked. Now the tests run as a one-off command using the throat docker-compose service as the base.