diff --git a/.travis.yml b/.travis.yml index b1c6ffc8f1..7a9d985ec5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ +# We use native code; sue me. + language: go +# Detective work is required to ascertain why this is required BOTH in the +# before_script directive and in the shell library. before_script: -- gvm install go1.0.3 || true -- gvm use go1.0.3 || true + - gvm install go1.1 || true + - gvm use go1.1 || true script: - - make + - bash -l ./tests-for-die-in-a-fire-travis.sh diff --git a/Makefile.INCLUDE b/Makefile.INCLUDE index cb83b97a03..58062e8b00 100644 --- a/Makefile.INCLUDE +++ b/Makefile.INCLUDE @@ -25,7 +25,7 @@ else export THIRD_PARTY_BUILD_OUTPUT := endif -GO_VERSION := 1.0.3 +GO_VERSION := 1.1 LEVELDB_VERSION := 1.9.0 PROTOCOL_BUFFERS_VERSION := 2.5.0 SNAPPY_VERSION := 1.1.0 diff --git a/README.md b/README.md index 557726c866..6537ca3a58 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ action if some condition is observed to be true. If you read below in the _Getting Started_ section, the build infrastructure will take care of the following things for you in most cases: - 1. Go 1.0.3. + 1. Go 1.1. 2. GVM: [https://github.com/moovweb/gvm](https://github.com/moovweb/gvm) is highly recommended as well. 3. LevelDB: [https://code.google.com/p/leveldb/](https://code.google.com/p/leveldb/). 4. Protocol Buffers Compiler: [http://code.google.com/p/protobuf/](http://code.google.com/p/protobuf/). @@ -39,8 +39,8 @@ For basic help how to get started: ### Working with GVM Starting out, the following workflow is advised: - $ gvm install go1.0.3 - $ gvm use go1.0.3 + $ gvm install go1.1 + $ gvm use go1.1 $ gvm pkgset create prometheus $ gvm pkgset use prometheus diff --git a/build/Makefile b/build/Makefile index 3aa007b4dc..9f9df0fccf 100644 --- a/build/Makefile +++ b/build/Makefile @@ -70,7 +70,6 @@ goskiplist-stamp: go-stamp gvm-stamp: bison-stamp cc-stamp mercurial-stamp [ -x "$$(which gvm)" ] || { echo "gvm not found; install manually from https://github.com/moovweb/gvm." ; false ; } - -gvm install go$(GO_VERSION) # # ********** ********** # gvm installed go$(GO_VERSION) if it did not exist already. diff --git a/model/fingerprinting.go b/model/fingerprinting.go index c18e5b8755..123e1292aa 100644 --- a/model/fingerprinting.go +++ b/model/fingerprinting.go @@ -105,9 +105,9 @@ func NewFingerprintFromMetric(metric Metric) (f Fingerprint) { return fingerprint{ firstCharacterOfFirstLabelName: firstCharacterOfFirstLabelName, - hash: binary.LittleEndian.Uint64(summer.Sum(nil)), - labelMatterLength: uint(labelMatterLength % 10), - lastCharacterOfLastLabelValue: lastCharacterOfLastLabelValue, + hash: binary.LittleEndian.Uint64(summer.Sum(nil)), + labelMatterLength: uint(labelMatterLength % 10), + lastCharacterOfLastLabelValue: lastCharacterOfLastLabelValue, } } diff --git a/retrieval/format/discriminator.go b/retrieval/format/discriminator.go index eabafc0af0..5c7f8f8cff 100644 --- a/retrieval/format/discriminator.go +++ b/retrieval/format/discriminator.go @@ -71,6 +71,4 @@ func (r *registry) ProcessorForRequestHeader(header http.Header) (processor Proc err = fmt.Errorf("Unrecognized API version %s", prometheusApiVersion) return } - - return } diff --git a/rules/load.go b/rules/load.go index 690071c750..7bd988e2f0 100644 --- a/rules/load.go +++ b/rules/load.go @@ -92,7 +92,6 @@ func LoadFromReader(rulesReader io.Reader, singleExpr bool) (interface{}, error) } else { return lexer.parsedRules, nil } - panic("") } func LoadRulesFromReader(rulesReader io.Reader) ([]Rule, error) { diff --git a/rules/testdata.go b/rules/testdata.go index 6a4f4780b5..c1c43719bc 100644 --- a/rules/testdata.go +++ b/rules/testdata.go @@ -143,7 +143,7 @@ var testMatrix = ast.Matrix{ { Metric: model.Metric{ model.MetricNameLabel: "x", - "y": "testvalue", + "y": "testvalue", }, Values: getTestValueStream(0, 100, 10), }, diff --git a/storage/metric/tiered.go b/storage/metric/tiered.go index 6403442210..55b96591f8 100644 --- a/storage/metric/tiered.go +++ b/storage/metric/tiered.go @@ -49,8 +49,6 @@ func (c chunk) TruncateBefore(t time.Time) chunk { default: return c[index-1:] } - - panic("unreachable") } // TieredStorage both persists samples and generates materialized views for diff --git a/tests-for-die-in-a-fire-travis.sh b/tests-for-die-in-a-fire-travis.sh new file mode 100755 index 0000000000..a111001fdf --- /dev/null +++ b/tests-for-die-in-a-fire-travis.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copyright 2013 Prometheus Team +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A helper until https://github.com/travis-ci/travis-cookbooks/issues/184 is +# remedied. + +. ./tests-for-die-in-a-fire-travis.shlib + +make -f Makefile || exit 1 diff --git a/tests-for-die-in-a-fire-travis.shlib b/tests-for-die-in-a-fire-travis.shlib new file mode 100644 index 0000000000..bdad544900 --- /dev/null +++ b/tests-for-die-in-a-fire-travis.shlib @@ -0,0 +1,23 @@ +#!/bin/bash + +# Copyright 2013 Prometheus Team +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A helper until https://github.com/travis-ci/travis-cookbooks/issues/184 is +# remedied. + +gvm install go1.1 +gvm use go1.1 + +go version +go env