From fd5241fb3e76f964f02e89240b103b827768fcb0 Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 15 Mar 2019 10:02:26 -0700 Subject: [PATCH 1/2] remove cns restserver from ci --- .pipelines/pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pipelines/pipeline.yml b/.pipelines/pipeline.yml index 0ba7f64175..949192a4fe 100644 --- a/.pipelines/pipeline.yml +++ b/.pipelines/pipeline.yml @@ -50,7 +50,6 @@ jobs: displayName: 'Install Go dependencies' - script: | - # sudo -E env "PATH=$PATH" go test -v ./cns/restserver/ -coverprofile coverage-restserver.out set -o pipefail set -e sudo -E env "PATH=$PATH" make test-all 2>&1 | tee >(go-junit-report > report.xml) From d21d189d44d526cd6de7773dd8d2c64e3d01d22f Mon Sep 17 00:00:00 2001 From: Mathew Merrick Date: Fri, 15 Mar 2019 14:36:30 -0700 Subject: [PATCH 2/2] publish coverage report to pipelines --- .pipelines/pipeline.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.pipelines/pipeline.yml b/.pipelines/pipeline.yml index 949192a4fe..d2c0c766b7 100644 --- a/.pipelines/pipeline.yml +++ b/.pipelines/pipeline.yml @@ -46,6 +46,9 @@ jobs: go get github.com/docker/libnetwork/driverapi go get github.com/gorilla/mux go get github.com/jstemmer/go-junit-report + go get github.com/axw/gocov/gocov + go get github.com/AlekSi/gocov-xml + go get -u gopkg.in/matm/v1/gocov-html workingDirectory: '$(modulePath)' displayName: 'Install Go dependencies' @@ -54,6 +57,10 @@ jobs: set -e sudo -E env "PATH=$PATH" make test-all 2>&1 | tee >(go-junit-report > report.xml) bash <(curl -s https://codecov.io/bash) + gocov convert coverage.out > coverage.json + gocov-xml < coverage.json > coverage.xml + mkdir coverage + gocov-html < coverage.json > coverage/index.html workingDirectory: '$(modulePath)' displayName: 'RunTest' @@ -63,6 +70,13 @@ jobs: testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml condition: always() + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml + reportDirectory: $(System.DefaultWorkingDirectory)/**/coverage + condition: always() + - script: | export GOOS=linux sudo -E env "PATH=$PATH" make all-binaries