Skip to content

Commit

Permalink
Add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Mar 3, 2023
1 parent a71223a commit dd761f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
uses: actions/checkout@v3
- name: build, lint, test
run: make backend && git diff --exit-code
- name: Report coverage
uses: codecov/codecov-action@v2.1.0
with:
files: ./cover.out
flags: unittests
fail_ci_if_error: true

build-test-frontend:
name: Build, lint, test frontend
Expand All @@ -38,3 +44,9 @@ jobs:
uses: actions/checkout@v3
- name: build and test
run: make frontend && git diff --exit-code
- name: Report coverage
uses: codecov/codecov-action@v2.1.0
with:
files: ./web/coverage/cobertura-coverage.xml
flags: uitests
fail_ci_if_error: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
/web/dist
/web/node_modules
/web/yarn-error.log
/web/coverage
/plugin-backend
/coverage.out
/cover.out
tmp.Dockerfile
/web/cypress/videos
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ BASE_IMAGE ?= quay.io/${IMG_USER}/network-observability-console-plugin
IMAGE ?= ${BASE_IMAGE}:${TAG}

GOLANGCI_LINT_VERSION = v1.50.1
COVERPROFILE = coverage.out
NPM_INSTALL ?= install

CMDLINE_ARGS ?= --loglevel trace --loki-tenant-id netobserv --frontend-config config/sample-frontend-config.yaml --auth-check none
Expand Down Expand Up @@ -69,7 +68,7 @@ i18n:
.PHONY: test-backend
test-backend:
@echo "### Testing backend"
go test ./... -coverprofile ${COVERPROFILE}
go test ./... -coverpkg=./... -coverprofile cover.out

.PHONY: test-frontend
test-frontend:
Expand Down
2 changes: 2 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
"save-svg-as-png": "^1.4.17"
},
"jest": {
"collectCoverage": true,
"coverageReporters": ["cobertura"],
"testURL": "http://localhost/",
"maxWorkers": 1,
"globals": {
Expand Down

0 comments on commit dd761f6

Please sign in to comment.