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" }}
|
key: windows-go-<< parameters.cache_version >>-{{ checksum "go.sum" }}
|
||||||
- run: 'sh ./scripts/installgo_windows.sh'
|
- run: 'sh ./scripts/installgo_windows.sh'
|
||||||
- run: choco install mingw
|
- run: choco install mingw
|
||||||
- run: mkdir -p test-results
|
|
||||||
- run: ./scripts/install_gotestsum.sh << parameters.os >> << parameters.gotestsum >>
|
- run: ./scripts/install_gotestsum.sh << parameters.os >> << parameters.gotestsum >>
|
||||||
- unless:
|
- unless:
|
||||||
condition:
|
condition:
|
||||||
|
|
@ -86,9 +85,23 @@ commands:
|
||||||
steps:
|
steps:
|
||||||
- run: echo 'export RACE="-race"' >> $BASH_ENV
|
- run: echo 'export RACE="-race"' >> $BASH_ENV
|
||||||
- run: |
|
- run: |
|
||||||
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> --junitfile test-results/gotestsum-report.xml -- ${RACE} -short ./...
|
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./...
|
||||||
- store_test_results:
|
- when:
|
||||||
path: test-results
|
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:
|
- when:
|
||||||
condition:
|
condition:
|
||||||
equal: [ linux, << parameters.os >> ]
|
equal: [ linux, << parameters.os >> ]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue