Skip to content

Commit

Permalink
Fix goveralls coverage reporting (#3197)
Browse files Browse the repository at this point in the history
* Add make target to visualize coverage locally

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Remove unused goveralls GitHub workflow

The goveralls integration is being revived here:

kubevirt/project-infra#3350

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

* Update goveralls Make target

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>

---------

Signed-off-by: Edu Gómez Escandell <egomez@redhat.com>
  • Loading branch information
EduardGomezEscandell committed May 6, 2024
1 parent 6f93302 commit e0a7544
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/coverall.yml

This file was deleted.

8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
vet \
format \
goveralls \
coverage \
release-description \
bazel-generate bazel-build bazel-build-images bazel-push-images \
fossa \
Expand Down Expand Up @@ -102,7 +103,10 @@ manifests:
${DO_BAZ} "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} VERBOSITY=${VERBOSITY} PULL_POLICY=${PULL_POLICY} CR_NAME=${CR_NAME} CDI_NAMESPACE=${CDI_NAMESPACE} ./hack/build/build-manifests.sh"

goveralls: test-unit
${DO} "TRAVIS_JOB_ID=${TRAVIS_JOB_ID} TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} TRAVIS_BRANCH=${TRAVIS_BRANCH} ./hack/build/goveralls.sh"
${DO_BAZ} "COVERALLS_TOKEN_FILE=${COVERALLS_TOKEN_FILE} COVERALLS_TOKEN=${COVERALLS_TOKEN} CI_NAME=prow CI_BRANCH=${PULL_BASE_REF} CI_PR_NUMBER=${PULL_NUMBER} GIT_ID=${PULL_PULL_SHA} PROW_JOB_ID=${PROW_JOB_ID} ./hack/build/goveralls.sh"

coverage: test-unit
./hack/build/coverage.sh

release-description:
./hack/build/release-description.sh ${RELREF} ${PREREF}
Expand Down Expand Up @@ -213,6 +217,8 @@ help:
@echo " : Update vendored Go code in vendor/ subdirectory."
@echo " goveralls "
@echo " : run code coverage tracking system."
@echo " coverage"
@echo " : run code coverage report locally."
@echo " manifests "
@echo " : generate a cdi-controller and operator manifests in '_out/manifests/'. Accepts [make variables]\(#make-variables\) DOCKER_TAG, DOCKER_PREFIX, VERBOSITY, PULL_POLICY, CSV_VERSION, QUAY_REPOSITORY, QUAY_NAMESPACE"
@echo " openshift-ci-image-push "
Expand Down
9 changes: 9 additions & 0 deletions hack/build/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -eu

COVER_DIR="$(mktemp -d)"
go tool cover -o "${COVER_DIR}/index.html" -html ".coverprofile"

PORT="8000"
python3 -m http.server ${PORT} --directory ${COVER_DIR}

0 comments on commit e0a7544

Please sign in to comment.