You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
that line should be ran from your local computer of your root directory.
Question offtopic:
I'm questioning the way this is tested, each time you want to tests, you must spawn new docker-compose? Where's productivity in that?
You have to execute DOMAIN=backend sh ./scripts/test.sh in your main folder which will spawn another backend container where it will run a script to execute pytest. After that you can enter the backend-tests container and run pytest whenever you want to 👍🏻
The command DOMAIN=backend sh ./scripts/test.sh does not work for me, I assume there is some difference between Linux and Windows for those commands. That is the error I get:
'DOMAIN' is not recognized as an internal or external command,
operable program or batch file.
I finally was able to run the tests. To help others with the same issue, here is what worked:
There is an issue in Windows and cookiecutter regarding line endings being CR + LF, so I used notepad++ to batch convert all the CR + LF to LF. Make sure to exclude binary files such as .png images and icons or they will be corrupted.
Keep the project files in a separate drive outside the Windows C, as per Docker docs.
I had to reset docker to factory and restart the PC, then rebuild the images (docker-compose up -d). Docker: must be in Linux container mode (not Windows)
After that, the tests worked with this command: docker-compose exec backend-tests /tests-start.sh
Activity
slushnys commentedon Feb 22, 2020
that line should be ran from your local computer of your root directory.
Question offtopic:
I'm questioning the way this is tested, each time you want to tests, you must spawn new docker-compose? Where's productivity in that?
robido commentedon Feb 23, 2020
Thanks @slushnys can you elaborate more what you mean by root directory? Do you mean within bash within the container.
slushnys commentedon Feb 23, 2020
You have to execute DOMAIN=backend sh ./scripts/test.sh in your main folder which will spawn another backend container where it will run a script to execute pytest. After that you can enter the backend-tests container and run pytest whenever you want to 👍🏻
robido commentedon Feb 25, 2020
The command
DOMAIN=backend sh ./scripts/test.shdoes not work for me, I assume there is some difference between Linux and Windows for those commands. That is the error I get:'DOMAIN' is not recognized as an internal or external command,
operable program or batch file.
I finally was able to run the tests. To help others with the same issue, here is what worked:
docker-compose up -d). Docker: must be in Linux container mode (not Windows)docker-compose exec backend-tests /tests-start.shI saw a few of the issues are related to that CR+LF problem, I think it would be good to mention in in the README.md.
Thanks Tiangolo for the great FastAPI framework and this fullstack example.
tiangolo commentedon Apr 18, 2020
Thanks for the discussion here everyone!
About the CR LF problem, indeed, it's an issue with Cookiecutter in Windows: cookiecutter/cookiecutter#1159
But it should be fixed now on this side with: #149 🎉
Now after generating a new project line endings are fixed for shell files 🚀
github-actions commentedon Apr 29, 2020
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
✅ Add test for signing up and setup for dev `mailcatcher` (#115)