diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ed78e2d4..e41f39837 100644 --- a/.circleci/config.yml +++ b/.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 diff --git a/GNUmakefile b/GNUmakefile index f50a09994..43fdf79f9 100644 --- a/GNUmakefile +++ b/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)