diff --git a/scripts/README.md b/scripts/README.md index 5e48c855c..4d855ba4e 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -3,19 +3,5 @@ These are a collection of scripts that should be helpful for those developing on dendrite. -- `./scripts/find-lint.sh` runs the linters against dendrite, - `./scripts/find-lint.sh fast` runs a subset of faster lints -- `./scripts/build-test-lint.sh` builds, tests and lints dendrite, and - should be run before pushing commits -- `./scripts/install-local-kafka.sh` downloads, installs and runs a - kafka instance -- `./scripts/travis-test.sh` is what travis runs - - -The linters can take a lot of resources and are slow, so they can be -configured using two enviroment variables: - -- `DENDRITE_LINT_CONCURRENCY` - number of concurrent linters to run, - gometalinter defaults this to 8 -- `DENDRITE_LINT_DISABLE_GC` - if set then the the go gc will be disabled - when running the linters, speeding them up but using much more memory. +See `find-lint.sh` for environment variables that control linter resource +usage. diff --git a/scripts/build-test-lint.sh b/scripts/build-test-lint.sh index e9541ea10..cf1f37b78 100755 --- a/scripts/build-test-lint.sh +++ b/scripts/build-test-lint.sh @@ -1,5 +1,7 @@ #! /bin/bash +# Builds, tests and lints dendrite, and should be run before pushing commits + set -eu export GOPATH="$(pwd):$(pwd)/vendor" @@ -22,6 +24,3 @@ misspell -error src *.md echo "Testing..." gb test - - -echo "Done!" diff --git a/scripts/find-lint.sh b/scripts/find-lint.sh index 589032b6e..a5798afad 100755 --- a/scripts/find-lint.sh +++ b/scripts/find-lint.sh @@ -1,5 +1,16 @@ #! /bin/bash +# Runs the linters against dendrite + +# The linters can take a lot of resources and are slow, so they can be +# configured using two environment variables: +# +# - `DENDRITE_LINT_CONCURRENCY` - number of concurrent linters to run, +# gometalinter defaults this to 8 +# - `DENDRITE_LINT_DISABLE_GC` - if set then the the go gc will be disabled +# when running the linters, speeding them up but using much more memory. + + set -eu export GOPATH="$(pwd):$(pwd)/vendor" diff --git a/scripts/install-local-kafka.sh b/scripts/install-local-kafka.sh index 32f952349..869d28914 100755 --- a/scripts/install-local-kafka.sh +++ b/scripts/install-local-kafka.sh @@ -1,5 +1,7 @@ # /bin/bash +# Downloads, installs and runs a kafka instance + set -eu # The mirror to download kafka from is picked from the list of mirrors at diff --git a/scripts/travis-test.sh b/scripts/travis-test.sh index 1ea7c47cf..5851c3b0f 100755 --- a/scripts/travis-test.sh +++ b/scripts/travis-test.sh @@ -1,9 +1,12 @@ #! /bin/bash +# The entry point for travis tests + set -eu # Tune the GC to use more memory to reduce the number of garbage collections export GOGC=400 +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) gb build github.com/matrix-org/dendrite/cmd/dendrite-room-server @@ -15,8 +18,8 @@ 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 -# Run the pre commit hooks -DENDRITE_LINT_DISABLE_GC=1 ./scripts/build-test-lint.sh +# Run unit tests and linters +./scripts/build-test-lint.sh # Run the integration tests bin/roomserver-integration-tests