Skip to content

Commit bc25b34

Browse files
committed
Merge branch 'pr/121'
Change-Id: I87a3ab5ba6934e6299e4885706d4966cd6b08d28
2 parents 8fd342d + 344c187 commit bc25b34

36 files changed

+1647
-380
lines changed

.evergreen/config.yml

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ tasks:
387387
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
388388

389389
- name: test-standalone-auth-ssl
390-
tags: ["test", "standalone"]
390+
tags: ["test", "standalone", "authssl"]
391391
commands:
392392
- func: bootstrap-mongo-orchestration
393393
vars:
@@ -401,7 +401,7 @@ tasks:
401401
SSL: "ssl"
402402

403403
- name: test-standalone-auth-ssl-compression
404-
tags: ["test", "standalone"]
404+
tags: ["test", "standalone", "authssl", "compression"]
405405
commands:
406406
- func: bootstrap-mongo-orchestration
407407
vars:
@@ -430,7 +430,7 @@ tasks:
430430
SSL: "nossl"
431431

432432
- name: test-replicaset-noauth-nossl-compression
433-
tags: ["test", "replicaset"]
433+
tags: ["test", "replicaset", "compression"]
434434
commands:
435435
- func: bootstrap-mongo-orchestration
436436
vars:
@@ -445,7 +445,7 @@ tasks:
445445
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
446446

447447
- name: test-replicaset-auth-ssl
448-
tags: ["test", "replicaset"]
448+
tags: ["test", "replicaset", "authssl"]
449449
commands:
450450
- func: bootstrap-mongo-orchestration
451451
vars:
@@ -459,7 +459,7 @@ tasks:
459459
SSL: "ssl"
460460

461461
- name: test-replicaset-auth-ssl-compression
462-
tags: ["test", "replicaset"]
462+
tags: ["test", "replicaset", "authssl", "compression"]
463463
commands:
464464
- func: bootstrap-mongo-orchestration
465465
vars:
@@ -488,7 +488,7 @@ tasks:
488488
SSL: "nossl"
489489

490490
- name: test-sharded-noauth-nossl-compression
491-
tags: ["test", "sharded"]
491+
tags: ["test", "sharded", "compression"]
492492
commands:
493493
- func: bootstrap-mongo-orchestration
494494
vars:
@@ -503,7 +503,7 @@ tasks:
503503
MONGO_GO_DRIVER_COMPRESSOR: "snappy"
504504

505505
- name: test-sharded-auth-ssl
506-
tags: ["test", "sharded"]
506+
tags: ["test", "sharded", "authssl"]
507507
commands:
508508
- func: bootstrap-mongo-orchestration
509509
vars:
@@ -517,7 +517,7 @@ tasks:
517517
SSL: "ssl"
518518

519519
- name: test-sharded-auth-ssl-compression
520-
tags: ["test", "sharded"]
520+
tags: ["test", "sharded", "authssl", "compression"]
521521
commands:
522522
- func: bootstrap-mongo-orchestration
523523
vars:
@@ -613,12 +613,31 @@ axes:
613613
display_name: "3.2"
614614
variables:
615615
VERSION: "3.2"
616+
- id: "3.0"
617+
display_name: "3.0"
618+
variables:
619+
VERSION: "3.0"
620+
- id: "2.6"
621+
display_name: "2.6"
622+
variables:
623+
VERSION: "2.6"
616624
- id: "latest"
617625
display_name: "latest"
618626
variables:
619627
VERSION: "latest"
620628

621-
- id: os
629+
# OSes that support versions of MongoDB >= 2.6 with SSL.
630+
- id: os-ssl-legacy
631+
display_name: OS
632+
values:
633+
- id: "ubuntu1404-go-1-11"
634+
display_name: "Ubuntu 14.04"
635+
run_on: ubuntu1404-test
636+
variables:
637+
GO_DIST: "/opt/golang/go1.11"
638+
639+
# OSes that require >= 3.2 for SSL
640+
- id: os-ssl-32
622641
display_name: OS
623642
values:
624643
- id: "windows-64-go-1-11"
@@ -668,14 +687,26 @@ buildvariants:
668687
tasks:
669688
- name: ".compile-check"
670689

671-
- matrix_name: "tests"
672-
matrix_spec: { version: "*", os: "*" }
673-
display_name: "${version} ${os}"
690+
- matrix_name: "tests-legacy-auth-ssl"
691+
matrix_spec: { version: ["2.6", "3.0"], os-ssl-legacy: "*" }
692+
display_name: "${version} ${os-ssl-legacy}"
693+
tasks:
694+
- name: ".test !.enterprise-auth !.compression"
695+
696+
- matrix_name: "tests-legacy-noauth-nossl"
697+
matrix_spec: { version: ["2.6", "3.0"], os-ssl-32: "*" }
698+
display_name: "${version} ${os-ssl-32}"
699+
tasks:
700+
- name: ".test !.authssl !.enterprise-auth !.compression"
701+
702+
- matrix_name: "tests-nonlegacy-servers"
703+
matrix_spec: { version: ["3.2", "3.4", "3.6", "4.0", "latest"], os-ssl-32: "*" }
704+
display_name: "${version} ${os-ssl-32}"
674705
tasks:
675-
- name: ".test !.enterprise-auth"
706+
- name: ".test !.enterprise-auth"
676707

677708
- matrix_name: "enterprise-auth-tests"
678-
matrix_spec: { os: "*" }
679-
display_name: "Enterprise Auth - ${os}"
709+
matrix_spec: { os-ssl-32: "*" }
710+
display_name: "Enterprise Auth - ${os-ssl-32}"
680711
tasks:
681712
- name: ".test .enterprise-auth"

mongo/causal_consistency_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ func skipIfSessionsSupported(t *testing.T, db *Database) {
179179
}
180180

181181
func TestCausalConsistency(t *testing.T) {
182+
skipIfBelow36(t)
183+
182184
t.Run("TestOperationTimeNil", func(t *testing.T) {
183185
// When a ClientSession is first created the operationTime has no value
184186

mongo/change_stream_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ func createStream(t *testing.T, client *Client, dbName string, collName string,
8787
return coll, stream
8888
}
8989

90+
func skipIfBelow32(t *testing.T) {
91+
serverVersion, err := getServerVersion(createTestDatabase(t, nil))
92+
require.NoError(t, err)
93+
94+
if compareVersions(t, serverVersion, "3.2") < 0 {
95+
t.Skip()
96+
}
97+
}
98+
9099
func createCollectionStream(t *testing.T, dbName string, collName string, pipeline interface{}) (*Collection, Cursor) {
91100
client := createTestClient(t)
92101
return createStream(t, client, dbName, collName, pipeline)

mongo/client_internal_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/mongodb/mongo-go-driver/mongo/writeconcern"
2828
"github.com/mongodb/mongo-go-driver/x/mongo/driver/session"
2929
"github.com/mongodb/mongo-go-driver/x/mongo/driver/uuid"
30+
"github.com/mongodb/mongo-go-driver/x/network/connstring"
3031
)
3132

3233
func createTestClient(t *testing.T) *Client {
@@ -41,6 +42,27 @@ func createTestClient(t *testing.T) *Client {
4142
}
4243
}
4344

45+
func createTestClientWithConnstring(t *testing.T, cs connstring.ConnString) *Client {
46+
id, _ := uuid.New()
47+
return &Client{
48+
id: id,
49+
topology: testutil.TopologyWithConnString(t, cs),
50+
connString: cs,
51+
readPreference: readpref.Primary(),
52+
clock: &session.ClusterClock{},
53+
registry: bson.DefaultRegistry,
54+
}
55+
}
56+
57+
func skipIfBelow30(t *testing.T) {
58+
serverVersion, err := getServerVersion(createTestDatabase(t, nil))
59+
require.NoError(t, err)
60+
61+
if compareVersions(t, serverVersion, "3.0") < 0 {
62+
t.Skip()
63+
}
64+
}
65+
4466
func TestNewClient(t *testing.T) {
4567
t.Parallel()
4668

@@ -73,6 +95,7 @@ func TestClientOptions(t *testing.T) {
7395
}
7496

7597
func TestClient_TLSConnection(t *testing.T) {
98+
skipIfBelow30(t) // 3.0 doesn't return a security field in the serverStatus response
7699
t.Parallel()
77100

78101
if testing.Short() {

0 commit comments

Comments
 (0)