diff --git a/.travis.yml b/.travis.yml index 9cfcf75317b..967840643b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ sudo: required services: docker go: - - 1.13.3 + - 1.14.2 - tip notifications: @@ -30,13 +30,13 @@ env: matrix: fast_finish: true allow_failures: - - go: 1.13.3 + - go: 1.14.2 env: TARGET=linux-amd64-grpcproxy - - go: 1.13.3 + - go: 1.14.2 env: TARGET=linux-amd64-coverage - go: tip env: TARGET=linux-amd64-fmt-unit-go-tip - - go: 1.13.3 + - go: 1.14.2 env: TARGET=linux-386-unit exclude: - go: tip @@ -57,7 +57,7 @@ matrix: env: TARGET=linux-amd64-grpcproxy - go: tip env: TARGET=linux-amd64-coverage - - go: 1.13.3 + - go: 1.14.2 env: TARGET=linux-amd64-fmt-unit-go-tip - go: tip env: TARGET=linux-386-unit @@ -95,7 +95,7 @@ script: linux-amd64-functional) docker run --rm \ --volume=`pwd`:/go/src/go.etcd.io/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \ - /bin/bash -c "./build && GOARCH=amd64 PASSES='functional' ./test" + /bin/bash -c "GO_BUILD_FLAGS='-v -mod=mod' ./build && GOARCH=amd64 PASSES='functional' ./test" ;; linux-amd64-unit) docker run --rm \ @@ -107,12 +107,12 @@ script: --volume=`pwd`:/go/src/go.etcd.io/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \ /bin/bash -c "GOARCH=amd64 PASSES='build' ./test \ && GOARCH=386 PASSES='build' ./test \ - && GO_BUILD_FLAGS='-v' GOOS=darwin GOARCH=amd64 ./build \ - && GO_BUILD_FLAGS='-v' GOOS=windows GOARCH=amd64 ./build \ - && GO_BUILD_FLAGS='-v' GOARCH=arm ./build \ - && GO_BUILD_FLAGS='-v' GOARCH=arm64 ./build \ - && GO_BUILD_FLAGS='-v' GOARCH=ppc64le ./build \ - && GO_BUILD_FLAGS='-v' GOARCH=s390x ./build" + && GO_BUILD_FLAGS='-v -mod=mod' GOOS=darwin GOARCH=amd64 ./build \ + && GO_BUILD_FLAGS='-v -mod=mod' GOOS=windows GOARCH=amd64 ./build \ + && GO_BUILD_FLAGS='-v -mod=mod' GOARCH=arm ./build \ + && GO_BUILD_FLAGS='-v -mod=mod' GOARCH=arm64 ./build \ + && GO_BUILD_FLAGS='-v -mod=mod' GOARCH=ppc64le ./build \ + && GO_BUILD_FLAGS='-v -mod=mod' GOARCH=s390x ./build" ;; linux-amd64-grpcproxy) sudo HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build grpcproxy'" make docker-test diff --git a/CHANGELOG-3.5.md b/CHANGELOG-3.5.md index b4a559d8af5..1676b48a066 100644 --- a/CHANGELOG-3.5.md +++ b/CHANGELOG-3.5.md @@ -61,6 +61,10 @@ See [code changes](https://github.com/etcd-io/etcd/compare/v3.4.0...v3.5.0) and - Previously, `SetFlagsFromEnv(prefix string, fs *flag.FlagSet) error`, now `SetFlagsFromEnv(lg *zap.Logger, prefix string, fs *flag.FlagSet) error`. - Previously, `SetPflagsFromEnv(prefix string, fs *pflag.FlagSet) error`, now `SetPflagsFromEnv(lg *zap.Logger, prefix string, fs *pflag.FlagSet) error`. +### Security + +- Add [`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` and `TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256` to `etcd --cipher-suites`](https://github.com/etcd-io/etcd/pull/11864). + ### Metrics, Monitoring See [List of metrics](https://github.com/etcd-io/etcd/tree/master/Documentation/metrics) for all metrics per release. @@ -89,6 +93,7 @@ Note that any `etcd_debugging_*` metrics are experimental and subject to change. - `etcd --enable-v2=true --enable-v2v3=/aaa` to enable v2 API server that is backed by **v3 storage**. - `etcd --enable-v2=false --enable-v2v3=''` to disable v2 API server. - `etcd --enable-v2=false --enable-v2v3=/aaa` to disable v2 API server. TODO: error? + - Add [`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` and `TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256` to `etcd --cipher-suites`](https://github.com/etcd-io/etcd/pull/11864). - Automatically [create parent directory if it does not exist](https://github.com/etcd-io/etcd/pull/9626) (fix [issue#9609](https://github.com/etcd-io/etcd/issues/9609)). - v4.0 will configure `etcd --enable-v2=true --enable-v2v3=/aaa` to enable v2 API server that is backed by **v3 storage**. - [`etcd --backend-bbolt-freelist-type`] flag is now stable. @@ -167,7 +172,6 @@ Note that any `etcd_debugging_*` metrics are experimental and subject to change. - Add [`/v3/auth/status`](https://github.com/etcd-io/etcd/pull/11536) endpoint to check if authentication is enabled - [Add `Linearizable` field to `etcdserverpb.MemberListRequest`](https://github.com/etcd-io/etcd/pull/11639). - ### Dependency - Upgrade [`google.golang.org/grpc`](https://github.com/grpc/grpc-go/releases) from [**`v1.23.0`**](https://github.com/grpc/grpc-go/releases/tag/v1.23.0) to [**`v1.26.0`**](https://github.com/grpc/grpc-go/releases/tag/v1.26.0). @@ -178,8 +182,8 @@ Note that any `etcd_debugging_*` metrics are experimental and subject to change. ### Go -- Require [*Go 1.13+*](https://github.com/etcd-io/etcd/pull/11110). -- Compile with [*Go 1.13*](https://golang.org/doc/devel/release.html#go1.13) +- Require [*Go 1.14+*](https://github.com/etcd-io/etcd/pull/11110). +- Compile with [*Go 1.14*](https://golang.org/doc/devel/release.html#go1.14) ### Project Governance diff --git a/Makefile b/Makefile index e340061e057..8eebef989c8 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ docker-remove: -GO_VERSION ?= 1.13.3 +GO_VERSION ?= 1.14.2 ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound") TEST_SUFFIX = $(shell date +%s | base64 | head -c 15) @@ -63,11 +63,11 @@ endif # Example: -# GO_VERSION=1.13.3 make build-docker-test +# GO_VERSION=1.14.2 make build-docker-test # make build-docker-test # # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io -# GO_VERSION=1.13.3 make push-docker-test +# GO_VERSION=1.14.2 make push-docker-test # make push-docker-test # # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com @@ -77,6 +77,7 @@ build-docker-test: $(info GO_VERSION: $(GO_VERSION)) @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/Dockerfile docker build \ + --network=host \ --tag gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \ --file ./tests/Dockerfile . @mv ./tests/Dockerfile.bak ./tests/Dockerfile @@ -187,6 +188,7 @@ build-docker-release-master: $(info ETCD_VERSION: $(ETCD_VERSION)) cp ./Dockerfile-release ./bin/Dockerfile-release docker build \ + --network=host \ --tag gcr.io/etcd-development/etcd:$(ETCD_VERSION) \ --file ./bin/Dockerfile-release \ ./bin @@ -221,6 +223,7 @@ build-docker-static-ip-test: $(info GO_VERSION: $(GO_VERSION)) @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-static-ip/Dockerfile docker build \ + --network=host \ --tag gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \ --file ./tests/docker-static-ip/Dockerfile \ ./tests/docker-static-ip @@ -285,6 +288,7 @@ build-docker-dns-test: $(info GO_VERSION: $(GO_VERSION)) @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-dns/Dockerfile docker build \ + --network=host \ --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ --file ./tests/docker-dns/Dockerfile \ ./tests/docker-dns @@ -419,6 +423,7 @@ build-docker-dns-srv-test: $(info GO_VERSION: $(GO_VERSION)) @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-dns-srv/Dockerfile docker build \ + --network=host \ --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \ --file ./tests/docker-dns-srv/Dockerfile \ ./tests/docker-dns-srv @@ -502,6 +507,7 @@ build-docker-functional: $(info ETCD_VERSION: $(ETCD_VERSION)) @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./functional/Dockerfile docker build \ + --network=host \ --tag gcr.io/etcd-development/etcd-functional:go$(GO_VERSION) \ --file ./functional/Dockerfile \ . diff --git a/functional/build b/functional/build index fd121eaf457..52ce832ee75 100755 --- a/functional/build +++ b/functional/build @@ -5,7 +5,7 @@ if ! [[ "$0" =~ "functional/build" ]]; then exit 255 fi -CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-agent ./functional/cmd/etcd-agent -CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-proxy ./functional/cmd/etcd-proxy -CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-runner ./functional/cmd/etcd-runner -CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-tester ./functional/cmd/etcd-tester +CGO_ENABLED=0 go build -v -mod=mod -installsuffix cgo -ldflags "-s" -o ./bin/etcd-agent ./functional/cmd/etcd-agent +CGO_ENABLED=0 go build -v -mod=mod -installsuffix cgo -ldflags "-s" -o ./bin/etcd-proxy ./functional/cmd/etcd-proxy +CGO_ENABLED=0 go build -v -mod=mod -installsuffix cgo -ldflags "-s" -o ./bin/etcd-runner ./functional/cmd/etcd-runner +CGO_ENABLED=0 go build -v -mod=mod -installsuffix cgo -ldflags "-s" -o ./bin/etcd-tester ./functional/cmd/etcd-tester diff --git a/functional/scripts/docker-local-agent.sh b/functional/scripts/docker-local-agent.sh index 4c212cf8526..610bd041500 100755 --- a/functional/scripts/docker-local-agent.sh +++ b/functional/scripts/docker-local-agent.sh @@ -13,7 +13,7 @@ if ! [[ "${0}" =~ "scripts/docker-local-agent.sh" ]]; then fi if [[ -z "${GO_VERSION}" ]]; then - GO_VERSION=1.13.3 + GO_VERSION=1.14.2 fi echo "Running with GO_VERSION:" ${GO_VERSION} diff --git a/functional/scripts/docker-local-tester.sh b/functional/scripts/docker-local-tester.sh index 0ff645a5e02..75f14e016ef 100755 --- a/functional/scripts/docker-local-tester.sh +++ b/functional/scripts/docker-local-tester.sh @@ -6,7 +6,7 @@ if ! [[ "${0}" =~ "scripts/docker-local-tester.sh" ]]; then fi if [[ -z "${GO_VERSION}" ]]; then - GO_VERSION=1.13.3 + GO_VERSION=1.14.2 fi echo "Running with GO_VERSION:" ${GO_VERSION} diff --git a/pkg/tlsutil/cipher_suites.go b/pkg/tlsutil/cipher_suites.go index b5916bb54dc..3932aa72757 100644 --- a/pkg/tlsutil/cipher_suites.go +++ b/pkg/tlsutil/cipher_suites.go @@ -17,30 +17,32 @@ package tlsutil import "crypto/tls" // cipher suites implemented by Go -// https://github.com/golang/go/blob/dev.boringcrypto.go1.10/src/crypto/tls/cipher_suites.go +// https://github.com/golang/go/blob/dev.boringcrypto.go1.14/src/crypto/tls/cipher_suites.go var cipherSuites = map[string]uint16{ - "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, - "TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, - "TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA, - "TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA, - "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256, - "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256, - "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384, - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, - "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + "TLS_RSA_WITH_RC4_128_SHA": tls.TLS_RSA_WITH_RC4_128_SHA, + "TLS_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA": tls.TLS_RSA_WITH_AES_128_CBC_SHA, + "TLS_RSA_WITH_AES_256_CBC_SHA": tls.TLS_RSA_WITH_AES_256_CBC_SHA, + "TLS_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_RSA_WITH_AES_128_CBC_SHA256, + "TLS_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_RSA_WITH_AES_128_GCM_SHA256, + "TLS_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, + "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA": tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256": tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256": tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, } // GetCipherSuite returns the corresponding cipher suite, diff --git a/test b/test index 08bd3e398c3..cca1e9cc940 100755 --- a/test +++ b/test @@ -152,7 +152,7 @@ function unit_pass { else USERTIMEOUT="${TIMEOUT}" fi - go test ${GO_TEST_FLAG} -timeout "${USERTIMEOUT}" "${COVER}" ${RACE} -cpu "${TEST_CPUS}" ${RUN_ARG} "$@" "${TEST[@]}" + go test -mod=mod ${GO_TEST_FLAG} -timeout "${USERTIMEOUT}" "${COVER}" ${RACE} -cpu "${TEST_CPUS}" ${RUN_ARG} "$@" "${TEST[@]}" } function integration_pass { @@ -172,7 +172,7 @@ function integration_pass { # if TESTCASE not set, PKG set, run all test cases in specified package # if TESTCASE not set, PKG not set, run all tests in all integration and integration_extra packages if [ -z "${TESTCASE}" ] && [ -z "${USERPKG}" ]; then - go test -timeout "${USERTIMEOUT}" -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/integration" + go test -mod=mod -timeout "${USERTIMEOUT}" -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/integration" integration_extra "$@" else if [ -z "${USERPKG}" ]; then @@ -184,16 +184,16 @@ function integration_pass { else INTEGTESTPKG=("${TEST[@]}") fi - go test -timeout "${USERTIMEOUT}" -v -cpu "${TEST_CPUS}" "${RUN_ARG}" "$@" "${INTEGTESTPKG[@]}" + go test -mod=mod -timeout "${USERTIMEOUT}" -v -cpu "${TEST_CPUS}" "${RUN_ARG}" "$@" "${INTEGTESTPKG[@]}" fi } function integration_extra { - go test -timeout 1m -v ${RACE} -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/client/integration" - go test -timeout 25m -v ${RACE} -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/clientv3/integration" - go test -timeout 1m -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/contrib/raftexample" - go test -timeout 5m -v ${RACE} -tags v2v3 "$@" "${REPO_PATH}/etcdserver/api/v2store" - go test -timeout 1m -v ${RACE} -cpu "${TEST_CPUS}" -run=Example "$@" "${TEST[@]}" + go test -mod=mod -timeout 1m -v ${RACE} -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/client/integration" + go test -mod=mod -timeout 25m -v ${RACE} -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/clientv3/integration" + go test -mod=mod -timeout 1m -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/contrib/raftexample" + go test -mod=mod -timeout 5m -v ${RACE} -tags v2v3 "$@" "${REPO_PATH}/etcdserver/api/v2store" + go test -mod=mod -timeout 1m -v ${RACE} -cpu "${TEST_CPUS}" -run=Example "$@" "${TEST[@]}" } function functional_pass { @@ -270,26 +270,26 @@ function cov_pass { for t in $(echo "${TEST_PKGS}" | grep -vE "(tests/e2e|functional)"); do tf=$(echo "$t" | tr / _) # cache package compilation data for faster repeated builds - go test "${GOCOVFLAGS[@]}" -i "${REPO_PATH}/$t" || true + go test -mod=mod "${GOCOVFLAGS[@]}" -i "${REPO_PATH}/$t" || true # uses -run=Test to skip examples because clientv3/ example tests will leak goroutines - go test "${GOCOVFLAGS[@]}" -run=Test -coverprofile "$COVERDIR/${tf}.coverprofile" "${REPO_PATH}/$t" || failed="$failed $t" + go test -mod=mod "${GOCOVFLAGS[@]}" -run=Test -coverprofile "$COVERDIR/${tf}.coverprofile" "${REPO_PATH}/$t" || failed="$failed $t" done # v2v3 tests - go test -tags v2v3 "${GOCOVFLAGS[@]}" -coverprofile "$COVERDIR/store-v2v3.coverprofile" "${REPO_PATH}/clientv3/integration" || failed="$failed store-v2v3" + go test -mod=mod -tags v2v3 "${GOCOVFLAGS[@]}" -coverprofile "$COVERDIR/store-v2v3.coverprofile" "${REPO_PATH}/clientv3/integration" || failed="$failed store-v2v3" # proxy tests - go test -tags cluster_proxy "${GOCOVFLAGS[@]}" -coverprofile "$COVERDIR/proxy_integration.coverprofile" "${REPO_PATH}/integration" || failed="$failed proxy-integration" - go test -tags cluster_proxy "${GOCOVFLAGS[@]}" -coverprofile "$COVERDIR/proxy_clientv3.coverprofile" "${REPO_PATH}/clientv3/integration" || failed="$failed proxy-clientv3/integration" + go test -mod=mod -tags cluster_proxy "${GOCOVFLAGS[@]}" -coverprofile "$COVERDIR/proxy_integration.coverprofile" "${REPO_PATH}/integration" || failed="$failed proxy-integration" + go test -mod=mod -tags cluster_proxy "${GOCOVFLAGS[@]}" -coverprofile "$COVERDIR/proxy_clientv3.coverprofile" "${REPO_PATH}/clientv3/integration" || failed="$failed proxy-clientv3/integration" # run code coverage for e2e tests # use 30m timeout because e2e coverage takes longer # due to many tests cause etcd process to wait # on leadership transfer timeout during gracefully shutdown echo Testing tests/e2e without proxy... - go test -tags cov -timeout 30m -v "${REPO_PATH}/tests/e2e" || failed="$failed tests/e2e" + go test -mod=mod -tags cov -timeout 30m -v "${REPO_PATH}/tests/e2e" || failed="$failed tests/e2e" echo Testing tests/e2e with proxy... - go test -tags "cov cluster_proxy" -timeout 30m -v "${REPO_PATH}/tests/e2e" || failed="$failed tests/e2e-proxy" + go test -mod=mod -tags "cov cluster_proxy" -timeout 30m -v "${REPO_PATH}/tests/e2e" || failed="$failed tests/e2e-proxy" # incrementally merge to get coverage data even if some coverage files are corrupted # optimistically assume etcdserver package's coverage file is OK since gocovmerge @@ -326,15 +326,15 @@ function e2e_pass { USERTIMEOUT="${TIMEOUT}" fi - go test -timeout "${USERTIMEOUT}" -v -cpu "${TEST_CPUS}" "${RUN_ARG}" "$@" "${REPO_PATH}/tests/e2e" + go test -mod=mod -timeout "${USERTIMEOUT}" -v -cpu "${TEST_CPUS}" "${RUN_ARG}" "$@" "${REPO_PATH}/tests/e2e" } function integration_e2e_pass { echo "Running integration and e2e tests..." - go test -timeout 30m -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/tests/e2e" & + go test -mod=mod -timeout 30m -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/tests/e2e" & e2epid="$!" - go test -timeout 30m -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/integration" & + go test -mod=mod -timeout 30m -v -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/integration" & intpid="$!" wait $e2epid wait $intpid @@ -342,9 +342,9 @@ function integration_e2e_pass { } function grpcproxy_pass { - go test -timeout 30m -v ${RACE} -tags cluster_proxy -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/integration" - go test -timeout 30m -v ${RACE} -tags cluster_proxy -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/clientv3/integration" - go test -timeout 30m -v -tags cluster_proxy "$@" "${REPO_PATH}/tests/e2e" + go test -mod=mod -timeout 30m -v ${RACE} -tags cluster_proxy -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/integration" + go test -mod=mod -timeout 30m -v ${RACE} -tags cluster_proxy -cpu "${TEST_CPUS}" "$@" "${REPO_PATH}/clientv3/integration" + go test -mod=mod -timeout 30m -v -tags cluster_proxy "$@" "${REPO_PATH}/tests/e2e" } function release_pass { @@ -448,7 +448,7 @@ function gofmt_pass { } function govet_pass { - vetRes=$(go vet "${TEST[@]}") + vetRes=$(go vet -mod=mod "${TEST[@]}") if [ -n "${vetRes}" ]; then echo -e "govet checking failed:\\n${vetRes}" exit 255 @@ -638,7 +638,8 @@ function bom_pass { return fi echo "Checking bill of materials..." - license-bill-of-materials \ + # https://github.com/golang/go/commit/7c388cc89c76bc7167287fb488afcaf5a4aa12bf + GOFLAGS="-mod=mod" license-bill-of-materials \ --override-file bill-of-materials.override.json \ go.etcd.io/etcd/v3 go.etcd.io/etcd/v3/etcdctl >bom-now.json || true if ! diff bill-of-materials.json bom-now.json; then @@ -664,15 +665,15 @@ function dep_pass { function build_cov_pass { out="bin" if [ -n "${BINDIR}" ]; then out="${BINDIR}"; fi - go test -tags cov -c -covermode=set -coverpkg="$PKGS_COMMA" -o "${out}/etcd_test" - go test -tags cov -c -covermode=set -coverpkg="$PKGS_COMMA" -o "${out}/etcdctl_test" "${REPO_PATH}/etcdctl" + go test -mod=mod -tags cov -c -covermode=set -coverpkg="$PKGS_COMMA" -o "${out}/etcd_test" + go test -mod=mod -tags cov -c -covermode=set -coverpkg="$PKGS_COMMA" -o "${out}/etcdctl_test" "${REPO_PATH}/etcdctl" } # fail fast on static tests function build_pass { echo "Checking build..." - GO_BUILD_FLAGS="-v" etcd_build - GO_BUILD_FLAGS="-v" tools_build + GO_BUILD_FLAGS="-v -mod=mod" etcd_build + GO_BUILD_FLAGS="-v -mod=mod" tools_build } for pass in $PASSES; do diff --git a/tests/semaphore.test.bash b/tests/semaphore.test.bash index e184d3e69c6..f5e3b403094 100755 --- a/tests/semaphore.test.bash +++ b/tests/semaphore.test.bash @@ -8,10 +8,10 @@ fi <