Skip to content

Commit

Permalink
update consul based dependencies
Browse files Browse the repository at this point in the history
Needed to update to get newer API with Namespaces support.

Upgrading brought in changes to sdk test server setup that required
changes in the tests. Nothing was changed unrelated to the update.
  • Loading branch information
eikenb committed Sep 2, 2021
1 parent 9401ad1 commit fb420f1
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 56 deletions.
11 changes: 6 additions & 5 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package main

import (
"fmt"
"github.com/hashicorp/go-hclog"
"reflect"
"testing"
"time"

"github.com/hashicorp/go-hclog"

"github.com/hashicorp/consul/sdk/testutil/retry"
)

Expand Down Expand Up @@ -42,7 +43,7 @@ func testAgent(t *testing.T, cb func(*Config)) *Agent {

func TestAgent_registerServiceAndCheck(t *testing.T) {
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -241,7 +242,7 @@ func TestAgent_VerifyConsulCompatibility(t *testing.T) {
// Smoke test to test the compatibility with the current Consul version
// pinned in go dependency.
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand All @@ -262,7 +263,7 @@ func TestAgent_VerifyConsulCompatibility(t *testing.T) {
func TestAgent_uniqueInstanceID(t *testing.T) {
t.Parallel()

s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -315,7 +316,7 @@ func TestAgent_notUniqueInstanceIDFails(t *testing.T) {
t.Parallel()
notUniqueInstanceID := "not-unique-instance-id"

s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down
11 changes: 6 additions & 5 deletions check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ package main

import (
"crypto/tls"
"github.com/hashicorp/go-hclog"
"testing"
"time"

"github.com/hashicorp/go-hclog"

"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/sdk/testutil/retry"
"github.com/stretchr/testify/assert"
)

func TestCheck_HTTP(t *testing.T) {
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -120,7 +121,7 @@ func TestCheck_HTTP(t *testing.T) {

func TestCheck_TCP(t *testing.T) {
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -236,7 +237,7 @@ func TestCheck_MinimumInterval(t *testing.T) {
// Confirm that a check's interval is at least the minimum interval

t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -296,7 +297,7 @@ func TestCheck_MinimumInterval(t *testing.T) {
func TestCheck_NoFlapping(t *testing.T) {
// Confirm that the status flapping protections work

s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down
8 changes: 4 additions & 4 deletions coordinate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func TestCoordinate_updateNodeCoordinate(t *testing.T) {
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestCoordinate_updateNodeCoordinate(t *testing.T) {

func TestCoordinate_updateNodeCheck(t *testing.T) {
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestCoordinate_updateNodeCheck(t *testing.T) {

func TestCoordinate_reapFailedNode(t *testing.T) {
t.Parallel()
s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestCoordinate_reapFailedNode(t *testing.T) {
func TestCoordinate_parallelPings(t *testing.T) {
t.Parallel()

s, err := NewTestServer()
s, err := NewTestServer(t)
if err != nil {
t.Fatal(err)
}
Expand Down
25 changes: 14 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ go 1.16

require (
github.com/Microsoft/go-winio v0.4.5 // indirect
github.com/armon/go-metrics v0.3.4
github.com/armon/go-metrics v0.3.9
github.com/fatih/color v1.12.0 // indirect
github.com/go-ping/ping v0.0.0-20210506233800-ff8be3320020
github.com/hashicorp/consul v1.6.1
github.com/hashicorp/consul/api v1.2.0
github.com/hashicorp/consul/sdk v0.4.0
github.com/hashicorp/go-hclog v0.15.0
github.com/hashicorp/go-immutable-radix v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/consul/api v1.10.1
github.com/hashicorp/consul/sdk v0.8.0
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v0.16.2
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.0
github.com/hashicorp/go-retryablehttp v0.6.3 // indirect
github.com/hashicorp/go-rootcerts v1.0.1 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.1
github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/serf v0.8.4
github.com/miekg/dns v1.1.22 // indirect
github.com/mitchellh/cli v1.0.0
github.com/hashicorp/serf v0.9.5
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/mitchellh/cli v1.1.0
github.com/mitchellh/hashstructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.1.2
github.com/mitchellh/mapstructure v1.4.1
github.com/prometheus/client_golang v1.4.0
github.com/stretchr/testify v1.4.0
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
google.golang.org/grpc v1.25.0 // indirect
)
Loading

0 comments on commit fb420f1

Please sign in to comment.