Commit b8609252 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'fix/11-sonar_tests_report' into 'master'

fix: sonar test report

Closes #11

See merge request to-be-continuous/golang!10
parents 7cf3f0f2 e0da9314
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -123,20 +123,13 @@ stages:
    cd -
  }

  function install_go_mod_outdated() {
    cd "$(mktemp -d)"
    go mod init go-mod-outdated
    go get github.com/psampaz/go-mod-outdated
    cd -
  }

  function sonar_tests_report() {
    if [[ -n "$SONAR_URL" ]]
    then
      log_info "SonarQube template detected (\$SONAR_URL): generate tests report for SonarQube (\\e[33;1mreports/sonar-tests-report.json\\e[0m)"
      mkdir -p reports
      # shellcheck disable=SC2086
      go $GO_TEST_ARGS -json > reports/sonar-tests-report.json
      go test $GO_TEST_FLAGS -json > reports/sonar-tests-report.json
    fi
  }

@@ -150,6 +143,13 @@ stages:
    fi
  }

  function install_go_mod_outdated() {
    cd "$(mktemp -d)"
    go mod init go-mod-outdated
    go get github.com/psampaz/go-mod-outdated
    cd -
  }

  function install_ca_certs() {
    certs=$1
    if [[ -z "$certs" ]]