Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run short unit tests as part of the telegraf circleci process #91

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Skip per-cpu unit test when in a circle ci container
  • Loading branch information
sparrc committed Aug 5, 2015
commit 7e6a76bfb2f0c4d734d6a75b2d5921031a346d00
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,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
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions plugins/system/ps/cpu/cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cpu

import (
"fmt"
"os"
"runtime"
"testing"
"time"
Expand Down Expand Up @@ -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)
}