Skip to content

Fix concurrent map write (#292) #1262

Fix concurrent map write (#292)

Fix concurrent map write (#292) #1262

Workflow file for this run

name: Test Suite
on:
pull_request:
types:
- opened
pull_request_target:
types:
- opened
push:
branches:
- '*'
jobs:
test:
runs-on: ubuntu-24.04
env:
PGDATABASE: tlv2_test_server
PGUSER: root
PGPASSWORD: for_testing
PGHOST: localhost
PGPORT: 5432
TL_TEST_SERVER_DATABASE_URL: postgres://root:for_testing@localhost:5432/tlv2_test_server?sslmode=disable
# TL_TEST_FGA_ENDPOINT: http://localhost:9080
TL_REDIS_URL: redis://localhost
services:
postgres:
image: postgis/postgis:12-3.4-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: for_testing
POSTGRES_DB: tlv2_test_server
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7.4.0-alpine
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
# openfga:
# image: openfga/openfga
# ports:
# - 9080:8080
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21.5'
- run: sudo apt-get install -y gdal-bin
- run: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
- run: git clone https://github.com/interline-io/transitland-lib.git
- run: dropdb --if-exists ${PGDATABASE}
- run: ${PWD}/transitland-lib/schema/postgres/bootstrap.sh
- run: (cd cmd/tlserver && go version && go install .)
- run: ./testdata/test_setup.sh
- run: go test -v -count=1 ./...