Skip to content

Use Go 1.15 in Evergreen #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@ functions:
working_dir: src/go.mongodb.org/mongo-driver
script: |
${PREPARE_SHELL}
# any go tools that we need

# Install any go tools that we need. Do this in a temp directory because running "go get" inside the driver
# repo will update the driver's go.mod/go.sum files. This puts the contents of go.mod/go.sum out of sync with
# the vendor directory and tests fail to compile due to inconsistent vendoring.
cd $(mktemp -d)
go get -u golang.org/x/lint/golint
go get -u github.com/kisielk/errcheck
cd -

# initialize submodules
git submodule init
Expand Down Expand Up @@ -1562,61 +1567,61 @@ axes:
- id: os-ssl-legacy
display_name: OS
values:
- id: "ubuntu1404-go-1-13"
- id: "ubuntu1404-go-1-15"
display_name: "Ubuntu 14.04"
run_on: ubuntu1404-test
variables:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"

# OSes that require >= 3.2 for SSL
- id: os-ssl-32
display_name: OS
values:
- id: "windows-64-go-1-13"
- id: "windows-64-go-1-15"
display_name: "Windows 64-bit"
run_on:
- windows-64-vs2017-test
variables:
GCC_PATH: "/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin"
GO_DIST: "C:\\golang\\go1.13"
GO_DIST: "C:\\golang\\go1.15"
PYTHON3_BINARY: "C:/python/Python38/python.exe"
VENV_BIN_DIR: "Scripts"
- id: "ubuntu1604-64-go-1-13"
- id: "ubuntu1604-64-go-1-15"
display_name: "Ubuntu 16.04"
run_on: ubuntu1604-build
variables:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
PYTHON3_BINARY: "/opt/python/3.8/bin/python3"
- id: "osx-go-1-13"
- id: "osx-go-1-15"
display_name: "MacOS 10.14"
run_on: macos-1014
variables:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
PYTHON3_BINARY: python3

- id: os-aws-auth
display_name: OS
values:
- id: "windows-64-vsMulti-small-go-1-13"
- id: "windows-64-vsMulti-small-go-1-15"
display_name: "Windows 64-bit"
run_on:
- windows-64-vsMulti-small
variables:
GCC_PATH: "/cygdrive/c/mingw-w64/x86_64-4.9.1-posix-seh-rt_v3-rev1/mingw64/bin"
GO_DIST: "C:\\golang\\go1.13"
GO_DIST: "C:\\golang\\go1.15"
SKIP_ECS_AUTH_TEST: true
PYTHON3: "C:/python/Python38/python.exe"
- id: "ubuntu1804-64-go-1-13"
- id: "ubuntu1804-64-go-1-15"
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-test
variables:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
PYTHON3: python3
- id: "osx-go-1-13"
- id: "osx-go-1-15"
display_name: "MacOS 10.14"
run_on: macos-1014
variables:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
SKIP_ECS_AUTH_TEST: true
SKIP_EC2_AUTH_TEST: true
PYTHON3: python3
Expand All @@ -1627,7 +1632,7 @@ buildvariants:
run_on:
- ubuntu1604-build
expansions:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
tasks:
- name: ".static-analysis"

Expand All @@ -1636,7 +1641,7 @@ buildvariants:
run_on:
- ubuntu1604-build
expansions:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
tasks:
- name: ".performance"

Expand All @@ -1645,7 +1650,7 @@ buildvariants:
run_on:
- ubuntu1604-test
expansions:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
tasks:
- name: ".compile-check"

Expand All @@ -1654,7 +1659,7 @@ buildvariants:
run_on:
- ubuntu1604-build
expansions:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
tasks:
- name: "atlas-test"

Expand All @@ -1663,7 +1668,7 @@ buildvariants:
run_on:
- ubuntu1604-build
expansions:
GO_DIST: "/opt/golang/go1.13"
GO_DIST: "/opt/golang/go1.15"
tasks:
- name: "test-atlas-data-lake"

Expand Down Expand Up @@ -1717,22 +1722,22 @@ buildvariants:
- name: "aws-auth-test"

- matrix_name: "ocsp-test"
matrix_spec: { version: ["4.4", "latest"], os-ssl-32: ["ubuntu1604-64-go-1-13"] }
matrix_spec: { version: ["4.4", "latest"], os-ssl-32: ["ubuntu1604-64-go-1-15"] }
display_name: "OCSP ${version} ${os-ssl-32}"
batchtime: 20160 # 14 days
tasks:
- name: ".ocsp"

- matrix_name: "ocsp-test-windows"
matrix_spec: { version: ["4.4", "latest"], os-ssl-32: ["windows-64-go-1-13"] }
matrix_spec: { version: ["4.4", "latest"], os-ssl-32: ["windows-64-go-1-15"] }
display_name: "OCSP ${version} ${os-ssl-32}"
batchtime: 20160 # 14 days
tasks:
# Windows MongoDB servers do not staple OCSP responses and only support RSA.
- name: ".ocsp-rsa !.ocsp-staple"

- matrix_name: "ocsp-test-macos"
matrix_spec: { version: ["4.4", "latest"], os-ssl-32: ["osx-go-1-13"] }
matrix_spec: { version: ["4.4", "latest"], os-ssl-32: ["osx-go-1-15"] }
display_name: "OCSP ${version} ${os-ssl-32}"
batchtime: 20160 # 14 days
tasks:
Expand Down
4 changes: 3 additions & 1 deletion bson/bson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ func noerr(t *testing.T, err error) {
}
}

func requireErrEqual(t *testing.T, err1 error, err2 error) { require.True(t, compareErrors(err1, err2)) }
func requireErrEqual(t *testing.T, err1 error, err2 error) {
require.True(t, compareErrors(err1, err2))
}

func TestTimeRoundTrip(t *testing.T) {
val := struct {
Expand Down
12 changes: 9 additions & 3 deletions bson/raw_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (rv RawValue) UnmarshalWithContext(dc *bsoncodec.DecodeContext, val interfa
}

func convertFromCoreValue(v bsoncore.Value) RawValue { return RawValue{Type: v.Type, Value: v.Data} }
func convertToCoreValue(v RawValue) bsoncore.Value { return bsoncore.Value{Type: v.Type, Data: v.Value} }
func convertToCoreValue(v RawValue) bsoncore.Value {
return bsoncore.Value{Type: v.Type, Data: v.Value}
}

// Validate ensures the value is a valid BSON value.
func (rv RawValue) Validate() error { return convertToCoreValue(rv).Validate() }
Expand Down Expand Up @@ -176,7 +178,9 @@ func (rv RawValue) ObjectID() primitive.ObjectID { return convertToCoreValue(rv)

// ObjectIDOK is the same as ObjectID, except it returns a boolean instead of
// panicking.
func (rv RawValue) ObjectIDOK() (primitive.ObjectID, bool) { return convertToCoreValue(rv).ObjectIDOK() }
func (rv RawValue) ObjectIDOK() (primitive.ObjectID, bool) {
return convertToCoreValue(rv).ObjectIDOK()
}

// Boolean returns the boolean value the Value represents. It panics if the
// value is a BSON type other than boolean.
Expand Down Expand Up @@ -214,7 +218,9 @@ func (rv RawValue) RegexOK() (pattern, options string, ok bool) {

// DBPointer returns the BSON dbpointer value the Value represents. It panics if the value is a BSON
// type other than DBPointer.
func (rv RawValue) DBPointer() (string, primitive.ObjectID) { return convertToCoreValue(rv).DBPointer() }
func (rv RawValue) DBPointer() (string, primitive.ObjectID) {
return convertToCoreValue(rv).DBPointer()
}

// DBPointerOK is the same as DBPoitner, except that it returns a boolean
// instead of panicking.
Expand Down
2 changes: 1 addition & 1 deletion mongo/mongo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestMongoHelpers(t *testing.T) {
got, id, err := transformAndEnsureID(bson.DefaultRegistry, doc)
assert.Nil(t, err, "transformAndEnsureID error: %v", err)
_, ok := id.(string)
assert.True(t, ok, "expected returned id type %T, got %T", string(0), id)
assert.True(t, ok, "expected returned id type string, got %T", id)
assert.Equal(t, got, want, "expected document %v, got %v", got, want)
})
})
Expand Down
7 changes: 5 additions & 2 deletions x/bsonx/bsoncore/bsoncore.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ import (
// EmptyDocumentLength is the length of a document that has been started/ended but has no elements.
const EmptyDocumentLength = 5

// nullTerminator is a string version of the 0 byte that is appended at the end of cstrings.
const nullTerminator = string(byte(0))

// AppendType will append t to dst and return the extended buffer.
func AppendType(dst []byte, t bsontype.Type) []byte { return append(dst, byte(t)) }

// AppendKey will append key to dst and return the extended buffer.
func AppendKey(dst []byte, key string) []byte { return append(dst, key+string(0x00)...) }
func AppendKey(dst []byte, key string) []byte { return append(dst, key+nullTerminator...) }

// AppendHeader will append Type t and key to dst and return the extended
// buffer.
Expand Down Expand Up @@ -427,7 +430,7 @@ func AppendNullElement(dst []byte, key string) []byte { return AppendHeader(dst,

// AppendRegex will append pattern and options to dst and return the extended buffer.
func AppendRegex(dst []byte, pattern, options string) []byte {
return append(dst, pattern+string(0x00)+options+string(0x00)...)
return append(dst, pattern+nullTerminator+options+nullTerminator...)
}

// AppendRegexElement will append a BSON regex element using key, pattern, and
Expand Down
4 changes: 3 additions & 1 deletion x/mongo/driver/wiremessage/wiremessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ func ReadCompressedOriginalOpCode(src []byte) (opcode OpCode, rem []byte, ok boo

// ReadCompressedUncompressedSize reads the uncompressed size of a
// compressed wiremessage to dst.
func ReadCompressedUncompressedSize(src []byte) (size int32, rem []byte, ok bool) { return readi32(src) }
func ReadCompressedUncompressedSize(src []byte) (size int32, rem []byte, ok bool) {
return readi32(src)
}

// ReadCompressedCompressorID reads the ID of the compressor to dst.
func ReadCompressedCompressorID(src []byte) (id CompressorID, rem []byte, ok bool) {
Expand Down