test: add coveralls coverage to master (#11256)
This commit is contained in:
parent
4db65664fa
commit
9a9f4021dc
|
|
@ -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 >> ]
|
||||
|
|
|
|||
Loading…
Reference in New Issue