Browse Source

Merge "Update used Go version to 1.3."

changes/80/380/1
Julius Volz 10 years ago committed by Gerrit Code Review
parent
commit
bfb64321de
  1. 2
      Makefile
  2. 4
      Makefile.INCLUDE
  3. 11
      storage/metric/tiered/end_to_end_test.go
  4. 9
      templates/templates_test.go

2
Makefile

@ -49,7 +49,7 @@ tag:
git push --tags git push --tags
$(BUILD_PATH)/cache/$(GOPKG): $(BUILD_PATH)/cache/$(GOPKG):
curl -o $@ $(GOURL)/$(GOPKG) curl -o $@ -L $(GOURL)/$(GOPKG)
benchmark: test benchmark: test
$(GO) test $(GO_TEST_FLAGS) -test.bench='Benchmark' ./... $(GO) test $(GO_TEST_FLAGS) -test.bench='Benchmark' ./...

4
Makefile.INCLUDE

@ -34,7 +34,7 @@ MAC_OS_X_VERSION ?= 10.8
BUILD_PATH = $(PWD)/.build BUILD_PATH = $(PWD)/.build
GO_VERSION := 1.2.1 GO_VERSION := 1.3
GOOS = $(subst Darwin,darwin,$(subst Linux,linux,$(OS))) GOOS = $(subst Darwin,darwin,$(subst Linux,linux,$(OS)))
ifeq ($(GOOS),darwin) ifeq ($(GOOS),darwin)
@ -45,7 +45,7 @@ endif
GOARCH = $(subst x86_64,amd64,$(ARCH)) GOARCH = $(subst x86_64,amd64,$(ARCH))
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
GOURL ?= http://go.googlecode.com/files GOURL ?= http://golang.org/dl
GOROOT = $(BUILD_PATH)/root/go GOROOT = $(BUILD_PATH)/root/go
GOPATH = $(BUILD_PATH)/root/gopath GOPATH = $(BUILD_PATH)/root/gopath
GOCC = $(GOROOT)/bin/go GOCC = $(GOROOT)/bin/go

11
storage/metric/tiered/end_to_end_test.go

@ -189,8 +189,15 @@ func GetLabelValuesForLabelNameTests(p metric.Persistence, t testing.TB) {
t.Fatalf("Number of values don't match for label %s: got %d; want %d", name, len(actual), len(expected)) t.Fatalf("Number of values don't match for label %s: got %d; want %d", name, len(actual), len(expected))
} }
for i := range expected { for i := range expected {
if actual[i] != expected[i] { inActual := false
t.Fatalf("%d. Got %s; want %s", i, actual[i], expected[i]) for _, a := range actual {
if expected[i] == a {
inActual = true
break
}
}
if !inActual {
t.Fatalf("%d. Expected label value %s not in output", i, expected[i])
} }
} }
} }

9
templates/templates_test.go

@ -74,8 +74,8 @@ func TestTemplateExpansion(t *testing.T) {
output: "a", output: "a",
}, },
{ {
// Range over query. // Range over query and sort by label.
text: "{{ range query \"metric\" }}{{.Labels.instance}}:{{.Value}}: {{end}}", text: "{{ range query \"metric\" | sortByLabel \"instance\" }}{{.Labels.instance}}:{{.Value}}: {{end}}",
output: "a:11: b:21: ", output: "a:11: b:21: ",
}, },
{ {
@ -98,11 +98,6 @@ func TestTemplateExpansion(t *testing.T) {
text: "{{ reReplaceAll \"(a)b\" \"x$1\" \"ab\" }}", text: "{{ reReplaceAll \"(a)b\" \"x$1\" \"ab\" }}",
output: "xa", output: "xa",
}, },
{
// Sorting.
text: "{{ range query \"metric\" | sortByLabel \"instance\" }}{{.Labels.instance}} {{end}}",
output: "a b ",
},
{ {
// Humanize. // Humanize.
text: "{{ range . }}{{ humanize . }}:{{ end }}", text: "{{ range . }}{{ humanize . }}:{{ end }}",

Loading…
Cancel
Save