Browse Source

Add CI test-integrations job for connect Vault CA provider (#6949)

* vault-ca-provider: add make target and CI test-integration job for /agent/connect/ca/ Vault Provider tests

* load env vars in the vault-ca-provider ci job

* add checkout task, see if we need to attach workspace or not

* ci: remove vault dependency from go-test job to ensure we only run the vault-provider tests in their job

* ci: fix from RB and Alvin code review, add mod cache after checkout

* ci: add CI context to make target and store test results

* ci: fix whitespace

* ci: create test results directory before we try to write to it
pull/6964/head
Kit Patella 5 years ago committed by GitHub
parent
commit
0d61369fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      .circleci/config.yml
  2. 10
      GNUmakefile

31
.circleci/config.yml

@ -107,10 +107,6 @@ jobs:
- run: mkdir -p $TEST_RESULTS_DIR
- run: sudo apt-get update && sudo apt-get install -y rsyslog
- run: sudo service rsyslog start
- run: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/${VAULT_BINARY_VERSION}/vault_${VAULT_BINARY_VERSION}_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
- run: |
PACKAGE_NAMES=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname)
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- -tags=$GOTAGS -p 2 -cover -coverprofile=cov_$CIRCLE_NODE_INDEX.part $PACKAGE_NAMES
@ -560,6 +556,30 @@ jobs:
ENVOY_VERSIONS: "1.11.1"
steps: *ENVOY_INTEGRATION_TEST_STEPS
# run tests on vault ca provider integration tests
vault-ca-provider:
docker:
- image: *GOLANG_IMAGE
environment:
<<: *ENVIRONMENT
steps:
# Install vault
- run: |
wget -q -O /tmp/vault.zip https://releases.hashicorp.com/vault/${VAULT_BINARY_VERSION}/vault_${VAULT_BINARY_VERSION}_linux_amd64.zip
sudo unzip -d /usr/local/bin /tmp/vault.zip
rm -rf /tmp/vault*
# Create directory to store test results
- run: mkdir -p $TEST_RESULTS_DIR
# Gather deps to run go tests
- checkout
- restore_cache:
keys:
- consul-modcache-v1-{{ checksum "go.mod" }}
# Run go tests
- run: make test-vault-ca-provider
- store_test_results:
path: /tmp/test-results
workflows:
version: 2
go-tests:
@ -631,6 +651,9 @@ workflows:
- envoy-integration-test-1.11.1:
requires:
- dev-build
- vault-ca-provider:
requires:
- dev-build
website:
jobs:
- build-website

10
GNUmakefile

@ -373,6 +373,16 @@ ui-docker: ui-build-image
test-envoy-integ: $(ENVOY_INTEG_DEPS)
@$(SHELL) $(CURDIR)/test/integration/connect/envoy/run-tests.sh
test-vault-ca-provider:
ifeq ("$(CIRCLECI)","true")
# Run in CI
gotestsum --format=short-verbose --junitfile "$(TEST_RESULTS_DIR)/gotestsum-report.xml" -- $(CURDIR)/agent/connect/ca/* -run TestVaultCAProvider
else
# Run locally
@echo "Running /agent/connect/ca TestVaultCAProvider tests in verbose mode"
@go test $(CURDIR)/agent/connect/ca/* -run TestVaultCAProvider -v
endif
proto-delete:
@echo "Removing $(PROTOGOFILES)"
-@rm $(PROTOGOFILES)

Loading…
Cancel
Save