aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2022-04-08 10:12:30 +0100
committerGitHub <noreply@github.com>2022-04-08 10:12:30 +0100
commit7499147550110d24fa3a376bd811d9dd38971629 (patch)
tree335f11802f6cd391effddae9709b014ed1a17c58 /.github
parent955e6eb307c78594fe9614f6a304dc521ba28d49 (diff)
Add test infrastructure code for dendrite unit/integ tests (#2331)
* Add test infrastructure code for dendrite unit/integ tests Start re-enabling some syncapi storage tests in the process. * Linting * Add postgres service to unit tests * dendrite not syncv3 * Skip test which doesn't work * Linting * Add `jetstream.PrepareForTests` Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/dendrite.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/.github/workflows/dendrite.yml b/.github/workflows/dendrite.yml
index c80a82d1..4f337a86 100644
--- a/.github/workflows/dendrite.yml
+++ b/.github/workflows/dendrite.yml
@@ -73,6 +73,26 @@ jobs:
timeout-minutes: 5
name: Unit tests (Go ${{ matrix.go }})
runs-on: ubuntu-latest
+ # Service containers to run with `container-job`
+ services:
+ # Label used to access the service container
+ postgres:
+ # Docker Hub image
+ image: postgres:13-alpine
+ # Provide the password for postgres
+ env:
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_DB: dendrite
+ ports:
+ # Maps tcp port 5432 on service container to the host
+ - 5432:5432
+ # Set health checks to wait until postgres has started
+ options: >-
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
strategy:
fail-fast: false
matrix:
@@ -92,6 +112,11 @@ jobs:
restore-keys: |
${{ runner.os }}-go${{ matrix.go }}-test-
- run: go test ./...
+ env:
+ POSTGRES_HOST: localhost
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_DB: dendrite
# build Dendrite for linux with different architectures and go versions
build: