Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 13 additions & 35 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/river_dev?sslmode=disable

# Test database.
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/river_test?sslmode=disable
TEST_DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/river_test?pool_max_conns=15&sslmode=disable

on:
push:
Expand Down Expand Up @@ -42,6 +42,13 @@ jobs:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
# Left as a reminder that it might not be a bad idea to increase max
# connections and then increase the maximum allowed in the databaes
# pools for each package under tests. This config is only supported on
# Postgres 16+ though, and changing Postgres configuration on any
# version before that is absurdly difficult through Docker, so it
# might be worth just waiting until <16 have rolled off.
# POSTGRES_INITDB_ARGS: "-c max_connections=1500"
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
Expand All @@ -62,42 +69,13 @@ jobs:
- name: Display Go version
run: go version

- name: Set up test DBs
run: go run ./internal/cmd/testdbman create
env:
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGSSLMODE: disable
- name: Set up database
run: |
psql -c "CREATE DATABASE river_test" postgres://postgres:postgres@localhost:5432
go run github.com/riverqueue/river/cmd/river@latest migrate-up --database-url "$TEST_DATABASE_URL"

- name: Test
working-directory: .
run: go test -p 1 -race ./... -timeout 2m

- name: Test cmd/river
working-directory: ./cmd/river
run: go test -race ./... -timeout 2m

- name: Test riverdriver
working-directory: ./riverdriver
run: go test -race ./... -timeout 2m

- name: Test riverdriver/riverdatabasesql
working-directory: ./riverdriver/riverdatabasesql
run: go test -race ./... -timeout 2m

- name: Test riverdriver/riverpgxv5
working-directory: ./riverdriver/riverpgxv5
run: go test -race ./... -timeout 2m

- name: Test rivershared
working-directory: ./rivershared
run: go test -race ./... -timeout 2m

- name: Test rivertype
working-directory: ./rivertype
run: go test -race ./... -timeout 2m
run: make test/race

cli:
strategy:
Expand Down
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ linters:
- r
- sb # common convention for string builder
- t
- tb
- tt # common convention for table tests
- tx
- w
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added `river/riverlog` containing middleware that injects a context logger to workers that collates log output and persists it with job metadata. This is paired with a River UI enhancement that shows logs in the UI. [PR #844](https://github.com/riverqueue/river/pull/844).
- Added `JobInsertMiddlewareFunc` and `WorkerMiddlewareFunc` to easily implement middleware with a function instead of a struct. [PR #844](https://github.com/riverqueue/river/pull/844).
- Added `Config.Schema` which lets a non-default schema be injected explicitly into a River client that'll be used for all database operations. This may be particularly useful for proxies like PgBouncer that may not respect a schema configured in `search_path`. [PR #848](https://github.com/riverqueue/river/pull/848).

### Changed

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ $(foreach mod,$(submodules),$(eval $(call lint-target,$(mod))))
.PHONY: test
test:: ## Run test suite for all submodules
define test-target
test:: ; cd $1 && go test ./... -p 1
test:: ; cd $1 && go test ./... -timeout 2m
endef
$(foreach mod,$(submodules),$(eval $(call test-target,$(mod))))

.PHONY: test/race
test/race:: ## Run test suite for all submodules with race detector
define test-race-target
test/race:: ; cd $1 && go test ./... -p 1 -race
test/race:: ; cd $1 && go test ./... -race -timeout 2m
endef
$(foreach mod,$(submodules),$(eval $(call test-race-target,$(mod))))

Expand Down
Loading
Loading