From 8fdc07d5a517cd12d1ceb335824385f795f89f45 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Thu, 9 Jun 2022 13:02:55 -0400 Subject: [PATCH] test: Use tparse to simplify test failure analysis (#2149) The tparse library adds a nice summary of the test output, which should hopefully make it easier to find errors in the tests --- .circleci/config.yml | 23 ++++++----------------- .circleci/config/jobs/build.yml | 3 ++- Makefile | 15 ++++++++------- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5dc4ac8222..d962d1ddf9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -128,6 +128,10 @@ jobs: echo "$ go version" go version name: Install go + - run: + command: | + make tools + name: Install tools - run: command: | which pg_isready || sudo apt-get update && sudo apt-get install -y postgresql-client @@ -349,22 +353,12 @@ workflows: # resource_class: medium # working_directory: ~/boundary # jobs: -# algolia-index: -# docker: -# - image: docker.mirror.hashicorp.services/node:12 -# steps: -# - checkout -# - run: -# command: |- -# cd website/ -# npm install -# node scripts/index_search_content.js -# name: Push content to Algolia Index # build: # executor: go-machine # steps: # - checkout # - install-go +# - install-tools # - run: # command: | # which pg_isready || sudo apt-get update && sudo apt-get install -y postgresql-client @@ -455,11 +449,6 @@ workflows: # - 11-alpine # - 12-alpine # - 13-alpine -# - algolia-index: -# filters: -# branches: -# only: -# - stable-website # - make-gen-deltas # trigger-merge-to-ent: # jobs: @@ -467,4 +456,4 @@ workflows: # filters: # branches: # only: -# - main +# - main \ No newline at end of file diff --git a/.circleci/config/jobs/build.yml b/.circleci/config/jobs/build.yml index ad75eb5ba6..331c9440c4 100644 --- a/.circleci/config/jobs/build.yml +++ b/.circleci/config/jobs/build.yml @@ -2,6 +2,7 @@ executor: go-machine steps: - checkout - install-go +- install-tools - run: name: "Initialize Test Database" command: | @@ -21,4 +22,4 @@ steps: - slack/status: fail_only: true only_for_branches: master - webhook: webhook \ No newline at end of file + webhook: webhook diff --git a/Makefile b/Makefile index 0c2502934f..2b1a239aa7 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ cli: tools: go generate -tags tools tools/tools.go go install github.com/bufbuild/buf/cmd/buf@v1.3.1 + go install github.com/mfridman/tparse@v0.10.3 .PHONY: cleangen cleangen: @@ -141,12 +142,12 @@ protobuild: @protoc-go-inject-tag -input=./internal/auth/store/account.pb.go @protoc-go-inject-tag -input=./internal/auth/password/store/password.pb.go @protoc-go-inject-tag -input=./internal/auth/password/store/argon2.pb.go - @protoc-go-inject-tag -input=./internal/kms/store/root_key.pb.go - @protoc-go-inject-tag -input=./internal/kms/store/database_key.pb.go - @protoc-go-inject-tag -input=./internal/kms/store/oplog_key.pb.go - @protoc-go-inject-tag -input=./internal/kms/store/token_key.pb.go + @protoc-go-inject-tag -input=./internal/kms/store/root_key.pb.go + @protoc-go-inject-tag -input=./internal/kms/store/database_key.pb.go + @protoc-go-inject-tag -input=./internal/kms/store/oplog_key.pb.go + @protoc-go-inject-tag -input=./internal/kms/store/token_key.pb.go @protoc-go-inject-tag -input=./internal/kms/store/session_key.pb.go - @protoc-go-inject-tag -input=./internal/kms/store/oidc_key.pb.go + @protoc-go-inject-tag -input=./internal/kms/store/oidc_key.pb.go @protoc-go-inject-tag -input=./internal/target/store/target.pb.go @protoc-go-inject-tag -input=./internal/target/targettest/store/target.pb.go @protoc-go-inject-tag -input=./internal/target/tcp/store/target.pb.go @@ -229,7 +230,7 @@ generate-database-dumps: test-ci: export CI_BUILD=1 test-ci: CGO_ENABLED=$(CGO_ENABLED) BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/build.sh'" - ~/.go/bin/go test ./... -v $(TESTARGS) -timeout 120m + ~/.go/bin/go test ./... -v $(TESTARGS) -json -cover -timeout 120m | tparse .PHONY: test-sql test-sql: @@ -237,7 +238,7 @@ test-sql: .PHONY: test test: - go test ./... -timeout 30m + go test ./... -timeout 30m -json -cover | tparse -follow .PHONY: test-sdk test-sdk: