Add 1.13 support. Fix tests to enable 1.13 support
This commit is contained in:
parent
da572041ca
commit
87a5e85062
@ -1,6 +1,7 @@
|
|||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.12.x
|
- 1.12.x
|
||||||
|
- 1.13.x
|
||||||
env:
|
env:
|
||||||
- GO111MODULE=on
|
- GO111MODULE=on
|
||||||
notifications:
|
notifications:
|
||||||
|
@ -12,13 +12,14 @@ var (
|
|||||||
dbpw = flag.String("database-password", "", "db pw")
|
dbpw = flag.String("database-password", "", "db pw")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func initTestFlags() {
|
||||||
flag.Set("database-host", "localhost")
|
flag.Set("database-host", "localhost")
|
||||||
flag.Set("database-password", "some-password")
|
flag.Set("database-password", "some-password")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFlagsrc_Read(t *testing.T) {
|
func TestFlagsrc_Read(t *testing.T) {
|
||||||
|
initTestFlags()
|
||||||
source := NewSource()
|
source := NewSource()
|
||||||
c, err := source.Read()
|
c, err := source.Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -46,6 +47,7 @@ func TestFlagsrc_Read(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFlagsrc_ReadAll(t *testing.T) {
|
func TestFlagsrc_ReadAll(t *testing.T) {
|
||||||
|
initTestFlags()
|
||||||
source := NewSource(IncludeUnset(true))
|
source := NewSource(IncludeUnset(true))
|
||||||
c, err := source.Read()
|
c, err := source.Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
2
go.mod
2
go.mod
@ -53,8 +53,6 @@ require (
|
|||||||
github.com/miekg/dns v1.1.15 // indirect
|
github.com/miekg/dns v1.1.15 // indirect
|
||||||
github.com/mitchellh/gox v1.0.1 // indirect
|
github.com/mitchellh/gox v1.0.1 // indirect
|
||||||
github.com/mitchellh/hashstructure v1.0.0
|
github.com/mitchellh/hashstructure v1.0.0
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
|
||||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
|
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
|
||||||
github.com/nats-io/nats.go v1.8.1
|
github.com/nats-io/nats.go v1.8.1
|
||||||
github.com/nats-io/nkeys v0.1.0 // indirect
|
github.com/nats-io/nkeys v0.1.0 // indirect
|
||||||
|
@ -40,7 +40,7 @@ func TestGossipRegistryBroadcast(t *testing.T) {
|
|||||||
r1 := newRegistry(Config(mc1), Address("127.0.0.1:54321"))
|
r1 := newRegistry(Config(mc1), Address("127.0.0.1:54321"))
|
||||||
|
|
||||||
mc2 := newMemberlistConfig()
|
mc2 := newMemberlistConfig()
|
||||||
r2 := newRegistry(Config(mc2), Address("127.0.0.2:54321"), registry.Addrs("127.0.0.1:54321"))
|
r2 := newRegistry(Config(mc2), Address("127.0.0.1:54322"), registry.Addrs("127.0.0.1:54321"))
|
||||||
|
|
||||||
defer r1.(*gossipRegistry).Stop()
|
defer r1.(*gossipRegistry).Stop()
|
||||||
defer r2.(*gossipRegistry).Stop()
|
defer r2.(*gossipRegistry).Stop()
|
||||||
@ -100,7 +100,7 @@ func TestGossipRegistryRetry(t *testing.T) {
|
|||||||
r1 := newRegistry(Config(mc1), Address("127.0.0.1:54321"))
|
r1 := newRegistry(Config(mc1), Address("127.0.0.1:54321"))
|
||||||
|
|
||||||
mc2 := newMemberlistConfig()
|
mc2 := newMemberlistConfig()
|
||||||
r2 := newRegistry(Config(mc2), Address("127.0.0.2:54321"), registry.Addrs("127.0.0.1:54321"))
|
r2 := newRegistry(Config(mc2), Address("127.0.0.1:54322"), registry.Addrs("127.0.0.1:54321"))
|
||||||
|
|
||||||
defer r1.(*gossipRegistry).Stop()
|
defer r1.(*gossipRegistry).Stop()
|
||||||
defer r2.(*gossipRegistry).Stop()
|
defer r2.(*gossipRegistry).Stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user