Shuffle travis stuff

This commit is contained in:
Erik Johnston 2017-11-07 16:52:15 +00:00
parent b7cfc2e057
commit 7deab4d803
4 changed files with 44 additions and 27 deletions

View file

@ -1,6 +1,12 @@
language: go language: go
go: go:
- 1.8 - 1.8
- 1.9
env:
- TEST_SUITE="lint"
- TEST_SUITE="unit-test"
- TEST_SUITE="integ-test"
sudo: false sudo: false
@ -21,10 +27,10 @@ install:
# Generate a self-signed X.509 certificate for TLS. # Generate a self-signed X.509 certificate for TLS.
before_script: before_script:
- openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -nodes -subj /CN=localhost - if [ "$TEST_SUITE" -eq "integ-test" ] openssl req -x509 -newkey rsa:512 -keyout server.key -out server.crt -days 365 -nodes -subj /CN=localhost
- if [ "$TEST_SUITE" -eq "integ-test" ] ./scripts/install-local-kafka.sh
script: script:
- ./scripts/install-local-kafka.sh
- ./scripts/travis-test.sh - ./scripts/travis-test.sh
notifications: notifications:

View file

@ -7,20 +7,26 @@ set -eu
export GOPATH="$(pwd):$(pwd)/vendor" export GOPATH="$(pwd):$(pwd)/vendor"
export PATH="$PATH:$(pwd)/vendor/bin:$(pwd)/bin" export PATH="$PATH:$(pwd)/vendor/bin:$(pwd)/bin"
echo "Checking that it builds" if [ "${TEST_SUITE-}" != "lint" ]; then
gb build echo "Checking that it builds"
gb build
# Check that all the packages can build. # Check that all the packages can build.
# When `go build` is given multiple packages it won't output anything, and just # 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 # checks that everything builds. This seems to do a better job of handling
# missing imports than `gb build` does. # missing imports than `gb build` does.
echo "Double checking it builds..." echo "Double checking it builds..."
go build github.com/matrix-org/dendrite/cmd/... go build github.com/matrix-org/dendrite/cmd/...
fi
./scripts/find-lint.sh if [ "${TEST_SUITE-lint}" == "lint" ]; then
./scripts/find-lint.sh
fi
echo "Double checking spelling..." echo "Double checking spelling..."
misspell -error src *.md misspell -error src *.md
echo "Testing..." if [ "${TEST_SUITE-unit-test}" == "unit-test" ]; then
gb test echo "Testing..."
gb test
fi

View file

@ -31,7 +31,7 @@ then args="$args --enable-gc"
fi fi
echo "Installing lint search engine..." echo "Installing lint search engine..."
go install github.com/alecthomas/gometalinter/ gb build github.com/alecthomas/gometalinter/
gometalinter --config=linter.json ./... --install gometalinter --config=linter.json ./... --install
echo "Looking for lint..." echo "Looking for lint..."

View file

@ -8,20 +8,25 @@ set -eu
export GOGC=400 export GOGC=400
export DENDRITE_LINT_DISABLE_GC=1 export DENDRITE_LINT_DISABLE_GC=1
# 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) # We don't bother to build if we're only checking the linting
gb build github.com/matrix-org/dendrite/cmd/dendrite-room-server if [ "${TEST_SUITE-}" != "lint" ]; then
gb build github.com/matrix-org/dendrite/cmd/roomserver-integration-tests # 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-sync-api-server gb build github.com/matrix-org/dendrite/cmd/dendrite-room-server
gb build github.com/matrix-org/dendrite/cmd/syncserver-integration-tests gb build github.com/matrix-org/dendrite/cmd/roomserver-integration-tests
gb build github.com/matrix-org/dendrite/cmd/create-account gb build github.com/matrix-org/dendrite/cmd/dendrite-sync-api-server
gb build github.com/matrix-org/dendrite/cmd/dendrite-media-api-server gb build github.com/matrix-org/dendrite/cmd/syncserver-integration-tests
gb build github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests gb build github.com/matrix-org/dendrite/cmd/create-account
gb build github.com/matrix-org/dendrite/cmd/client-api-proxy 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
fi
# Run unit tests and linters # Run unit tests and linters
./scripts/build-test-lint.sh ./scripts/build-test-lint.sh
# Run the integration tests if [ "${TEST_SUITE-unit-test}" == "integ-test" ]; then
bin/roomserver-integration-tests # Run the integration tests
bin/syncserver-integration-tests bin/roomserver-integration-tests
bin/mediaapi-integration-tests bin/syncserver-integration-tests
bin/mediaapi-integration-tests
fi