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

chore: add docker-compose local dev env #840

Merged
merged 1 commit into from
Mar 24, 2022
Merged

chore: add docker-compose local dev env #840

merged 1 commit into from
Mar 24, 2022

Conversation

iwpnd
Copy link
Member

@iwpnd iwpnd commented Mar 20, 2022

This PR adds a local development environment using docker compose as proposed here that makes local development a breeze, even if you're unfamiliar with the project.

  1. clone the repository
  2. docker compose up
  3. run test suite
RUN_POSTGIS_TESTS=yes RUN_REDIS_TESTS=yes PGSSLMODE=disable PGSSLKEY="" PGSSLCERT="" PGSSLROOTCERT="" PGHOST=localhost PGPORT=5432 PGDATABASE=tegola PGUSER=postgres PGPASSWORD=postgres PGUSER_NO_ACCESS=tegola_no_access go test  ./... -v
  1. docker compose down

@iwpnd iwpnd requested review from gdey and ARolek as code owners March 20, 2022 10:23
@coveralls
Copy link

coveralls commented Mar 20, 2022

Pull Request Test Coverage Report for Build 905eed645-PR-840

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 45.114%

Totals Coverage Status
Change from base Build 21da05b0a: 0.0%
Covered Lines: 5485
Relevant Lines: 12158

💛 - Coveralls

Copy link
Member

@gdey gdey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you this will make running the full set of tests much easier

@ARolek
Copy link
Member

ARolek commented Mar 23, 2022

I have 2 minor requests:

  • add a docker-compose.env file with the various env vars that you have in the run command.
  • Add the docker-compose commands to the readme

That you for this addition!

@iwpnd
Copy link
Member Author

iwpnd commented Mar 24, 2022

@ARolek thank you for the review

add a docker-compose.env file with the various env vars that you have in the run command.

You'd have to check-in an docker-compose.env.example file and tell the user to rename it.
This would also only allow me to do something like this in the docker-compose.yml:

    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${PGUSER} -d ${PGDATABASE}"]

It would not load the .env environment variables into our local environment so go test can use them. For this to work I'd have to refactor the test with a function to load the docker-compose.env or something. So the command to run the local test would still need whatever environment variables tegola uses in tests.

Add the docker-compose commands to the readme

Once the above is solved :)

docs: add a comment on top to state the context the file is used within
Copy link
Member

@ARolek ARolek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ARolek ARolek merged commit 905eed6 into go-spatial:v0.15.x Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants