File tree Expand file tree Collapse file tree 3 files changed +9
-19
lines changed
Expand file tree Collapse file tree 3 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,13 @@ jobs:
3333 restore-keys : go-
3434
3535 - name : Run Tests
36- env :
37- XUNIT_OUTFILE : test-reports/unit.xml
3836 run : |
39- make test
37+ make test-ci
4038
4139 - name : Publish Results
4240 uses : EnricoMi/publish-unit-test-result-action@v2
4341 if : always()
4442 with :
4543 check_name : Unit Tests Results
4644 files : |
47- test-reports/unit .xml
45+ utests-report .xml
Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ GOLANGCI_LINT:
4545
4646# ######### BUILD ##########
4747prereq ::
48- $(GOCMD ) install github.com/jstemmer/go-junit-report@v1.0.0
48+ $(GOCMD ) install github.com/jstemmer/go-junit-report/v2@latest
4949 GOBIN=
${TOOLS_DIR} $(GOCMD ) install go.uber.org/mock/
[email protected] 50+ mockgen --version
5051
5152build ::
5253 $(GOCMD ) env GOOS GOARCH
@@ -79,15 +80,8 @@ test-prereq: generate-mock
7980 mkdir -p target/reports
8081
8182test : PACKAGES=./...
82- test : TEST_ARGS=-short
83- test : test-prereq do-run-tests
83+ test : test-prereq
84+ go test ./...
85+ test-ci : test-prereq
86+ go test -v 2>&1 ./... | go-junit-report -set-exit-code -iocopy -out utests-report.xml
8487
85- itest : PACKAGES=./test/...
86- itest : TAGS=-tags=itest
87- itest : TEST_ARGS=-count=1 -p=1
88- itest :: test-prereq do-run-tests
89-
90- do-run-tests ::
91- $(SCRIPTS_DIR ) /gotest.sh $$(go list $(TAGS ) $(PACKAGES ) | grep -v "^.*/mocks$$" ) -timeout 30m -coverpkg=github.com/jfrog/jfrog-cli-application/... -coverprofile=$(TARGET_DIR ) /reports/coverage.out $(TEST_ARGS ) $(TAGS )
92-
93- .PHONY : $(MAKECMDGOALS )
Original file line number Diff line number Diff line change 6969
7070echoDebug " Running ${GOCMD} test ${modargs[*]} "
7171# Disable log coloring (ANSI codes are invalid xml characters)
72- (2>&1 DEV_DISABLE_LOG_COLORS=true ${GOCMD} test ${modargs[*]} || echo " $? " > " ${exitCodeFile} " ) | tee " ${OUTFILE} "
72+ (2>&1 DEV_DISABLE_LOG_COLORS=true ${GOCMD} test " ${modargs[*]} " || echo " $? " > " ${exitCodeFile} " ) | tee " ${OUTFILE} "
7373exitCode=" $( cat " ${exitCodeFile} " ) "
7474echoDebug " Tests Exit Code: $exitCode "
7575
@@ -79,8 +79,6 @@ if [[ -n "${JSON_OUTFILE}" ]]; then
7979fi
8080
8181if [[ -n " ${XUNIT_OUTFILE} " ]]; then
82- echoDebug " Ensuring jstemmer/go-junit-report is installed"
83- ${GOCMD} install github.com/jstemmer/
[email protected] 8482 echoDebug " Generating xUnit test report at: ${XUNIT_OUTFILE} "
8583 go-junit-report < " ${OUTFILE} " > " ${XUNIT_OUTFILE} "
8684fi
You can’t perform that action at this time.
0 commit comments