Skip to content

Commit

Permalink
backport of commit 492b422
Browse files Browse the repository at this point in the history
  • Loading branch information
ccapurso committed Mar 29, 2022
1 parent 0fd1e6f commit aad9c12
Show file tree
Hide file tree
Showing 2,983 changed files with 67,233 additions and 146,414 deletions.
295 changes: 83 additions & 212 deletions .circleci/config.yml

Large diffs are not rendered by default.

53 changes: 19 additions & 34 deletions .circleci/config/commands/go_test.yml
Expand Up @@ -14,7 +14,7 @@ parameters:
default: false
go_image:
type: string
default: "docker.mirror.hashicorp.services/cimg/go:1.17.7"
default: "docker.mirror.hashicorp.services/cimg/go:1.16.14"
use_docker:
type: boolean
default: false
Expand All @@ -38,7 +38,7 @@ steps:
environment:
GOPRIVATE: 'github.com/hashicorp/*'
command: |
set -exo pipefail
set -x
EXTRA_TAGS=
case "<< parameters.extra_flags >>" in
Expand All @@ -58,36 +58,21 @@ steps:
USE_DOCKER=1
<</ parameters.use_docker >>
# Check all directories with a go.mod file
modules=("." "api" "sdk")
all_package_names=""
for dir in "${modules[@]}"
do
pushd "$dir"
# On its own line so that -e will fail the tests if we detect errors here.
go list -test -json ./... > test-list.json
# Split Go tests by prior test times. If use_docker is true, only run
# tests that depend on docker, otherwise only those that don't.
# The appended true condition ensures the command will succeed if no packages are found
if [ $USE_DOCKER == 1 ]; then
package_names=$(< test-list.json jq -r 'select(.Deps != null) |
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
.ForTest | select(. != null)' |
sort -u | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname || true)
else
package_names=$(< test-list.json jq -r 'select(.Deps != null) |
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
.ForTest | select(. != null)' |
sort -u | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname || true)
fi
# Move back into root directory
popd
# Append the test packages into the global list, if any are found
if [ -n "$package_names" ]; then
all_package_names+=" ${package_names}"
fi
done
# Split Go tests by prior test times. If use_docker is true, only run
# tests that depend on docker, otherwise only those that don't.
if [ $USE_DOCKER == 1 ]; then
package_names=$(go list -test -json ./... |
jq -r 'select(.Deps != null) |
select(any(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker"))) |
.ForTest | select(. != null)' |
sort -u | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname)
else
package_names=$(go list -test -json ./... |
jq -r 'select(.Deps != null) |
select(all(.Deps[] ; contains("github.com/hashicorp/vault/helper/testhelpers/docker")|not)) |
.ForTest | select(. != null)' |
sort -u | grep -v vault/integ | circleci tests split --split-by=timings --timings-type=classname)
fi
# After running tests split step, we are now running the following steps
# in multiple different containers, each getting a different subset of
Expand Down Expand Up @@ -163,7 +148,7 @@ steps:
-timeout=60m \
-parallel=20 \
<< parameters.extra_flags >> \
${all_package_names}
${package_names}
else
GOARCH=<< parameters.arch >> \
GOCACHE=<< parameters.cache_dir >> \
Expand All @@ -175,7 +160,7 @@ steps:
-timeout=60m \
-parallel=20 \
<< parameters.extra_flags >> \
${all_package_names}
${package_names}
fi
- when:
Expand Down
14 changes: 0 additions & 14 deletions .circleci/config/commands/setup-semgrep.yml

This file was deleted.

9 changes: 4 additions & 5 deletions .circleci/config/executors/@executors.yml
Expand Up @@ -3,9 +3,8 @@ go-machine:
shell: /usr/bin/env bash -euo pipefail -c
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_VERSION: 1.17.7 # Pin Go to patch version (ex: 1.2.3)
GO_VERSION: 1.16.14 # Pin Go to patch version (ex: 1.2.3)
GOTESTSUM_VERSION: 0.5.2 # Pin gotestsum to patch version (ex: 1.2.3)
GOFUMPT_VERSION: 0.2.1 # Pin gofumpt to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
node:
Expand All @@ -26,23 +25,23 @@ alpine:
docker-env-go-test-remote-docker:
resource_class: medium
docker:
- image: "docker.mirror.hashicorp.services/cimg/go:1.17.7"
- image: "docker.mirror.hashicorp.services/cimg/go:1.16.14"
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
docker-env-go-test:
resource_class: large
docker:
- image: "docker.mirror.hashicorp.services/cimg/go:1.17.7"
- image: "docker.mirror.hashicorp.services/cimg/go:1.16.14"
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_TAGS: ""
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
docker-env-go-test-race:
resource_class: xlarge
docker:
- image: "docker.mirror.hashicorp.services/cimg/go:1.17.7"
- image: "docker.mirror.hashicorp.services/cimg/go:1.16.14"
environment:
CIRCLECI_CLI_VERSION: 0.1.5546 # Pin CircleCI CLI to patch version (ex: 1.2.3)
GO_TAGS: ""
Expand Down
3 changes: 1 addition & 2 deletions .circleci/config/jobs/algolia-index.yml
@@ -1,5 +1,5 @@
docker:
- image: node:14
- image: node:12
steps:
- checkout
- run:
Expand All @@ -10,6 +10,5 @@ steps:
exit 0
fi
cd website/
npm install -g npm@latest
npm install
node scripts/index_search_content.js
16 changes: 0 additions & 16 deletions .circleci/config/jobs/fmt.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .circleci/config/jobs/semgrep.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .circleci/config/workflows/ci.yml
@@ -1,6 +1,5 @@
jobs:
- pre-flight-checks
- fmt
- install-ui-dependencies:
requires:
- pre-flight-checks
Expand Down Expand Up @@ -50,6 +49,3 @@ jobs:
branches:
only:
- stable-website
- semgrep:
requires:
- pre-flight-checks
46 changes: 0 additions & 46 deletions .github/workflows/backport-docs.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/backport.yml

This file was deleted.

0 comments on commit aad9c12

Please sign in to comment.