Commit f90ef64b authored by Thomas Boni's avatar Thomas Boni
Browse files

feat(go_unit_test): add direct output in addition to report

parent dbee0f47
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ All notable changes to this job will be documented in this file.

## [1.3.0] - 2022-11-08
* Update docker image version into golang 1.19.3
* Improve job output

## [1.2.0] - 2022-06-13
* Add docker image tag in variable
+4 −2
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@ go_unit_test:
    - go get -u github.com/jstemmer/go-junit-report@v1.0.0 github.com/t-yuki/gocover-cobertura@v0.0.0-20180217150009-aaee18c8195c
    - go install github.com/jstemmer/go-junit-report github.com/t-yuki/gocover-cobertura
    # Execute Unit tests to get both the junit report and the coverage file
    - ${UT_TEST_CMD} -coverprofile=coverage.out ./... 2>&1 | go-junit-report -set-exit-code > report.xml
    - ${UT_TEST_CMD} -coverprofile=coverage.out ./... 2>&1 | tee test_report
    # Convert output to junit
    - cat test_report | go-junit-report -set-exit-code > report.xml
    # Output the coverage to stdout for coverage regex to read
    - go tool cover -func=coverage.out
    # Capture coverage in cobertura format for MR highlighting