diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-03-13 12:54:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-13 12:54:22 -0400 |
commit | c281ee3b61e8ab53ff118866d72618ae8cce582b (patch) | |
tree | 776e7bdf6c8bfbb9a1dee5976496ab065959991f /vendor/github.com/prometheus/common | |
parent | 3ada7a41a7fb13abef19dd63dc56b720900dbaa9 (diff) | |
download | chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.tar.gz chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.tar.bz2 chat-c281ee3b61e8ab53ff118866d72618ae8cce582b.zip |
Updating server dependancies. Also adding github.com/jaytaylor/html2text and gopkg.in/gomail.v2 (#5748)
Diffstat (limited to 'vendor/github.com/prometheus/common')
5 files changed, 57 insertions, 19 deletions
diff --git a/vendor/github.com/prometheus/common/AUTHORS.md b/vendor/github.com/prometheus/common/AUTHORS.md deleted file mode 100644 index c63f4d395..000000000 --- a/vendor/github.com/prometheus/common/AUTHORS.md +++ /dev/null @@ -1,11 +0,0 @@ -Maintainers of this repository: - -* Fabian Reinartz <fabian@soundcloud.com> - -The following individuals have contributed code to this repository -(listed in alphabetical order): - -* Björn Rabenstein <beorn@soundcloud.com> -* Fabian Reinartz <fabian@soundcloud.com> -* Julius Volz <julius.volz@gmail.com> -* Miguel Molina <hi@mvader.me> diff --git a/vendor/github.com/prometheus/common/CONTRIBUTING.md b/vendor/github.com/prometheus/common/CONTRIBUTING.md index 5705f0fbe..40503edbf 100644 --- a/vendor/github.com/prometheus/common/CONTRIBUTING.md +++ b/vendor/github.com/prometheus/common/CONTRIBUTING.md @@ -2,9 +2,9 @@ Prometheus uses GitHub to manage reviews of pull requests. -* If you have a trivial fix or improvement, go ahead and create a pull - request, addressing (with `@...`) one or more of the maintainers - (see [AUTHORS.md](AUTHORS.md)) in the description of the pull request. +* If you have a trivial fix or improvement, go ahead and create a pull request, + addressing (with `@...`) the maintainer of this repository (see + [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. * If you plan to do something more involved, first discuss your ideas on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). diff --git a/vendor/github.com/prometheus/common/MAINTAINERS.md b/vendor/github.com/prometheus/common/MAINTAINERS.md new file mode 100644 index 000000000..1b3152161 --- /dev/null +++ b/vendor/github.com/prometheus/common/MAINTAINERS.md @@ -0,0 +1 @@ +* Fabian Reinartz <fabian.reinartz@coreos.com> diff --git a/vendor/github.com/prometheus/common/model/value.go b/vendor/github.com/prometheus/common/model/value.go index 7728abaee..c9ed3ffd8 100644 --- a/vendor/github.com/prometheus/common/model/value.go +++ b/vendor/github.com/prometheus/common/model/value.go @@ -129,11 +129,8 @@ func (s *Sample) Equal(o *Sample) bool { if !s.Timestamp.Equal(o.Timestamp) { return false } - if s.Value.Equal(o.Value) { - return false - } - return true + return s.Value.Equal(o.Value) } func (s Sample) String() string { diff --git a/vendor/github.com/prometheus/common/model/value_test.go b/vendor/github.com/prometheus/common/model/value_test.go index 8d2b69ea1..b97dcf84c 100644 --- a/vendor/github.com/prometheus/common/model/value_test.go +++ b/vendor/github.com/prometheus/common/model/value_test.go @@ -21,7 +21,7 @@ import ( "testing" ) -func TestEqual(t *testing.T) { +func TestEqualValues(t *testing.T) { tests := map[string]struct { in1, in2 SampleValue want bool @@ -76,6 +76,57 @@ func TestEqual(t *testing.T) { } } +func TestEqualSamples(t *testing.T) { + testSample := &Sample{} + + tests := map[string]struct { + in1, in2 *Sample + want bool + }{ + "equal pointers": { + in1: testSample, + in2: testSample, + want: true, + }, + "different metrics": { + in1: &Sample{Metric: Metric{"foo": "bar"}}, + in2: &Sample{Metric: Metric{"foo": "biz"}}, + want: false, + }, + "different timestamp": { + in1: &Sample{Timestamp: 0}, + in2: &Sample{Timestamp: 1}, + want: false, + }, + "different value": { + in1: &Sample{Value: 0}, + in2: &Sample{Value: 1}, + want: false, + }, + "equal samples": { + in1: &Sample{ + Metric: Metric{"foo": "bar"}, + Timestamp: 0, + Value: 1, + }, + in2: &Sample{ + Metric: Metric{"foo": "bar"}, + Timestamp: 0, + Value: 1, + }, + want: true, + }, + } + + for name, test := range tests { + got := test.in1.Equal(test.in2) + if got != test.want { + t.Errorf("Comparing %s, %v and %v: got %t, want %t", name, test.in1, test.in2, got, test.want) + } + } + +} + func TestSamplePairJSON(t *testing.T) { input := []struct { plain string |