-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Allow running pytest from local host #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks, I'll check it soon.
The problem here is that the .env
file will end up in the container too, and it can create problems there.
Apart from requiring another file with variables that the user has to take care of.
Also, you can run more or less the same with:
cookiecutter full-stack-fastapi-postgresql/ --no-input cd base-project docker-compose up -d docker-compose exec backend-tests /tests-start.sh
The benefit is that the tests are being run in an environment equivalent to production, the server is communicating with its own DB, independent of if there are other DBs up in the same port or similar things.
On another note, I plan on including the tests in the same image as the backend, so they can be run separately but they can also run in the same container, this will allow enabling and using code coverage, inside the containers.
You are right, I missed the docker-compose exec backend-tests /tests-start.sh
I am looking forward test coverage (which does not look simple between multiple containers) !
Great, thanks!
Uh oh!
There was an error while loading. Please reload this page.
Running tests should be lightning fast. I was (maybe un-rightely) using the script from
scripts/tests-local.sh
, which takes care of building fresh containers, starting them and then running the tests.I will keep this process for automatic tests (probably on git hooks)...
This PR provides a way to run pytest locally during base development
Therefore
and tada ! 🎉
There is however this new .env file that the users should be aware of... but that definitevely worth the price IMHO 👶