Closed obulat closed 3 years ago
The Docker dashboard says that ccsearch-api_db_1 container is running, but I can't open local host at port 5432. Am I supposed to be able to open db at that port?
Yes @obulat, if the DB server is running you should be able to access Postgres using psql
:
psql -U deploy -d openledger -p 5433 -h localhost
To reproduce, I opened a remote connection with docker compose exec
and ran the test. I got just one failure and that too because Django wants to connect with Postgres at localhost:5432
and Redis at localhost:6379
which I suppose won't be accessible from within the container.
I didn't face the dependency issue that you mentioned.
Testing LOCAL environment
- E....F...ss...F.s....F.FsFF.
+ E........ss.....s.......s...
So to fix the DB and Redis connections, I updated the hosts inside the run_tests.sh
file, replacing localhost with the names of their services respectively.
- DJANGO_DATABASE_HOST='localhost' REDIS_HOST='localhost'
+ DJANGO_DATABASE_HOST='db' REDIS_HOST='cache'
Then all the tests passed.
Testing LOCAL environment
.........ss.....s.......s...
Also I ran pipenv install
locally (using the Rosetta terminal) and that also worked without dependency issues.
Trying to run integration tests, I get several errors:
On Mac, I get an error when I run
pipenv install
because there is no compatible wheel of Pillow package. It tries to build it, but fails because there are no required dependencies for compilation (zlib).When running shell inside Docker, I first get an error that importlib_metadata module is not found. After I install it using
pipenv install importlib_metadata
, I get an error that no compatible version of django was found, becausedrf-yasg
requires version >= 2.2.16, and we have it fixed in Pipfile to 2.2.13. So, I installed drf-yasg version 1.17 instead of 1.20.Then I am able to run the tests, but get several failures:
Sorry for including so much.