From d9d014702846ccc2d238a6c18d7141e34d25848e Mon Sep 17 00:00:00 2001 From: Matt Dale <9760375+matthewdale@users.noreply.github.com> Date: Thu, 26 Jun 2025 18:25:45 -0700 Subject: [PATCH] Prevent integration tests from running when testing with -short --- internal/integtest/integtest.go | 4 ++++ x/mongo/driver/topology/server_test.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/internal/integtest/integtest.go b/internal/integtest/integtest.go index 37ab6e4d77..af4d3e3210 100644 --- a/internal/integtest/integtest.go +++ b/internal/integtest/integtest.go @@ -223,6 +223,10 @@ func AddServerlessAuthCredentials(uri string) (string, error) { // ConnString gets the globally configured connection string. func ConnString(t *testing.T) *connstring.ConnString { + if testing.Short() { + t.Skip("skipping integration test in short mode") + } + connectionStringOnce.Do(func() { uri, err := MongoDBURI() require.NoError(t, err, "error constructing mongodb URI: %v", err) diff --git a/x/mongo/driver/topology/server_test.go b/x/mongo/driver/topology/server_test.go index 818a7818f6..2b2cb980ec 100644 --- a/x/mongo/driver/topology/server_test.go +++ b/x/mongo/driver/topology/server_test.go @@ -130,6 +130,9 @@ func (d *timeoutDialer) DialContext(ctx context.Context, network, address string // TestServerHeartbeatTimeout tests timeout retry and preemptive canceling. func TestServerHeartbeatTimeout(t *testing.T) { + if testing.Short() { + t.Skip("skipping integration test in short mode") + } if os.Getenv("DOCKER_RUNNING") != "" { t.Skip("Skipping this test in docker.") }