Skip to content

Commit

Permalink
Merge pull request #3 from treydock/updates
Browse files Browse the repository at this point in the history
Update to 1.15 and update Go module dependencies
  • Loading branch information
treydock authored Nov 9, 2020
2 parents e747cf1 + 85388a5 commit 888f577
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ executors:
# also be updated.
golang:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.15

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
go:
version: 1.13
version: 1.15
cgo: false
repository:
path: github.com/treydock/ssh_exporter
Expand Down
24 changes: 18 additions & 6 deletions collector/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ func TestCollector(t *testing.T) {
logger := log.NewLogfmtLogger(w)
collector := NewCollector(target, logger)
gatherers := setupGatherer(collector)
if val := testutil.CollectAndCount(collector); val != 6 {
if val, err := testutil.GatherAndCount(gatherers); err != nil {
t.Errorf("Unexpected error: %v", err)
} else if val != 6 {
t.Errorf("Unexpected collection count %d, expected 6", val)
}
if err := testutil.GatherAndCompare(gatherers, strings.NewReader(expected),
Expand Down Expand Up @@ -134,7 +136,9 @@ func TestCollectorCommand(t *testing.T) {
}
collector := NewCollector(target, log.NewNopLogger())
gatherers := setupGatherer(collector)
if val := testutil.CollectAndCount(collector); val != 6 {
if val, err := testutil.GatherAndCount(gatherers); err != nil {
t.Errorf("Unexpected error: %v", err)
} else if val != 6 {
t.Errorf("Unexpected collection count %d, expected 6", val)
}
if err := testutil.GatherAndCompare(gatherers, strings.NewReader(expected),
Expand Down Expand Up @@ -165,7 +169,9 @@ func TestCollectorCommandOutputError(t *testing.T) {
}
collector := NewCollector(target, log.NewNopLogger())
gatherers := setupGatherer(collector)
if val := testutil.CollectAndCount(collector); val != 6 {
if val, err := testutil.GatherAndCount(gatherers); err != nil {
t.Errorf("Unexpected error: %v", err)
} else if val != 6 {
t.Errorf("Unexpected collection count %d, expected 6", val)
}
if err := testutil.GatherAndCompare(gatherers, strings.NewReader(expected),
Expand Down Expand Up @@ -196,7 +202,9 @@ func TestCollectorTimeout(t *testing.T) {
logger := log.NewLogfmtLogger(w)
collector := NewCollector(target, logger)
gatherers := setupGatherer(collector)
if val := testutil.CollectAndCount(collector); val != 6 {
if val, err := testutil.GatherAndCount(gatherers); err != nil {
t.Errorf("Unexpected error: %v", err)
} else if val != 6 {
t.Errorf("Unexpected collection count %d, expected 6", val)
}
if err := testutil.GatherAndCompare(gatherers, strings.NewReader(expected),
Expand Down Expand Up @@ -227,7 +235,9 @@ func TestCollectorError(t *testing.T) {
logger := log.NewLogfmtLogger(w)
collector := NewCollector(target, logger)
gatherers := setupGatherer(collector)
if val := testutil.CollectAndCount(collector); val != 6 {
if val, err := testutil.GatherAndCount(gatherers); err != nil {
t.Errorf("Unexpected error: %v", err)
} else if val != 6 {
t.Errorf("Unexpected collection count %d, expected 6", val)
}
if err := testutil.GatherAndCompare(gatherers, strings.NewReader(expected),
Expand Down Expand Up @@ -258,7 +268,9 @@ func TestCollectorPrivateKey(t *testing.T) {
logger := log.NewLogfmtLogger(w)
collector := NewCollector(target, logger)
gatherers := setupGatherer(collector)
if val := testutil.CollectAndCount(collector); val != 6 {
if val, err := testutil.GatherAndCount(gatherers); err != nil {
t.Errorf("Unexpected error: %v", err)
} else if val != 6 {
t.Errorf("Unexpected collection count %d, expected 6", val)
}
if err := testutil.GatherAndCompare(gatherers, strings.NewReader(expected),
Expand Down
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
module github.com/treydock/ssh_exporter

go 1.13
go 1.15

require (
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/gliderlabs/ssh v0.3.0
github.com/go-kit/kit v0.10.0
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/common v0.9.1
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59
github.com/prometheus/client_golang v1.8.0
github.com/prometheus/common v0.14.0
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
golang.org/x/sys v0.0.0-20201107080550-4d91cf3a1aaf // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
)
Loading

0 comments on commit 888f577

Please sign in to comment.