Commit 82804a3a authored by Aurelien's avatar Aurelien
Browse files

job(go_unit_test): New release 1.1.0

parent adba2d99
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [1.1.0] - 2022-04-14
* Rename GitLab report from `cobertura` to `coverage_report`
* Update Docker image to `golang:1.18`
* Update dependencies to be compatible with golang:1.18

## [1.0.0] - 2022-04-14
* Change the default stage into `tests`

+5 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ stages:

go_unit_test:
  stage: tests
  image: golang:1.16.3
  image: golang:1.18
  variables:
    UT_WORK_DIR: $CI_PROJECT_DIR
    UT_TEST_CMD: "go test -v"
@@ -11,7 +11,8 @@ go_unit_test:
    # Switch to working directory
    - cd "$UT_WORK_DIR"
    # Install job dependencies
    - go get -u github.com/jstemmer/go-junit-report@v0.9.1 github.com/t-yuki/gocover-cobertura@v0.0.0-20180217150009-aaee18c8195c
    - 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
    # Output the coverage to stdout for coverage regex to read
@@ -20,6 +21,7 @@ go_unit_test:
    - gocover-cobertura < coverage.out > cobertura.xml
    # Capture coverage in HTML format for humans
    - go tool cover -html=coverage.out -o code-coverage.html

  # Regex below tells gitlab what to capture from job's stdout as a coverage figure
  coverage: '/total:\s+\(statements\)\s+(\d+.\d+%)/'
  artifacts:
@@ -29,4 +31,4 @@ go_unit_test:
    when: always
    reports:
      junit: report.xml
      cobertura: cobertura.xml
      coverage_report: cobertura.xml
+1 −1

File changed.

Contains only whitespace changes.