mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 00:40:25 +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
|
@ -14,23 +14,6 @@ import (
|
|||
"github.com/pomerium/pomerium/internal/testutil"
|
||||
)
|
||||
|
||||
func TestGCSStorage(t *testing.T) {
|
||||
t.Skip("fakeserver doesn't support multipart uploads")
|
||||
|
||||
ctx, clearTimeout := context.WithTimeout(context.Background(), time.Second*30)
|
||||
t.Cleanup(clearTimeout)
|
||||
|
||||
require.NoError(t, testutil.WithTestGCS(t, "bucket", func() error {
|
||||
s, err := GetCertMagicStorage(ctx, "gs://bucket/some/prefix")
|
||||
if !assert.NoError(t, err) {
|
||||
return nil
|
||||
}
|
||||
|
||||
runStorageTests(t, s)
|
||||
return nil
|
||||
}))
|
||||
}
|
||||
|
||||
func TestS3Storage(t *testing.T) {
|
||||
if os.Getenv("GITHUB_ACTION") != "" && runtime.GOOS == "darwin" {
|
||||
t.Skip("Github action can not run docker on MacOS")
|
||||
|
@ -39,15 +22,11 @@ func TestS3Storage(t *testing.T) {
|
|||
ctx, clearTimeout := context.WithTimeout(context.Background(), time.Second*30)
|
||||
t.Cleanup(clearTimeout)
|
||||
|
||||
require.NoError(t, testutil.WithTestMinIO(t, "bucket", func(endpoint string) error {
|
||||
testutil.WithTestMinIO(t, "bucket", func(endpoint string) {
|
||||
s, err := GetCertMagicStorage(ctx, "s3://"+endpoint+"/bucket/some/prefix")
|
||||
if !assert.NoError(t, err) {
|
||||
return nil
|
||||
}
|
||||
|
||||
require.NoError(t, err)
|
||||
runStorageTests(t, s)
|
||||
return nil
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
func runStorageTests(t *testing.T, s certmagic.Storage) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue