Skip to content

Commit ecd374a

Browse files
authored
Merge pull request #2116 from matthewdale/fix-test-short-2
Prevent integration tests from running when testing with -short
2 parents 33b7c6e + d9d0147 commit ecd374a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

internal/integtest/integtest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ func AddServerlessAuthCredentials(uri string) (string, error) {
223223

224224
// ConnString gets the globally configured connection string.
225225
func ConnString(t *testing.T) *connstring.ConnString {
226+
if testing.Short() {
227+
t.Skip("skipping integration test in short mode")
228+
}
229+
226230
connectionStringOnce.Do(func() {
227231
uri, err := MongoDBURI()
228232
require.NoError(t, err, "error constructing mongodb URI: %v", err)

x/mongo/driver/topology/server_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ func (d *timeoutDialer) DialContext(ctx context.Context, network, address string
130130

131131
// TestServerHeartbeatTimeout tests timeout retry and preemptive canceling.
132132
func TestServerHeartbeatTimeout(t *testing.T) {
133+
if testing.Short() {
134+
t.Skip("skipping integration test in short mode")
135+
}
133136
if os.Getenv("DOCKER_RUNNING") != "" {
134137
t.Skip("Skipping this test in docker.")
135138
}

0 commit comments

Comments
 (0)