mirror of https://github.com/hashicorp/consul
Run go test packages in parallel (#6165)
* modify gotestsum hacking that is unnecessary with the latest version * try running 2 packages at a time * try running 3 packages at a time * remove old commentspull/6191/head
parent
7753b97cc7
commit
6fba0106a3
|
@ -77,16 +77,9 @@ jobs:
|
||||||
- run: mkdir -p $TEST_RESULTS_DIR
|
- run: mkdir -p $TEST_RESULTS_DIR
|
||||||
- run: sudo apt-get update && sudo apt-get install -y rsyslog
|
- run: sudo apt-get update && sudo apt-get install -y rsyslog
|
||||||
- run: sudo service rsyslog start
|
- run: sudo service rsyslog start
|
||||||
# Use CircleCI test splitting by classname. Since there are no classes in go,
|
|
||||||
# we fake it by taking everything after github.com/hashicorp/consul/ and setting
|
|
||||||
# it as the classname.
|
|
||||||
|
|
||||||
# This loop writes go test results to <reportname>.xml per go package
|
|
||||||
- run: |
|
- run: |
|
||||||
for pkg in $(go list ./... | grep -v github.com/hashicorp/consul/agent/proxyprocess |circleci tests split --split-by=timings --timings-type=classname | tr '\n' ' '); do
|
PACKAGE_NAMES=$(go list ./... | grep -v github.com/hashicorp/consul/agent/proxyprocess | circleci tests split --split-by=timings --timings-type=classname)
|
||||||
reportname=$(echo $pkg | cut -d '/' -f3- | sed "s#/#_#g")
|
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- -tags=$GOTAGS -p 3 $PACKAGE_NAMES
|
||||||
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_DIR/$reportname.xml -- -tags=$GOTAGS $pkg
|
|
||||||
done
|
|
||||||
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: /tmp/test-results
|
path: /tmp/test-results
|
||||||
|
@ -108,18 +101,11 @@ jobs:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: /go/bin
|
at: /go/bin
|
||||||
- run: mkdir -p $TEST_RESULTS_DIR
|
- run: mkdir -p $TEST_RESULTS_DIR
|
||||||
# Use CircleCI test splitting by classname. Since there are no classes in go,
|
|
||||||
# we fake it by taking everything after github.com/hashicorp/consul/ and setting
|
|
||||||
# it as the classname.
|
|
||||||
|
|
||||||
# This loop writes go test results to <reportname>.xml per go package
|
|
||||||
- run:
|
- run:
|
||||||
working_directory: api
|
working_directory: api
|
||||||
command: |
|
command: |
|
||||||
for pkg in $(go list ./... | circleci tests split --split-by=timings --timings-type=classname | tr '\n' ' '); do
|
PACKAGE_NAMES=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname)
|
||||||
reportname=$(echo $pkg | cut -d '/' -f3- | sed "s#/#_#g")
|
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- -tags=$GOTAGS $PACKAGE_NAMES
|
||||||
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_DIR/$reportname.xml -- -tags=$GOTAGS $pkg
|
|
||||||
done
|
|
||||||
|
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: /tmp/test-results
|
path: /tmp/test-results
|
||||||
|
|
Loading…
Reference in New Issue