Skip to content

Commit

Permalink
add go coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tharindu1st committed Dec 16, 2022
1 parent d1abc63 commit 3899971
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions build-apk.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set -e
#This is a sample script to build APK. When you build project please run this script in project root level.
#All relative paths etc designed from root directory. Users can customize this as per demand. Ex: If you wish to
#build and run runtime domain service then can build it alone and do deployment.
Expand Down
8 changes: 6 additions & 2 deletions common-gradle-scripts/go.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ tasks.register('go_vet', Exec) {
tasks.register('go_test', Exec) {
group 'go'
description 'Automates testing the packages named by the import paths.'
commandLine 'go', 'test'
if (project.hasProperty('file')) {
commandLine 'go', 'test','-race','-coverprofile=coverage.out','-covermode=atomic', file
} else {
throw new StopExecutionException('Missing "file" property')
}
}

tasks.register('go_tidy', Exec) {
group 'go'
description 'Running go mod tidy.'
Expand All @@ -53,6 +56,7 @@ tasks.register('go_build') {
description 'Compiles the packages named by the import paths, along with their dependencies. AMD64 Archtecture'
dependsOn go_mac_os_build
dependsOn go_linux_build
finalizedBy go_test
}
tasks.register('go_mac_os_build', Exec) {
group 'go'
Expand Down

0 comments on commit 3899971

Please sign in to comment.