tests: use testcontainers (#5341)

* tests: use testcontainers for postgres

* tests: use testcontainers for minio

* remove gcs test

* try installing docker

* skip docker on macos
This commit is contained in:
Caleb Doxsey 2024-10-30 13:33:30 -06:00 committed by GitHub
parent 0e6294d650
commit 8935ed17fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 168 additions and 249 deletions

View file

@ -24,16 +24,16 @@ import (
const maxWait = time.Minute * 10
func TestBackend(t *testing.T) {
t.Parallel()
if os.Getenv("GITHUB_ACTION") != "" && runtime.GOOS == "darwin" {
t.Skip("Github action can not run docker on MacOS")
}
t.Parallel()
ctx, clearTimeout := context.WithTimeout(context.Background(), maxWait)
defer clearTimeout()
require.NoError(t, testutil.WithTestPostgres(func(dsn string) error {
testutil.WithTestPostgres(t, func(dsn string) {
backend := New(ctx, dsn)
defer backend.Close()
@ -197,9 +197,7 @@ func TestBackend(t *testing.T) {
assert.Equal(t, int32(0), backend.pool.Stat().AcquiredConns(),
"acquired connections should be released")
return nil
}))
})
}
func TestLookup(t *testing.T) {