test: add coveralls coverage to master (#11256)

This commit is contained in:
Joshua Powers 2022-06-17 12:37:53 -06:00 committed by GitHub
parent 4db65664fa
commit 9a9f4021dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 4 deletions

View File

@ -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 >> ]