summaryrefslogtreecommitdiff
path: root/vendor/github.com/testcontainers/testcontainers-go/testing.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-11 21:22:43 -0600
committermo khan <mo@mokhan.ca>2025-05-11 21:22:43 -0600
commit05fae21a33b74e7768a94eb84294f6198c3cec56 (patch)
treefce6d4813f10704d3d17ba69e235e097da1f0574 /vendor/github.com/testcontainers/testcontainers-go/testing.go
parentb1b29603622451f677f61be9300987ee3e79a2ff (diff)
chore: update go modules
Diffstat (limited to 'vendor/github.com/testcontainers/testcontainers-go/testing.go')
-rw-r--r--vendor/github.com/testcontainers/testcontainers-go/testing.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/testcontainers/testcontainers-go/testing.go b/vendor/github.com/testcontainers/testcontainers-go/testing.go
index 017f1a4..1f41913 100644
--- a/vendor/github.com/testcontainers/testcontainers-go/testing.go
+++ b/vendor/github.com/testcontainers/testcontainers-go/testing.go
@@ -53,6 +53,21 @@ func SkipIfDockerDesktop(t *testing.T, ctx context.Context) {
}
}
+// SkipIfNotDockerDesktop is a utility function capable of skipping tests
+// if tests are not run using Docker Desktop.
+func SkipIfNotDockerDesktop(t *testing.T, ctx context.Context) {
+ t.Helper()
+ cli, err := NewDockerClientWithOpts(ctx)
+ require.NoErrorf(t, err, "failed to create docker client: %s", err)
+
+ info, err := cli.Info(ctx)
+ require.NoErrorf(t, err, "failed to get docker info: %s", err)
+
+ if info.OperatingSystem != "Docker Desktop" {
+ t.Skip("Skipping test that needs Docker Desktop")
+ }
+}
+
// exampleLogConsumer {
// StdoutLogConsumer is a LogConsumer that prints the log to stdout