Skip to content

Commit

Permalink
test: add coveralls coverage to master (#11256)
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj authored and MyaLongmire committed Jul 6, 2022
1 parent 6f34c5d commit 7610ad5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,30 @@ 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:
equal: [ "386", << parameters.arch >> ]
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 >> ]
Expand Down

0 comments on commit 7610ad5

Please sign in to comment.