From 7c9b312cee6228c7e7af4e9fa4b86b179f99d444 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Tue, 12 Jul 2016 15:31:08 -0600 Subject: [PATCH] Make race detector build in CI --- plugins/serializers/graphite/graphite.go | 7 ++++--- scripts/circle-test.sh | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/serializers/graphite/graphite.go b/plugins/serializers/graphite/graphite.go index 43e32c244..db114ce9d 100644 --- a/plugins/serializers/graphite/graphite.go +++ b/plugins/serializers/graphite/graphite.go @@ -55,8 +55,9 @@ func (s *GraphiteSerializer) SerializeBucketName( measurement string, tags map[string]string, ) string { - if s.Template == "" { - s.Template = DEFAULT_TEMPLATE + template := s.Template + if template == "" { + template = DEFAULT_TEMPLATE } tagsCopy := make(map[string]string) for k, v := range tags { @@ -64,7 +65,7 @@ func (s *GraphiteSerializer) SerializeBucketName( } var out []string - templateParts := strings.Split(s.Template, ".") + templateParts := strings.Split(template, ".") for _, templatePart := range templateParts { switch templatePart { case "measurement": diff --git a/scripts/circle-test.sh b/scripts/circle-test.sh index 2333b5b73..93bafe320 100755 --- a/scripts/circle-test.sh +++ b/scripts/circle-test.sh @@ -69,6 +69,8 @@ exit_if_fail telegraf -config $tmpdir/config.toml \ -test -input-filter cpu:mem cat $GOPATH/bin/telegraf | gzip > $CIRCLE_ARTIFACTS/telegraf.gz +go build -o telegraf-race -race -ldflags "-X main.version=${VERSION}-RACE" cmd/telegraf/telegraf.go +cat telegraf-race | gzip > $CIRCLE_ARTIFACTS/telegraf-race.gz eval "git describe --exact-match HEAD" if [ $? -eq 0 ]; then