Skip per-cpu unit test when in a circle ci container
This commit is contained in:
parent
5259c50612
commit
42a7203b1e
|
@ -205,9 +205,9 @@ To execute Telegraf tests follow these simple steps:
|
|||
- Install docker compose following [these](https://docs.docker.com/compose/install/) instructions
|
||||
- NOTE: mac users should be able to simply do `brew install boot2docker`
|
||||
and `brew install docker-compose`
|
||||
|
||||
execute `make test`
|
||||
- execute `make test`
|
||||
|
||||
### Unit test troubleshooting:
|
||||
|
||||
Try killing your docker containers via `docker-compose kill` and then re-running
|
||||
Try cleaning up your test environment by executing `make test-cleanup` and
|
||||
re-running
|
||||
|
|
|
@ -20,5 +20,5 @@ test:
|
|||
- golint testutil/...
|
||||
- golint cmd/...
|
||||
# Run short unit tests
|
||||
- go test -v -short ./...
|
||||
- make test-short
|
||||
# TODO run full unit test suite
|
||||
|
|
|
@ -2,6 +2,7 @@ package cpu
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
@ -94,5 +95,10 @@ func TestCPUPercent(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCPUPercentPerCpu(t *testing.T) {
|
||||
// Skip Per-CPU tests when running from a Circle CI container,
|
||||
// see: https://github.com/golang/go/issues/11609
|
||||
if os.Getenv("CIRCLE_BUILD_NUM") != "" {
|
||||
t.Skip("Detected that we are in a circleci container, skipping Per-CPU tests")
|
||||
}
|
||||
testCPUPercent(t, true)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue