Skip to content

Commit 4f5697d

Browse files
committed
Use flags instead of docker auto-detection
1 parent cb30721 commit 4f5697d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

components/content-service/pkg/storage/gcloud_test.go

+4-10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"context"
1010
"crypto/rand"
1111
"crypto/tls"
12+
"flag"
1213
"io"
1314
"io/ioutil"
1415
"net/http"
@@ -65,6 +66,8 @@ func TestObjectAccessToNonExistentObj(t *testing.T) {
6566
}
6667
}
6768

69+
var runWithDocker = flag.Bool("with-docker", false, "run fake-gcs-server in docker")
70+
6871
func TestObjectUpload(t *testing.T) {
6972
tests := []struct {
7073
Desc string
@@ -90,7 +93,7 @@ func TestObjectUpload(t *testing.T) {
9093

9194
// use docker to run the fake GCS server
9295
// or start an embed server otherwise
93-
switch isDockerRunning() {
96+
switch *runWithDocker {
9497
case true:
9598
var gcsContainer *fakeGCSContainer
9699
gcsContainer, err = setupFakeStorage(ctx)
@@ -289,12 +292,3 @@ func setupFakeStorage(ctx context.Context) (*fakeGCSContainer, error) {
289292
URI: "https://localhost:4443/storage/v1/",
290293
}, nil
291294
}
292-
293-
func isDockerRunning() bool {
294-
p, err := testcontainers.NewDockerProvider()
295-
if err != nil {
296-
return false
297-
}
298-
299-
return p.Health(context.Background()) == nil
300-
}

0 commit comments

Comments
 (0)