ci: update go_test to match one from ent (#11951)

This commit is contained in:
Sam Salisbury 2021-06-28 16:07:00 +01:00 committed by GitHub
parent 52f78f1d54
commit e7bbd110ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 136 additions and 51 deletions

88
.circleci/config.yml generated
View File

@ -877,6 +877,12 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
version: 18.09.3
- add_ssh_keys:
fingerprints:
- 0e:03:77:f4:e2:c3:56:c2:53:6a:03:e1:31:91:2f:06
- run:
command: |
git config --global url."git@github.com:".insteadOf https://github.com/
- run:
command: |
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
@ -956,9 +962,17 @@ jobs:
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
fi
# Start a docker testcontainer to run the tests in
docker run -d -e TEST_DOCKER_NETWORK_ID \
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
docker run -d \
-e TEST_DOCKER_NETWORK_ID \
-e GOPRIVATE \
-e DOCKER_CERT_PATH \
-e DOCKER_HOST \
-e DOCKER_MACHINE_NAME \
-e DOCKER_TLS_VERIFY \
-e NO_PROXY \
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
--network vaulttest --name \
testcontainer docker.mirror.hashicorp.services/circleci/golang:1.16.5-buster \
@ -977,8 +991,10 @@ jobs:
docker exec -w /go/src/github.com/hashicorp/vault/ \
-e CIRCLECI -e VAULT_CI_GO_TEST_RACE \
-e GOCACHE=/tmp/gocache \
-e GO_TAGS \
-e GOPROXY="off" \
-e VAULT_LICENSE_CI \
-e GOARCH=amd64 \
testcontainer \
gotestsum --format=short-verbose \
--junitfile test-results/go-test/results.xml \
@ -1002,6 +1018,8 @@ jobs:
\
${package_names}
fi
environment:
GOPRIVATE: github.com/hashicorp/*
name: Run Go tests
no_output_timeout: 60m
- run:
@ -1116,6 +1134,12 @@ jobs:
name: Check branch name
working_directory: ~/
- checkout
- add_ssh_keys:
fingerprints:
- 0e:03:77:f4:e2:c3:56:c2:53:6a:03:e1:31:91:2f:06
- run:
command: |
git config --global url."git@github.com:".insteadOf https://github.com/
- run:
command: |
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
@ -1194,9 +1218,17 @@ jobs:
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
fi
# Start a docker testcontainer to run the tests in
docker run -d -e TEST_DOCKER_NETWORK_ID \
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
docker run -d \
-e TEST_DOCKER_NETWORK_ID \
-e GOPRIVATE \
-e DOCKER_CERT_PATH \
-e DOCKER_HOST \
-e DOCKER_MACHINE_NAME \
-e DOCKER_TLS_VERIFY \
-e NO_PROXY \
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
--network vaulttest --name \
testcontainer docker.mirror.hashicorp.services/circleci/golang:1.16.5-buster \
@ -1215,8 +1247,10 @@ jobs:
docker exec -w /go/src/github.com/hashicorp/vault/ \
-e CIRCLECI -e VAULT_CI_GO_TEST_RACE \
-e GOCACHE=/tmp/gocache \
-e GO_TAGS \
-e GOPROXY="off" \
-e VAULT_LICENSE_CI \
-e GOARCH=amd64 \
testcontainer \
gotestsum --format=short-verbose \
--junitfile test-results/go-test/results.xml \
@ -1240,6 +1274,8 @@ jobs:
-race \
${package_names}
fi
environment:
GOPRIVATE: github.com/hashicorp/*
name: Run Go tests
no_output_timeout: 60m
- store_artifacts:
@ -1605,6 +1641,12 @@ jobs:
name: Check branch name
working_directory: ~/
- checkout
- add_ssh_keys:
fingerprints:
- 0e:03:77:f4:e2:c3:56:c2:53:6a:03:e1:31:91:2f:06
- run:
command: |
git config --global url."git@github.com:".insteadOf https://github.com/
- run:
command: |
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
@ -1683,9 +1725,17 @@ jobs:
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
fi
# Start a docker testcontainer to run the tests in
docker run -d -e TEST_DOCKER_NETWORK_ID \
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
docker run -d \
-e TEST_DOCKER_NETWORK_ID \
-e GOPRIVATE \
-e DOCKER_CERT_PATH \
-e DOCKER_HOST \
-e DOCKER_MACHINE_NAME \
-e DOCKER_TLS_VERIFY \
-e NO_PROXY \
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
--network vaulttest --name \
testcontainer docker.mirror.hashicorp.services/circleci/golang:1.16.5-buster \
@ -1704,8 +1754,10 @@ jobs:
docker exec -w /go/src/github.com/hashicorp/vault/ \
-e CIRCLECI -e VAULT_CI_GO_TEST_RACE \
-e GOCACHE=/tmp/gocache \
-e GO_TAGS \
-e GOPROXY="off" \
-e VAULT_LICENSE_CI \
-e GOARCH=amd64 \
testcontainer \
gotestsum --format=short-verbose \
--junitfile test-results/go-test/results.xml \
@ -1729,6 +1781,8 @@ jobs:
\
${package_names}
fi
environment:
GOPRIVATE: github.com/hashicorp/*
name: Run Go tests
no_output_timeout: 60m
- store_artifacts:
@ -2233,6 +2287,12 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
version: 18.09.3
- add_ssh_keys:
fingerprints:
- 0e:03:77:f4:e2:c3:56:c2:53:6a:03:e1:31:91:2f:06
- run:
command: |
git config --global url."git@github.com:".insteadOf https://github.com/
- run:
command: |
TZ=GMT date '+%Y%m%d' > /tmp/go-cache-key
@ -2312,9 +2372,17 @@ jobs:
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
fi
# Start a docker testcontainer to run the tests in
docker run -d -e TEST_DOCKER_NETWORK_ID \
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
docker run -d \
-e TEST_DOCKER_NETWORK_ID \
-e GOPRIVATE \
-e DOCKER_CERT_PATH \
-e DOCKER_HOST \
-e DOCKER_MACHINE_NAME \
-e DOCKER_TLS_VERIFY \
-e NO_PROXY \
-e VAULT_TEST_LOG_DIR=/tmp/testlogs \
--network vaulttest --name \
testcontainer docker.mirror.hashicorp.services/circleci/golang:1.16.5-buster \
@ -2333,8 +2401,10 @@ jobs:
docker exec -w /go/src/github.com/hashicorp/vault/ \
-e CIRCLECI -e VAULT_CI_GO_TEST_RACE \
-e GOCACHE=/tmp/gocache \
-e GO_TAGS \
-e GOPROXY="off" \
-e VAULT_LICENSE_CI \
-e GOARCH=amd64 \
testcontainer \
gotestsum --format=short-verbose \
--junitfile test-results/go-test/results.xml \
@ -2358,6 +2428,8 @@ jobs:
-race \
${package_names}
fi
environment:
GOPRIVATE: github.com/hashicorp/*
name: Run Go tests
no_output_timeout: 60m
- run:

View File

@ -21,8 +21,9 @@ parameters:
arch:
type: string
# Only supported for use_docker=false, and only other value allowed is 386
default: amd64
default: amd64 # must be 386 or amd64
steps:
- configure-git
- run:
name: Compute test cache key
command: |
@ -34,6 +35,8 @@ steps:
- run:
name: Run Go tests
no_output_timeout: 60m
environment:
GOPRIVATE: 'github.com/hashicorp/*'
command: |
set -x
@ -103,9 +106,17 @@ steps:
TEST_DOCKER_NETWORK_ID=$(docker network create vaulttest)
fi
# Start a docker testcontainer to run the tests in
docker run -d -e TEST_DOCKER_NETWORK_ID \
-e DOCKER_CERT_PATH -e DOCKER_HOST -e DOCKER_MACHINE_NAME -e DOCKER_TLS_VERIFY -e NO_PROXY \
docker run -d \
-e TEST_DOCKER_NETWORK_ID \
-e GOPRIVATE \
-e DOCKER_CERT_PATH \
-e DOCKER_HOST \
-e DOCKER_MACHINE_NAME \
-e DOCKER_TLS_VERIFY \
-e NO_PROXY \
-e VAULT_TEST_LOG_DIR=<< parameters.log_dir >> \
--network vaulttest --name \
testcontainer << parameters.go_image >> \
@ -124,8 +135,10 @@ steps:
docker exec -w /go/src/github.com/hashicorp/vault/ \
-e CIRCLECI -e VAULT_CI_GO_TEST_RACE \
-e GOCACHE=/tmp/gocache \
-e GO_TAGS \
-e GOPROXY="off" \
-e VAULT_LICENSE_CI \
-e GOARCH=<< parameters.arch >> \
testcontainer \
gotestsum --format=short-verbose \
--junitfile test-results/go-test/results.xml \