Skip to content
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

Env file creation recipe breaks integration tests #447

Open
1 task
AetherUnbound opened this issue Jan 3, 2022 · 3 comments
Open
1 task

Env file creation recipe breaks integration tests #447

AetherUnbound opened this issue Jan 3, 2022 · 3 comments

Comments

@AetherUnbound
Copy link
Contributor

@AetherUnbound AetherUnbound commented Jan 3, 2022

Description

The creation of the .env files will cause the integration tests to fail due to an improperly defined RELATIVE_UPSTREAM_DB_HOST variable.

Reproduction

  1. just env
  2. just ing-testlocal
  3. Wait for the integration tests to time out & fail, and notice this message in the logs:
integration_ingestion_server_1  | Process Task-1:
integration_ingestion_server_1  | Traceback (most recent call last):
integration_ingestion_server_1  |   File "/usr/local/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
integration_ingestion_server_1  |     self.run()
integration_ingestion_server_1  |   File "/ingestion_server/ingestion_server/tasks.py", line 110, in run
integration_ingestion_server_1  |     reload_upstream(self.model)
integration_ingestion_server_1  |   File "/ingestion_server/ingestion_server/ingest.py", line 292, in reload_upstream
integration_ingestion_server_1  |     downstream_cur.execute(init_fdw)
integration_ingestion_server_1  | psycopg2.errors.SqlclientUnableToEstablishSqlconnection: could not connect to server "upstream"
integration_ingestion_server_1  | DETAIL:  could not translate host name "upstream_db" to address: Try again
integration_ingestion_server_1  | 

Expectation

The integration tests should succeed even if new .env files are created.

Additional context

I believe this is the root cause of the issue I was trying to address in #364!

Resolution

  • 🙋 I would be interested in resolving this bug.
@zackkrida
Copy link
Member

@zackkrida zackkrida commented Jan 3, 2022

Nice find!

@dhruvkb
Copy link
Member

@dhruvkb dhruvkb commented Jan 4, 2022

The ing-testlocal recipe runs the tests inside a Pipenv subshell using pipenv run. Pipenv automatically loads the .env file (if it finds one) and overwrites the existing env vars. So I think setting the PIPENV_DONT_LOAD_ENV env var shoud fix this behaviour.

$ PIPENV_DONT_LOAD_ENV=1 pipenv run ...

@AetherUnbound
Copy link
Contributor Author

@AetherUnbound AetherUnbound commented Jan 5, 2022

I tried the PIPENV_DONT_LOAD_ENV variable and unfortunately it still failed. I think this is a product of docker-compose automatically picking up .env files and using them where available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Openverse
  
Backlog
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants