-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
I can't get the tests running #115
Comments
that line should be ran from your local computer of your root directory. Question offtopic: |
Thanks @slushnys can you elaborate more what you mean by root directory? Do you mean within bash within the container. |
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 I finally was able to run the tests. To help others with the same issue, here is what worked:
I 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. |
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 🚀 |
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
I am new with Docker so maybe its a noob issue, I have no clue on how to run the tests. Here is what I tried, with corresponding outputs:
docker-compose exec backend-tests /tests-start.sh
‘bash\r’: No such file or directory
docker-compose exec backend-tests \tests-start.sh
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: "\\tests-start.sh": executable file not found in $PATH": unknown
docker-compose exec backend-tests tests-start.sh
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: "tests-start.sh": executable file not found in $PATH": unknown
docker-compose exec backend bash
root@0dca8fc07bda:/app# DOMAIN=backend sh ./scripts/test.sh
sh: 0: Can't open ./scripts/test.sh
root@0dca8fc07bda:/app# sh scripts/test.sh
sh: 0: Can't open scripts/test.sh
root@0dca8fc07bda:/app# ls
Pipfile alembic alembic.ini app prestart.sh scripts tests-start.sh worker-start.sh
root@0dca8fc07bda:/app# sh tests-start.sh
tests-start.sh: 2: set: Illegal option -
The text was updated successfully, but these errors were encountered: