From fe72cd8c565b47965e38ff7a98a449c46f2d07eb Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 18 Jul 2019 15:29:34 +0100 Subject: [PATCH] Use race condition detection on sytest runs --- .circleci/config.yml | 2 +- build.sh | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b6f4db0..617c3bb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: # Set up dendrite - run: name: Build Dendrite - command: ./build.sh + command: ./build.sh -r - run: name: Copy dummy keys to root command: | diff --git a/build.sh b/build.sh index 9a8050f3..95157007 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,25 @@ #!/bin/sh -GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/... +ARGS="-v ./cmd/..." + +usage() { + echo "Usage: $0 [-r]" 1>&2 + echo + echo "-r" + echo " Build with race condition detection" + exit 1 +} + +while getopts ":r" o; do + case "${o}" in + r) + # Turn on race condition detection + ARGS="-race $ARGS" + ;; + *) + usage + ;; + esac +done + +GOBIN=$PWD/`dirname $0`/bin go install $ARGS