-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload code coverage of unit tests to codecov (#6321)
Code coverage is not being tracked for unittests, Tracking code coverage is important as it give insights on where to test and what to test This PR updates unit tests workflow to create coverage reports and upload the same to codecov using codecov github action Fixes #6289 Signed-off-by: Akshit Grover <[email protected]>
- Loading branch information
1 parent
c316ba5
commit 38bfd10
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
- '**/*.md' | ||
branches: | ||
- main | ||
permissions: | ||
permissions: | ||
contents: read | ||
jobs: | ||
go_unit_tests: | ||
|
@@ -23,7 +23,12 @@ jobs: | |
run: | | ||
go get gotest.tools/[email protected] | ||
# TODO: validate bin/protoc-go.sh does not dirty the repo | ||
gotestsum -- -cover -race -v -mod=readonly ./... | ||
gotestsum -- -cover -coverprofile=coverage.out -race -v -mod=readonly ./... | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@29386c70ef20e286228c72b668a06fd0e8399192 | ||
with: | ||
files: ./coverage.out | ||
flags: unittests,golang | ||
js_unit_tests: | ||
name: JS unit tests | ||
timeout-minutes: 30 | ||
|
@@ -40,4 +45,9 @@ jobs: | |
export PATH="$HOME/.yarn/bin:$PATH" | ||
export NODE_ENV=test | ||
bin/web --frozen-lockfile | ||
bin/web test --reporters="jest-dot-reporter" --reporters="./gh_ann_reporter.js" | ||
bin/web test --reporters="jest-dot-reporter" --reporters="./gh_ann_reporter.js" --coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@29386c70ef20e286228c72b668a06fd0e8399192 | ||
with: | ||
directory: ./web/app/coverage | ||
flags: unittests,javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ vendor | |
**/charts/**/charts | ||
package-lock.json | ||
.vscode | ||
**/coverage* |