Skip to content

Commit

Permalink
Merge pull request #180 from eko/fixed-tests
Browse files Browse the repository at this point in the history
chore: fixed unit tests and upgraded dependencies
  • Loading branch information
eko committed Nov 10, 2022
2 parents a061905 + e5291f5 commit cff4461
Show file tree
Hide file tree
Showing 33 changed files with 556 additions and 214 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/all.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go_version: [ '1.18' ]
go_version: [ '1.18', '1.19' ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
Expand Down
22 changes: 11 additions & 11 deletions go.mod
@@ -1,11 +1,11 @@
module github.com/eko/gocache/v3

go 1.18
go 1.19

require (
github.com/XiaoMi/pegasus-go-client v0.0.0-20210427083443-f3b6b08bc4c2
github.com/allegro/bigcache/v3 v3.0.2
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d
github.com/allegro/bigcache/v3 v3.1.0
github.com/bradfitz/gomemcache v0.0.0-20221031212613-62deef7fc822
github.com/coocood/freecache v1.2.3
github.com/dgraph-io/ristretto v0.1.1
github.com/go-redis/redis/v8 v8.11.5
Expand All @@ -17,8 +17,8 @@ require (
github.com/spf13/cast v1.5.0
github.com/stretchr/testify v1.8.1
github.com/vmihailenco/msgpack v4.0.4+incompatible
golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
golang.org/x/exp v0.0.0-20221110155412-d0897a79cd37
golang.org/x/sync v0.1.0
)

require (
Expand All @@ -30,22 +30,22 @@ require (
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gopherjs/gopherjs v0.0.0-20220410123724-9e86199038b0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/pegasus-kv/thrift v0.13.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apimachinery v0.23.5 // indirect
k8s.io/apimachinery v0.25.3 // indirect
)
117 changes: 23 additions & 94 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions store/freecache_test.go
Expand Up @@ -329,7 +329,7 @@ func TestFreecacheSetWithTags(t *testing.T) {
client.EXPECT().Get([]byte("freecache_tag_tag1")).MaxTimes(1).Return(nil, errors.New("value not found in store"))
client.EXPECT().Set([]byte("freecache_tag_tag1"), []byte("my-key"), 2592000).Return(nil)

s := NewFreecache(client, WithExpiration(6*time.Second), WithTags([]string{"tag1"}))
s := NewFreecache(client, WithExpiration(6*time.Second))
err := s.Set(ctx, cacheKey, cacheValue, WithExpiration(6*time.Second), WithTags([]string{"tag1"}))
assert.Nil(t, err)
}
Expand Down Expand Up @@ -372,7 +372,7 @@ func TestFreecacheTagsAlreadyPresent(t *testing.T) {
client.EXPECT().Get([]byte("freecache_tag_tag1")).MaxTimes(1).Return(oldCacheKeys, nil)
client.EXPECT().Set([]byte("freecache_tag_tag1"), []byte("key1,key2,my-key"), 2592000).Return(nil)

s := NewFreecache(client, WithExpiration(6*time.Second), WithTags([]string{"tag1"}))
s := NewFreecache(client, WithExpiration(6*time.Second))
err := s.Set(ctx, cacheKey, cacheValue, WithExpiration(6*time.Second), WithTags([]string{"tag1"}))
assert.Nil(t, err)
}
Expand All @@ -393,7 +393,7 @@ func TestFreecacheTagsRefreshTime(t *testing.T) {
client.EXPECT().Get([]byte("freecache_tag_tag1")).MaxTimes(1).Return(oldCacheKeys, nil)
client.EXPECT().Set([]byte("freecache_tag_tag1"), []byte("my-key"), 2592000).Return(nil)

s := NewFreecache(client, WithExpiration(6*time.Second), WithTags([]string{"tag1"}))
s := NewFreecache(client, WithExpiration(6*time.Second))
err := s.Set(ctx, cacheKey, cacheValue, WithExpiration(6*time.Second), WithTags([]string{"tag1"}))
assert.Nil(t, err)
}
Expand Down
12 changes: 8 additions & 4 deletions vendor/github.com/allegro/bigcache/v3/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions vendor/github.com/allegro/bigcache/v3/bigcache.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 32 additions & 12 deletions vendor/github.com/allegro/bigcache/v3/shard.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/github.com/bradfitz/gomemcache/memcache/memcache.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cff4461

Please sign in to comment.