From 87324d58b700432590b987358c3d04fc02c3a37f Mon Sep 17 00:00:00 2001 From: Benedikt Bongartz Date: Sat, 18 May 2019 02:24:46 +0200 Subject: [PATCH] Scripts adapted to use go mod Signed-off-by: Benedikt Bongartz --- .travis.yml | 2 +- scripts/build-test-lint.sh | 4 ++-- scripts/find-lint.sh | 4 +--- scripts/travis-test.sh | 29 ++++++++++++++--------------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4bab9df4..86467a9f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ cache: - .downloads install: - - go get github.com/constabulary/gb/... + - go get -u -v github.com/alecthomas/gometalinter/ script: - ./scripts/travis-test.sh diff --git a/scripts/build-test-lint.sh b/scripts/build-test-lint.sh index f283017fd..c376763a9 100755 --- a/scripts/build-test-lint.sh +++ b/scripts/build-test-lint.sh @@ -8,7 +8,7 @@ export GOPATH="$(pwd):$(pwd)/vendor" export PATH="$PATH:$(pwd)/bin" echo "Checking that it builds" -gb build +go build ./... # Check that all the packages can build. # When `go build` is given multiple packages it won't output anything, and just @@ -20,4 +20,4 @@ go build github.com/matrix-org/dendrite/cmd/... ./scripts/find-lint.sh echo "Testing..." -gb test +go test ./... diff --git a/scripts/find-lint.sh b/scripts/find-lint.sh index 3b1cbac61..d4d9e3c4d 100755 --- a/scripts/find-lint.sh +++ b/scripts/find-lint.sh @@ -15,8 +15,6 @@ set -eux cd `dirname $0`/.. -export GOPATH="$(pwd):$(pwd)/vendor" - # prefer the versions of gometalinter and the linters that we install # to anythign that ends up on the PATH. export PATH="$(pwd)/bin:$PATH" @@ -36,7 +34,7 @@ then args="$args --enable-gc" fi echo "Installing lint search engine..." -gb build github.com/alecthomas/gometalinter/ +go build github.com/alecthomas/gometalinter/ gometalinter --config=linter.json ./... --install echo "Looking for lint..." diff --git a/scripts/travis-test.sh b/scripts/travis-test.sh index 2d0332153..1f32dcdb4 100755 --- a/scripts/travis-test.sh +++ b/scripts/travis-test.sh @@ -12,7 +12,6 @@ set -eu export GOGC=400 export DENDRITE_LINT_DISABLE_GC=1 -export GOPATH="$(pwd):$(pwd)/vendor" export PATH="$PATH:$(pwd)/bin" # starts a travis fold section. The first argument is the name of the fold @@ -51,29 +50,29 @@ if [ "${TEST_SUITE:-lint}" == "lint" ]; then fi if [ "${TEST_SUITE:-unit-test}" == "unit-test" ]; then - gb test + go test ./... fi if [ "${TEST_SUITE:-integ-test}" == "integ-test" ]; then - travis_start gb-build "Building dendrite and integ tests" - gb build + travis_start go-build "Building dendrite and integ tests" + go build travis_end - + # Check that all the packages can build. # When `go build` is given multiple packages it won't output anything, and just # checks that everything builds. This seems to do a better job of handling - # missing imports than `gb build` does. + # missing imports than `go build` does. go build github.com/matrix-org/dendrite/cmd/... - # Check that the servers build (this is done explicitly because `gb build` can silently fail (exit 0) and then we'd test a stale binary) - gb build github.com/matrix-org/dendrite/cmd/dendrite-room-server - gb build github.com/matrix-org/dendrite/cmd/roomserver-integration-tests - gb build github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server - gb build github.com/matrix-org/dendrite/cmd/syncserver-integration-tests - gb build github.com/matrix-org/dendrite/cmd/create-account - gb build github.com/matrix-org/dendrite/cmd/dendrite-media-api-server - gb build github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests - gb build github.com/matrix-org/dendrite/cmd/client-api-proxy + # Check that the servers build (this is done explicitly because `go build` can silently fail (exit 0) and then we'd test a stale binary) + go build github.com/matrix-org/dendrite/cmd/dendrite-room-server + go build github.com/matrix-org/dendrite/cmd/roomserver-integration-tests + go build github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server + go build github.com/matrix-org/dendrite/cmd/syncserver-integration-tests + go build github.com/matrix-org/dendrite/cmd/create-account + go build github.com/matrix-org/dendrite/cmd/dendrite-media-api-server + go build github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests + go build github.com/matrix-org/dendrite/cmd/client-api-proxy # Create necessary certificates and keys to run dendrite travis_start certs "Building SSL certs"