Skip to content

Commit bec40ed

Browse files
committed
Application Key flag is optional now
1 parent 918282b commit bec40ed

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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

Makefile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ GOLANGCI_LINT:
4545

4646
########## BUILD ##########
4747
prereq::
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

5152
build::
5253
$(GOCMD) env GOOS GOARCH
@@ -79,15 +80,8 @@ test-prereq: generate-mock
7980
mkdir -p target/reports
8081

8182
test: 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)

scripts/gotest.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fi
6969

7070
echoDebug "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}"
7373
exitCode="$(cat "${exitCodeFile}")"
7474
echoDebug "Tests Exit Code: $exitCode"
7575

@@ -79,8 +79,6 @@ if [[ -n "${JSON_OUTFILE}" ]]; then
7979
fi
8080

8181
if [[ -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}"
8684
fi

0 commit comments

Comments
 (0)