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

@ -6,6 +6,8 @@ import (
"fmt"
"io"
"net"
"os"
"runtime"
"sort"
"testing"
"time"
@ -341,7 +343,13 @@ func TestServerInvalidStorage(t *testing.T) {
}
func TestServerPostgres(t *testing.T) {
testutil.WithTestPostgres(func(dsn string) error {
t.Parallel()
if os.Getenv("GITHUB_ACTION") != "" && runtime.GOOS == "darwin" {
t.Skip("Github action can not run docker on MacOS")
}
testutil.WithTestPostgres(t, func(dsn string) {
srv := newServer(&serverConfig{
storageType: "postgres",
storageConnectionString: dsn,
@ -400,6 +408,5 @@ func TestServerPostgres(t *testing.T) {
return nil
})
assert.NoError(t, eg.Wait())
return nil
})
}