mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-13 00:58:06 +02:00
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:
parent
0e6294d650
commit
8935ed17fa
10 changed files with 168 additions and 249 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue