mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 08:55:27 +03:00
🌱 Track code coverage
Track code coverage https://github.com/ossf/scorecard/issues/986 Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
parent
9973bdeb60
commit
2dcdbcd32b
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@ -39,6 +39,11 @@ jobs:
|
||||
run: |
|
||||
go env -w GOFLAGS=-mod=mod
|
||||
make -j 5 all
|
||||
- name: Upload codecoverage
|
||||
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # 2.1.0
|
||||
with:
|
||||
files: ./unit-coverage.out
|
||||
verbose: true
|
||||
license-check:
|
||||
name: license boilerplate check
|
||||
runs-on: ubuntu-latest
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,6 +26,8 @@ results.json
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE.
|
||||
*.coverprofile*
|
||||
unit-coverage.out
|
||||
e2e-coverage.out
|
||||
|
||||
|
||||
# IDE directories.
|
||||
|
7
Makefile
7
Makefile
@ -267,12 +267,13 @@ test: $(test-targets)
|
||||
|
||||
unit-test: ## Runs unit test without e2e
|
||||
# Run unit tests, ignoring e2e tests
|
||||
go test -race -covermode atomic `go list ./... | grep -v e2e`
|
||||
# run the go tests and gen the file coverage-all used to do the integration with codecov
|
||||
go test -race -covermode=atomic -coverprofile=unit-coverage.out `go list ./... | grep -v e2e`
|
||||
|
||||
e2e: ## Runs e2e tests. Requires GITHUB_AUTH_TOKEN env var to be set to GitHub personal access token
|
||||
e2e: build-scorecard check-env | $(GINKGO)
|
||||
# Run e2e tests. GITHUB_AUTH_TOKEN with personal access token must be exported to run this
|
||||
$(GINKGO) --race --skip="E2E TEST:executable" -p -v -cover ./...
|
||||
$(GINKGO) --race --skip="E2E TEST:executable" -p -v -cover -coverprofile=filename ./...
|
||||
|
||||
$(GINKGO): install
|
||||
|
||||
@ -281,7 +282,7 @@ ci-e2e: build-scorecard check-env | $(GINKGO)
|
||||
# Run CI e2e tests. GITHUB_AUTH_TOKEN with personal access token must be exported to run this
|
||||
$(call ndef, GITHUB_AUTH_TOKEN)
|
||||
@echo Ignoring these test for ci-e2e $(IGNORED_CI_TEST)
|
||||
$(GINKGO) -p -v -cover --skip=$(IGNORED_CI_TEST) ./e2e/...
|
||||
$(GINKGO) -p -v -cover --skip=$(IGNORED_CI_TEST) -coverprofile=e2e-coverage.out ./e2e/...
|
||||
|
||||
|
||||
check-env:
|
||||
|
Loading…
Reference in New Issue
Block a user