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

Cannot build docker for postgres integration test #344

Closed
bastienboutonnet opened this issue Mar 14, 2021 · 6 comments · Fixed by #591
Closed

Cannot build docker for postgres integration test #344

bastienboutonnet opened this issue Mar 14, 2021 · 6 comments · Fixed by #591
Labels
bug Something isn't working

Comments

@bastienboutonnet
Copy link
Contributor

bastienboutonnet commented Mar 14, 2021

Describe the bug

When trying to test a recent change I proposed on the haversine_disance macro, I wanted to follow the instructions laid out in the README.md to set up a postgres docker

However when running

make test target=postgres

I bumped into the following error

➜  integration_tests git:(feat/haversine_in_km_and_miles) make test target=postgres
docker-compose -f ../docker-compose.yml up dbt
Starting dbt-utils_postgres_1 ... done
Starting dbt-utils_dbt_1      ... done
Attaching to dbt-utils_dbt_1
dbt_1        | Running with dbt=0.19.1-b2
dbt_1        | No profile "integration_tests" found, continuing with no target
dbt_1        | Installing ../
dbt_1        |   Installed from <local @ ../>
dbt_1        |
dbt_1        | Running with dbt=0.19.1-b2
dbt_1        | Encountered an error while reading profiles:
dbt_1        |   ERROR Runtime Error
dbt_1        |   Compilation Error
dbt_1        |     Could not render {{ env_var('POSTGRES_TEST_HOST') }}: Env var required but not provided: 'POSTGRES_TEST_HOST'
dbt_1        | Defined profiles:
dbt_1        |  - integration_tests
dbt_1        |
dbt_1        | For more information on configuring profiles, please consult the dbt docs:
dbt_1        |
dbt_1        | https://docs.getdbt.com/docs/configure-your-profile
dbt_1        |
dbt_1        | Encountered an error:
dbt_1        | Runtime Error
dbt_1        |   Could not run dbt
dbt_1        | Running with dbt=0.19.1-b2
dbt_1        | Encountered an error while reading profiles:
dbt_1        |   ERROR Runtime Error
dbt_1        |   Compilation Error
dbt_1        |     Could not render {{ env_var('POSTGRES_TEST_HOST') }}: Env var required but not provided: 'POSTGRES_TEST_HOST'
dbt_1        | Defined profiles:
dbt_1        |  - integration_tests
dbt_1        |
dbt_1        | For more information on configuring profiles, please consult the dbt docs:
dbt_1        |
dbt_1        | https://docs.getdbt.com/docs/configure-your-profile
dbt_1        |
dbt_1        | Encountered an error:
dbt_1        | Runtime Error
dbt_1        |   Could not run dbt
dbt_1        | Running with dbt=0.19.1-b2
dbt_1        | Encountered an error while reading profiles:
dbt_1        |   ERROR Runtime Error
dbt_1        |   Compilation Error
dbt_1        |     Could not render {{ env_var('POSTGRES_TEST_HOST') }}: Env var required but not provided: 'POSTGRES_TEST_HOST'
dbt_1        | Defined profiles:
dbt_1        |  - integration_tests
dbt_1        |
dbt_1        | For more information on configuring profiles, please consult the dbt docs:
dbt_1        |
dbt_1        | https://docs.getdbt.com/docs/configure-your-profile
dbt_1        |
dbt_1        | Encountered an error:
dbt_1        | Runtime Error
dbt_1        |   Could not run dbt
dbt-utils_dbt_1 exited with code 2

Steps to reproduce

Described above.

Expected results

I would expect the docker to build correctly as this section suggests?

Where possible, targets are being run in docker containers (this works for Postgres or in the future Spark for example). For managed services like Snowflake, BigQuery and Redshift this is not possible, hence your own configuration for these services has to be provided in the appropriate env files in integration_tests/.env/[TARGET].env

Maybe, I'm being dumb and misreading the documentation, it wouldn't be the first time, if not and the documentation isn't accurate anymore or something else is happening I'd be happy to help fixing if there is anything I can do.

@bastienboutonnet bastienboutonnet added bug Something isn't working triage labels Mar 14, 2021
@robertdefilippi
Copy link

I'm also have the same issue.

Did you ever figure out the fix @bastienboutonnet ?

@bastienboutonnet
Copy link
Contributor Author

Nope. So I just leveraged the CI that gets spun up on PR

@joellabes
Copy link
Contributor

Hey both - I also had trouble with the integration tests recently (and fell back to making the CI job do it).

Planning to sit down with @VersusFacit in the new year and get this sorted out 🛠️

@robertdefilippi
Copy link

That's what I was planning on doing as well for this PR but the CI job never ran when I pushed the PR. Any idea why that would be?

@joellabes
Copy link
Contributor

No, but I also got caught up by that, and then when we asked the dev team for help it worked without a hitch!

@dbeatty10
Copy link
Contributor

@bastienboutonnet definitely not you being dumb -- the documentation was not accurate.

I tried re-factoring the Makefile and the instructions to try to address the issues you raised within #591

You can try it out with the following steps:

  1. Check out the fix/344-564-make-test branch
  2. Follow the instructions within integration_tests/README.md

I'm trying to balance the number of steps to execute as a user versus how much gets re-run every time within the make steps. Might not have the best balance yet.

Any suggestions are welcome -- just add your feedback within #591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants