Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.

Commit cf607e5

Browse files
committed
Adding junit reporting.
1 parent c1a3eb7 commit cf607e5

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

.github/workflows/acceptance.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
run: make apply-schema-ci
6363
- name: Test
6464
run: make test
65+
- name: Publish Test Report
66+
uses: mikepenz/action-junit-report@v2
67+
if: always() # always run even if the previous step fails
68+
with:
69+
report_paths: '/rest-api.xml'
70+
check_name: 'Go Test Summary'
6571

6672
pg-test:
6773
needs:

.github/workflows/incoming.yml

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ jobs:
4646
run: make apply-schema-ci
4747
- name: Test
4848
run: make test
49+
- name: Publish Test Report
50+
uses: mikepenz/action-junit-report@v2
51+
if: always() # always run even if the previous step fails
52+
with:
53+
report_paths: '/rest-api.xml'
54+
check_name: 'Go Test Summary'
4955
pg-test:
5056
name: PostgreSQL Test
5157
runs-on: ubuntu-latest

.github/workflows/main.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
run: make apply-schema-ci
3939
- name: Test
4040
run: make test
41+
- name: Publish Test Report
42+
uses: mikepenz/action-junit-report@v2
43+
if: always() # always run even if the previous step fails
44+
with:
45+
report_paths: '/rest-api.xml'
46+
check_name: 'Go Test Summary'
4147
pg-test:
4248
timeout-minutes: 10
4349
name: PostgreSQL Test

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ test: $(GO) dependencies $(ALL_GO_FILES) $(GOTESTSUM)
7575
ifndef CI
7676
$(GO) run $(MONETR_CLI_PACKAGE) database migrate -d $(POSTGRES_DB) -U $(POSTGRES_USER) -H $(POSTGRES_HOST)
7777
endif
78-
$(GOTESTSUM) --junitfile $(PWD)/rest-api.xml -- -race -v -coverprofile=$(COVERAGE_TXT) -covermode=atomic $(GO_SRC_DIR)/...
78+
$(GOTESTSUM) --junitfile $(PWD)/rest-api.xml --format testname -- -race -v \
79+
-coverprofile=$(COVERAGE_TXT) \
80+
-covermode=atomic $(GO_SRC_DIR)/...
7981
$(GO) tool cover -func=$(COVERAGE_TXT)
8082

8183
clean:

pkg/controller/authentication_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package controller_test
22

33
import (
4+
"net/http"
5+
"testing"
6+
47
"github.com/brianvoe/gofakeit/v6"
58
"github.com/jarcoal/httpmock"
69
"github.com/monetr/rest-api/pkg/internal/mock_stripe"
710
"github.com/monetr/rest-api/pkg/swag"
8-
"net/http"
9-
"testing"
1011
)
1112

1213
func TestLogin(t *testing.T) {

0 commit comments

Comments
 (0)