-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QA-184] unit test coverage report added (#21)
* added octocov configuration * added GitHub workflow * increased coverage acceptable score to 89%
- Loading branch information
1 parent
58f58e4
commit 58e4c29
Showing
2 changed files
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: octocov | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Granting private modules access | ||
run: | | ||
git config --global url."https://${{ secrets.engbot_token }}:[email protected]/watchtowerai".insteadOf "https://github.com/watchtowerai" | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
- name: Run tests with coverage report output | ||
# can skip packages with external dependencies (e.g. entity with live DB) with a command like | ||
# ```go test $(go list ./... | grep -v entity) -coverprofile=coverage.out``` | ||
run: go test $(go list ./... | grep -v /internal/services/entity | grep -v /internal/entities | grep -v /internal/handler | grep -v /internal/services/entity) -coverprofile=coverage.out | ||
env: | ||
GO_ENV: "test" | ||
GOPRIVATE: "github.com/watchtowerai" | ||
- uses: k1LoW/octocov-action@v0 |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
coverage: | ||
acceptable: current >= 89% | ||
codeToTestRatio: | ||
code: | ||
- '**/*.go' | ||
- '!**/*_test.go' | ||
test: | ||
- '**/*_test.go' | ||
diff: | ||
datastores: | ||
- artifact://${GITHUB_REPOSITORY} | ||
push: | ||
if: is_default_branch | ||
comment: | ||
if: is_pull_request | ||
summary: | ||
if: true | ||
report: | ||
if: is_default_branch | ||
datastores: | ||
- artifact://${GITHUB_REPOSITORY} |