Update valkeyrie to a9a70ee
This commit is contained in:
parent
4755bb2f33
commit
40db06204b
11 changed files with 93 additions and 72 deletions
|
@ -2,6 +2,7 @@ package integration
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
|
@ -36,6 +37,7 @@ func (s *ConsulSuite) setupStore(c *check.C) {
|
|||
|
||||
consul.Register()
|
||||
kv, err := valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.CONSUL,
|
||||
[]string{consulAddr},
|
||||
&store.Config{
|
||||
|
@ -105,7 +107,7 @@ func (s *ConsulSuite) TestSimpleConfiguration(c *check.C) {
|
|||
}
|
||||
|
||||
for k, v := range data {
|
||||
err := s.kvClient.Put(k, []byte(v), nil)
|
||||
err := s.kvClient.Put(context.Background(), k, []byte(v), nil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package integration
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -35,6 +36,7 @@ func (s *EtcdSuite) SetUpSuite(c *check.C) {
|
|||
var err error
|
||||
s.etcdAddr = net.JoinHostPort(s.getComposeServiceIP(c, "etcd"), "2379")
|
||||
s.kvClient, err = valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.ETCDV3,
|
||||
[]string{s.etcdAddr},
|
||||
&store.Config{
|
||||
|
@ -101,7 +103,7 @@ func (s *EtcdSuite) TestSimpleConfiguration(c *check.C) {
|
|||
}
|
||||
|
||||
for k, v := range data {
|
||||
err := s.kvClient.Put(k, []byte(v), nil)
|
||||
err := s.kvClient.Put(context.Background(), k, []byte(v), nil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package integration
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -33,6 +34,7 @@ func (s *RedisSuite) setupStore(c *check.C) {
|
|||
s.redisAddr = net.JoinHostPort(s.getComposeServiceIP(c, "redis"), "6379")
|
||||
redis.Register()
|
||||
kv, err := valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.REDIS,
|
||||
[]string{s.redisAddr},
|
||||
&store.Config{
|
||||
|
@ -102,7 +104,7 @@ func (s *RedisSuite) TestSimpleConfiguration(c *check.C) {
|
|||
}
|
||||
|
||||
for k, v := range data {
|
||||
err := s.kvClient.Put(k, []byte(v), nil)
|
||||
err := s.kvClient.Put(context.Background(), k, []byte(v), nil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package try
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
@ -185,7 +186,7 @@ type DoCondition func() error
|
|||
// Verify if a Key exists in the store.
|
||||
func KVExists(kv store.Store, key string) DoCondition {
|
||||
return func() error {
|
||||
_, err := kv.Exists(key, nil)
|
||||
_, err := kv.Exists(context.Background(), key, nil)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package integration
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -36,6 +37,7 @@ func (s *ZookeeperSuite) setupStore(c *check.C) {
|
|||
|
||||
var err error
|
||||
s.kvClient, err = valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.ZK,
|
||||
[]string{s.zookeeperAddr},
|
||||
&store.Config{
|
||||
|
@ -104,7 +106,7 @@ func (s *ZookeeperSuite) TestSimpleConfiguration(c *check.C) {
|
|||
}
|
||||
|
||||
for k, v := range data {
|
||||
err := s.kvClient.Put(k, []byte(v), nil)
|
||||
err := s.kvClient.Put(context.Background(), k, []byte(v), nil)
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue