Skip to content

Commit

Permalink
Unit test coverage (#2004)
Browse files Browse the repository at this point in the history
Co-authored-by: Willy Kloucek <wkloucek@owncloud.com>
  • Loading branch information
David Christofas and wkloucek authored Aug 19, 2021
1 parent d3a946e commit 7f7fab2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def main(ctx):
# ocisIntegrationTests(6, [1, 4]) - this will only run 1st and 4th parts
# implemented for: ocisIntegrationTests and s3ngIntegrationTests
return [
coverage(),
buildAndPublishDocker(),
buildOnly(),
testIntegration(),
Expand Down Expand Up @@ -229,6 +230,42 @@ def buildAndPublishDocker():
]
}

def coverage():
return {
"kind": "pipeline",
"type": "docker",
"name": "unit-test-coverage",
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger":{
"ref":[
"refs/heads/master",
"refs/pull/**",
],
},
"steps": [
{
"name": "unit-test",
"image": "registry.cern.ch/docker.io/library/golang:1.16",
"commands": [
"make test",
],
},
{
"name": "codacy",
"image": "plugins/codacy:1",
"pull": "always",
"settings": {
"token": {
"from_secret": "codacy_token",
},
},
},
]
}

def buildOnly():
return {
"kind": "pipeline",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ vendor-bin/**/composer.lock
tests/acceptance/output
tmp/

# drone
.drone.yml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build-reva: imports
go build -ldflags ${BUILD_FLAGS} -o ./cmd/reva/reva ./cmd/reva

test: off
go test -race $$(go list ./... | grep -v /tests/integration)
go test -coverprofile coverage.out -race $$(go list ./... | grep -v /tests/integration)

test-integration: build-ci
cd tests/integration && go test -race ./...
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/codacy-coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add Codacy unit test coverage

This PR adds unit test coverage upload to Codacy.

https://github.com/cs3org/reva/pull/1983

0 comments on commit 7f7fab2

Please sign in to comment.