Skip to content

Commit

Permalink
Merge pull request #1594 from bradengroom/pgbouncer
Browse files Browse the repository at this point in the history
Run postgres datastore tests with pgbouncer
  • Loading branch information
vroldanbet authored Oct 27, 2023
2 parents aec1c86 + 8d1dc41 commit 6770f9b
Show file tree
Hide file tree
Showing 7 changed files with 1,591 additions and 1,406 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
strategy:
fail-fast: false
matrix:
datastore: ["crdb", "mysql", "postgres", "spanner"]
datastore: ["crdb", "mysql", "postgres", "spanner", "pgbouncer"]
steps:
- uses: "actions/checkout@v3"
- uses: "authzed/actions/setup-go@main"
Expand Down
31 changes: 31 additions & 0 deletions internal/datastore/postgres/pgbouncer_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//go:build ci && docker && pgbouncer
// +build ci,docker,pgbouncer

package postgres

import (
"testing"

pgversion "github.com/authzed/spicedb/internal/datastore/postgres/version"

"github.com/samber/lo"
)

var pgbouncerConfigs = lo.Map(
[]string{pgversion.MinimumSupportedPostgresVersion, "14", "15", "16"},
func(postgresVersion string, _ int) postgresConfig {
return postgresConfig{"head", "", postgresVersion, true}
},
)

func TestPostgresWithPgBouncerDatastore(t *testing.T) {
t.Parallel()

testPostgresDatastore(t, pgbouncerConfigs)
}

func TestPostgresDatastoreWithPgBouncerWithoutCommitTimestamps(t *testing.T) {
t.Parallel()

testPostgresDatastoreWithoutCommitTimestamps(t, pgbouncerConfigs)
}
Loading

0 comments on commit 6770f9b

Please sign in to comment.