go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.25k stars 193 forks source link

test: add a ttools helper for easier local testing #861

Closed iwpnd closed 2 years ago

iwpnd commented 2 years ago

More than once I stumble upon this during testing. Previously a local test required to setup the local development environment and passing a bunch of environment variables prior to running go test ./....

docker compose up

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

Now we allow for environment variables to be passed, but also default back to variables we used across tests and pipelines as default, making testing a little more comfy.

RUN_POSTGIS_TESTS=yes \ 
RUN_REDIS_TESTS=yes \ 
go test  ./... -v

wdyt?

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 04c4842ad-PR-861


Totals Coverage Status
Change from base Build 6387c6785: 0.0007%
Covered Lines: 5597
Relevant Lines: 12304

💛 - Coveralls
ARolek commented 2 years ago

@gdey feel free to merge this.