From 7610ad5de8d051ca9e95650adaeccc61f7a045a0 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Fri, 17 Jun 2022 12:37:53 -0600 Subject: [PATCH] test: add coveralls coverage to master (#11256) --- .circleci/config.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 25cf18043445d..d52cd8fb871b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,6 @@ commands: key: windows-go-<< parameters.cache_version >>-{{ checksum "go.sum" }} - run: 'sh ./scripts/installgo_windows.sh' - run: choco install mingw - - run: mkdir -p test-results - run: ./scripts/install_gotestsum.sh << parameters.os >> << parameters.gotestsum >> - unless: condition: @@ -86,9 +85,23 @@ commands: steps: - run: echo 'export RACE="-race"' >> $BASH_ENV - run: | - GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> --junitfile test-results/gotestsum-report.xml -- ${RACE} -short ./... - - store_test_results: - path: test-results + GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./... + - when: + condition: + and: + - equal: [ "master", << pipeline.git.branch >> ] + - equal: [ "linux", << parameters.os >> ] + - equal: [ "amd64", << parameters.arch >> ] + steps: + - run: + name: "Installing goveralls" + command: go install github.com/mattn/goveralls@latest + - run: + name: "Remove plugins/parsers/influx/machine.go from coverage" + command: sed -i '/github.com\/influxdata\/telegraf\/plugins\/parsers\/influx\/machine.go/d' coverage.out + - run: + name: "Create report" + command: /go/bin/goveralls -coverprofile=coverage.out -service=circle-ci -repotoken=${COVERALLS_TOKEN} - when: condition: equal: [ linux, << parameters.os >> ]