From dda3f384b9e07eb485e1636d3dc358791d7d4e8d Mon Sep 17 00:00:00 2001 From: Joe Kimmel Date: Thu, 5 Jan 2023 11:30:40 -0700 Subject: [PATCH] tees test output to a gitignored file Signed-off-by: Joe Kimmel --- DEVELOPMENT.md | 4 ++++ Makefile | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 61bb2c3807..9bdd4c7a19 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -55,11 +55,15 @@ To run unit and integration tests: ```shell make unit ``` +Test output will be streamed to your terminal and also saved to the file +out/unit To run acceptance tests: ```shell make acceptance ``` +Test output will be streamed to your terminal and also saved to the file +out/acceptance Alternately, to run all tests: ```shell diff --git a/Makefile b/Makefile index 2521defbc6..55ae94bfba 100644 --- a/Makefile +++ b/Makefile @@ -105,16 +105,16 @@ unit: GOTESTFLAGS:=$(GOTESTFLAGS) --tags=example endif unit: out @echo "> Running unit/integration tests..." - $(GOCMD) test $(GOTESTFLAGS) -timeout=$(UNIT_TIMEOUT) ./... + $(GOCMD) test $(GOTESTFLAGS) -timeout=$(UNIT_TIMEOUT) ./... | tee out/unit acceptance: out @echo "> Running acceptance tests..." - $(GOCMD) test $(GOTESTFLAGS) -timeout=$(ACCEPTANCE_TIMEOUT) -tags=acceptance ./acceptance + $(GOCMD) test $(GOTESTFLAGS) -timeout=$(ACCEPTANCE_TIMEOUT) -tags=acceptance ./acceptance | tee out/acceptance acceptance-all: export ACCEPTANCE_SUITE_CONFIG:=$(shell $(CAT) .$/acceptance$/testconfig$/all.json) acceptance-all: @echo "> Running acceptance tests..." - $(GOCMD) test $(GOTESTFLAGS) -timeout=$(ACCEPTANCE_TIMEOUT) -tags=acceptance ./acceptance + $(GOCMD) test $(GOTESTFLAGS) -timeout=$(ACCEPTANCE_TIMEOUT) -tags=acceptance ./acceptance | tee out/acceptance clean: @echo "> Cleaning workspace..."