Merge lp:~gz/juju-ci-tools/run_tests_race into lp:juju-ci-tools

Proposed by Martin Packman
Status: Merged
Approved by: Martin Packman
Approved revision: 963
Merged at revision: 963
Proposed branch: lp:~gz/juju-ci-tools/run_tests_race
Merge into: lp:juju-ci-tools
Diff against target: 47 lines (+8/-5)
1 file modified
run-unit-tests (+8/-5)
To merge this branch: bzr merge lp:~gz/juju-ci-tools/run_tests_race
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+260180@code.launchpad.net

Description of the change

Add --race flag to run-unit-test script

Will run the unit tests with go's -race flag, which we expect to make some additional tests fail.

There is one behaviour change here for previous cases, passing both --safe and --retry will use -p 2 for both test runs.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-unit-tests'
2--- run-unit-tests 2015-05-19 15:23:38 +0000
3+++ run-unit-tests 2015-05-26 15:35:19 +0000
4@@ -9,10 +9,10 @@
5 FIXUP_SOURCES=""
6 IS_LOCAL="false"
7 RETRY="false"
8-SAFE="false"
9 REVISION_BUILD=${revision_build:-}
10 USE_PPA=""
11 USE_TMPFS="false"
12+GOTESTCMD="go test"
13 LOG_FILE_PATH="/usr/share/distro-info/ubuntu.csv"
14 LOG_TXT="17.04,Angsty Antelope,angsty,2016-10-23,2017-04-30,2018-01-29"
15
16@@ -25,7 +25,7 @@
17 RETRY="true"
18 ;;
19 --safe)
20- SAFE="true"
21+ GOTESTCMD="$GOTESTCMD -p 2"
22 ;;
23 --local)
24 IS_LOCAL="true"
25@@ -47,6 +47,9 @@
26 --use-tmpfs)
27 USE_TMPFS="true"
28 ;;
29+ --race)
30+ GOTESTCMD="$GOTESTCMD -race"
31+ ;;
32 esac
33 shift
34 done
35@@ -160,9 +163,9 @@
36 fi
37
38 if [[ "$RETRY" == "true" ]]; then
39- go test ./... || go test -p 2 ./...
40-elif [[ "$SAFE" == "true" ]]; then
41- go test -p 2 ./...
42+ $GOTESTCMD ./... || $GOTESTCMD ./...
43+elif [[ "$GOTESTCMD" != "go test" ]]; then
44+ $GOTESTCMD ./...
45 else
46 make check
47 fi

Subscribers

People subscribed via source and target branches