Start testing Go 1.14.1 in Travis. (#4718)
As part of the process, pin specific versions of protoc-gen-go, mockgen, and goveralls. Protoc-gen-go recently released a version that was incompatible with our current version of gRPC. Mockgen has a version that was generating spurious diffs in our generate test phase, and goveralls recently added some code that calls git branch --format=..., which breaks on the version of git in our Docker image. Pinning versions required forcing go get into module-aware mode, since the old-style go get doesn't understand versions.
This commit is contained in:
parent
f26228703e
commit
995e25e8c3
|
|
@ -2,6 +2,7 @@ language: go
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- "1.13.2"
|
- "1.13.2"
|
||||||
|
- "1.14.1"
|
||||||
|
|
||||||
go_import_path: github.com/letsencrypt/boulder
|
go_import_path: github.com/letsencrypt/boulder
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ version: '3'
|
||||||
services:
|
services:
|
||||||
boulder:
|
boulder:
|
||||||
# To minimize fetching this should be the same version used below
|
# To minimize fetching this should be the same version used below
|
||||||
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.13.2}:2020-01-07
|
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.13.2}:2020-03-26
|
||||||
environment:
|
environment:
|
||||||
FAKE_DNS: 10.77.77.77
|
FAKE_DNS: 10.77.77.77
|
||||||
PKCS11_PROXY_SOCKET: tcp://boulder-hsm:5657
|
PKCS11_PROXY_SOCKET: tcp://boulder-hsm:5657
|
||||||
|
|
@ -58,7 +58,7 @@ services:
|
||||||
working_dir: /go/src/github.com/letsencrypt/boulder
|
working_dir: /go/src/github.com/letsencrypt/boulder
|
||||||
bhsm:
|
bhsm:
|
||||||
# To minimize fetching this should be the same version used above
|
# To minimize fetching this should be the same version used above
|
||||||
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.13.2}:2020-01-07
|
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.13.2}:2020-03-26
|
||||||
environment:
|
environment:
|
||||||
PKCS11_DAEMON_SOCKET: tcp://0.0.0.0:5657
|
PKCS11_DAEMON_SOCKET: tcp://0.0.0.0:5657
|
||||||
command: /usr/local/bin/pkcs11-daemon /usr/lib/softhsm/libsofthsm2.so
|
command: /usr/local/bin/pkcs11-daemon /usr/lib/softhsm/libsofthsm2.so
|
||||||
|
|
@ -85,7 +85,7 @@ services:
|
||||||
logging:
|
logging:
|
||||||
driver: none
|
driver: none
|
||||||
netaccess:
|
netaccess:
|
||||||
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.13.2}:2020-01-07
|
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.13.2}:2020-03-26
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOFLAGS: "-mod=vendor"
|
GOFLAGS: "-mod=vendor"
|
||||||
|
|
|
||||||
|
|
@ -36,24 +36,30 @@ apt-get install -y --no-install-recommends \
|
||||||
curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
|
curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o /tmp/protoc.zip
|
||||||
unzip /tmp/protoc.zip -d /usr/local/protoc
|
unzip /tmp/protoc.zip -d /usr/local/protoc
|
||||||
|
|
||||||
# Override default GOBIN and GOPATH
|
# Override default GOBIN and GOCACHE
|
||||||
export GOBIN=/usr/local/bin GOPATH=/tmp/gopath
|
export GOBIN=/usr/local/bin GOCACHE=/tmp/gocache
|
||||||
|
|
||||||
# Install protobuf and testing/dev tools.
|
# Install protobuf and testing/dev tools.
|
||||||
go get \
|
# Note: The version of golang/protobuf is partially tied to the version of grpc
|
||||||
github.com/letsencrypt/pebble/cmd/pebble-challtestsrv \
|
# used by Boulder overall. Updating it may require updating the grpc version
|
||||||
|
# and vice versa.
|
||||||
|
GO111MODULE=on go get \
|
||||||
bitbucket.org/liamstask/goose/cmd/goose \
|
bitbucket.org/liamstask/goose/cmd/goose \
|
||||||
golang.org/x/lint/golint \
|
golang.org/x/lint/golint \
|
||||||
github.com/golang/mock/mockgen \
|
github.com/golang/mock/mockgen@v1.3.0 \
|
||||||
github.com/golang/protobuf/proto \
|
github.com/golang/protobuf/proto@v1.3.2 \
|
||||||
github.com/golang/protobuf/protoc-gen-go \
|
github.com/golang/protobuf/protoc-gen-go@v1.3.2 \
|
||||||
github.com/kisielk/errcheck \
|
github.com/kisielk/errcheck \
|
||||||
github.com/mattn/goveralls \
|
github.com/mattn/goveralls@v0.0.3 \
|
||||||
github.com/modocache/gover \
|
github.com/modocache/gover \
|
||||||
golang.org/x/tools/cover \
|
golang.org/x/tools/cover \
|
||||||
golang.org/x/tools/cmd/stringer \
|
golang.org/x/tools/cmd/stringer \
|
||||||
github.com/gordonklaus/ineffassign
|
github.com/gordonklaus/ineffassign
|
||||||
|
|
||||||
|
# Pebble's latest version is v2+, but it's not properly go mod compatible, so we
|
||||||
|
# fetch it in GOPATH mode.
|
||||||
|
go get github.com/letsencrypt/pebble/cmd/pebble-challtestsrv
|
||||||
|
|
||||||
# Install codespell for linting common spelling errors
|
# Install codespell for linting common spelling errors
|
||||||
pip3 install codespell
|
pip3 install codespell
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ cd $(dirname $0)
|
||||||
|
|
||||||
DATESTAMP=$(date +%Y-%m-%d)
|
DATESTAMP=$(date +%Y-%m-%d)
|
||||||
BASE_TAG_NAME="letsencrypt/boulder-tools"
|
BASE_TAG_NAME="letsencrypt/boulder-tools"
|
||||||
GO_VERSIONS=( "1.13.2" )
|
GO_VERSIONS=( "1.13.2" "1.14.1" )
|
||||||
|
|
||||||
# Build a tagged image for each GO_VERSION
|
# Build a tagged image for each GO_VERSION
|
||||||
for GO_VERSION in "${GO_VERSIONS[@]}"
|
for GO_VERSION in "${GO_VERSIONS[@]}"
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,6 @@ func newMockDirectoryServer() *mockDirectoryServer {
|
||||||
// TestNew tests that creating a new Client and populating the endpoint map
|
// TestNew tests that creating a new Client and populating the endpoint map
|
||||||
// works correctly.
|
// works correctly.
|
||||||
func TestNew(t *testing.T) {
|
func TestNew(t *testing.T) {
|
||||||
unreachableDirectoryURL := "http://localhost:1987"
|
|
||||||
|
|
||||||
srv := newMockDirectoryServer()
|
srv := newMockDirectoryServer()
|
||||||
srv.Start()
|
srv.Start()
|
||||||
defer srv.Close()
|
defer srv.Close()
|
||||||
|
|
@ -153,11 +151,14 @@ func TestNew(t *testing.T) {
|
||||||
DirectoryURL: "http://" + string([]byte{0x1, 0x7F}),
|
DirectoryURL: "http://" + string([]byte{0x1, 0x7F}),
|
||||||
ExpectedError: ErrInvalidDirectoryURL.Error(),
|
ExpectedError: ErrInvalidDirectoryURL.Error(),
|
||||||
},
|
},
|
||||||
|
/* This test case depends on an error message that changed in Go 1.14. We
|
||||||
|
can uncomment it once we've moved fully to Go 1.14.
|
||||||
{
|
{
|
||||||
Name: "unreachable directory URL",
|
Name: "unreachable directory URL",
|
||||||
DirectoryURL: unreachableDirectoryURL,
|
DirectoryURL: "http://localhost:1987",
|
||||||
ExpectedError: "Get http://localhost:1987: dial tcp 127.0.0.1:1987: connect: connection refused",
|
ExpectedError: "Get http://localhost:1987: dial tcp 127.0.0.1:1987: connect: connection refused",
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
Name: "wrong directory HTTP status code",
|
Name: "wrong directory HTTP status code",
|
||||||
DirectoryURL: wrongStatusCodeURL,
|
DirectoryURL: wrongStatusCodeURL,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue