From 01ed9e3c604dea556a3093ad44d29917297ed730 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 3 Feb 2022 17:58:59 -0500 Subject: [PATCH] ci: try to run only -short on PR branches --- .circleci/config.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9360af7647..aa5eb95ca0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -112,6 +112,10 @@ commands: echo "export AWS_SESSION_TOKEN=$(echo $CREDENTIALS | jq -r '.SessionToken')" >> $BASH_ENV run-go-test-full: + parameters: + go_test_flags: + type: string + default: "" steps: - attach_workspace: at: /home/circleci/go/bin @@ -127,6 +131,9 @@ commands: echo $PACKAGE_NAMES # some tests expect this umask, and arm images have a different default umask 0022 + + << parameters.go_test_flags >> + gotestsum \ --format=short-verbose \ --jsonfile /tmp/jsonfile/go-test-${CIRCLE_NODE_INDEX}.log \ @@ -137,6 +144,7 @@ commands: --packages="$PACKAGE_NAMES" \ --junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \ -tags="$GOTAGS" -p 2 \ + ${GO_TEST_FLAGS-} \ -cover -coverprofile=coverage.txt - store_test_results: @@ -260,7 +268,8 @@ jobs: sudo tar -C /usr/local -xzvf go1.17.5.linux-arm64.tar.gz - run: make dev - run: *install-gotestsum - - run-go-test-full + - run-go-test-full: + go_test_flags: 'if ! [[ "$CIRCLE_BRANCH" =~ ^main$|^release/ ]]; then export GO_TEST_FLAGS="-short"; fi' go-test: docker: