Skip to content

Commit

Permalink
[chore] fix testbed tests (#17857)
Browse files Browse the repository at this point in the history
Missed in #17849
  • Loading branch information
MovieStoreGuy authored Jan 19, 2023
1 parent 5f03b4e commit 2a31783
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(TOOLS_PKG_NAMES)))
install-tools: $(TOOLS_BIN_NAMES)

$(TOOLS_BIN_DIR):
mkdir -p $(PWD)/bin
mkdir -p $@

$(TOOLS_BIN_NAMES): $(TOOLS_BIN_DIR) $(TOOLS_MOD_DIR)/go.mod
cd $(TOOLS_MOD_DIR) && $(GOCMD) build -o $@ -trimpath $(filter %/$(notdir $@),$(TOOLS_PKG_NAMES))
Expand All @@ -55,6 +55,7 @@ GOIMPORTS := $(TOOLS_BIN_DIR)/goimports
PORTO := $(TOOLS_BIN_DIR)/porto
CHECKDOC := $(TOOLS_BIN_DIR)/checkdoc
CROSSLINK := $(TOOLS_BIN_DIR)/crosslink
GOJUNIT := $(TOOLS_BIN_DIR)/go-junit-report

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down
12 changes: 6 additions & 6 deletions testbed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ list-tests:
RUN_TESTBED=1 $(GOTEST) -v ./tests --test.list '.*' | grep "^Test"

.PHONY: run-tests
run-tests:
./runtests.sh
run-tests: $(GOJUNIT)
GOJUNIT=$(GOJUNIT) ./runtests.sh

.PHONY: list-loadtest-tests
list-loadtest-tests:
Expand All @@ -25,13 +25,13 @@ list-correctness-metrics-tests:
RUN_TESTBED=1 $(GOTEST) -v ./correctnesstests/metrics --test.list '.*' | grep "^Test"

.PHONY: run-correctness-metrics-tests
run-correctness-metrics-tests:
TESTS_DIR=correctnesstests/metrics ./runtests.sh
run-correctness-metrics-tests: $(GOJUNIT)
TESTS_DIR=correctnesstests/metrics GOJUNIT=$(GOJUNIT) ./runtests.sh

.PHONY: list-correctness-traces-tests
list-correctness-traces-tests:
RUN_TESTBED=1 $(GOTEST) -v ./correctnesstests/traces --test.list '.*' | grep "^Test"

.PHONY: run-correctness-traces-tests
run-correctness-traces-tests:
TESTS_DIR=correctnesstests/traces ./runtests.sh
run-correctness-traces-tests: $(GOJUNIT)
TESTS_DIR=correctnesstests/traces GOJUNIT=$(GOJUNIT) ./runtests.sh
4 changes: 3 additions & 1 deletion testbed/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

GOJUNITREPORTCMD=${GOJUNIT:-go-junit-report}

TESTS_DIR=${TESTS_DIR:-tests}

cd ${TESTS_DIR}
Expand All @@ -18,7 +20,7 @@ RUN_TESTBED=1 go test -v ${TEST_ARGS} 2>&1 | tee -a results/testoutput.log ./for

testStatus=${PIPESTATUS[0]}

go-junit-report < results/testoutput.log > results/junit/results.xml
${GOJUNITREPORTCMD} < results/testoutput.log > results/junit/results.xml

bash -c "cat results/TESTRESULTS.md | ${TEST_COLORIZE}"

Expand Down

0 comments on commit 2a31783

Please sign in to comment.