Adds junit and coverage to jenkinsfile
This commit is contained in:
parent
403295b2b4
commit
ff0a8b97be
28
Jenkinsfile
vendored
28
Jenkinsfile
vendored
@ -30,18 +30,32 @@ pipeline {
|
||||
}
|
||||
}
|
||||
stage('test') {
|
||||
environment {
|
||||
PATH="${env.PATH}:${env.GOPATH}/bin"
|
||||
}
|
||||
steps {
|
||||
echo 'Running test'
|
||||
sh 'go test -v ./...'
|
||||
|
||||
sh 'go test -v -coverprofile=coverage.out -covermode count > tests.out ./...'
|
||||
|
||||
sh "go get github.com/tebeka/go2xunit"
|
||||
sh "go2xunit < tests.out -output tests.xml"
|
||||
junit "tests.xml"
|
||||
|
||||
// convert coverage
|
||||
sh "go get github.com/t-yuki/gocover-cobertura"
|
||||
sh "gocover-cobertura < coverage.out > coverage.xml"
|
||||
cobertura coberturaReportFile: 'coverage.xml'
|
||||
|
||||
}
|
||||
}
|
||||
stage('lint') {
|
||||
environment {
|
||||
PATH="${env.PATH}:${env.GOPATH}/bin"
|
||||
}
|
||||
steps {
|
||||
sh 'golint -set_exit_status ./...'
|
||||
}
|
||||
environment {
|
||||
PATH="${env.PATH}:${env.GOPATH}/bin"
|
||||
}
|
||||
steps {
|
||||
sh 'golint -set_exit_status ./...'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user