Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .project-settings.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOLANGCI_LINT_VERSION=v2.12.2
BUF_VERSION=v1.69.0
BUF_VERSION=v1.70.0
GO_VERSION=1.26.4
GCI_PREFIX=github.com/hyp3rd/hypercache
PROTO_ENABLED=false
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include .project-settings.env

GOLANGCI_LINT_VERSION ?= v2.12.2
BUF_VERSION ?= v1.69.0
BUF_VERSION ?= v1.70.0
GO_VERSION ?= 1.26.4
GCI_PREFIX ?= github.com/hyp3rd/hypercache
PROTO_ENABLED ?= true
Expand Down
6 changes: 3 additions & 3 deletions cmd/hypercache-server/mtls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"path/filepath"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

// writeTestCertPair generates a self-signed cert + key and writes
Expand Down Expand Up @@ -121,9 +123,7 @@ func assertStandardTLSConfig(t *testing.T, cfg envConfig) {
t.Fatalf("err = %v", err)
}

if got == nil {
t.Fatalf("got nil, want *tls.Config")
}
assert.NotNil(t, got, "got nil, want *tls.Config")

if got.ClientAuth != tls.NoClientCert {
t.Errorf("ClientAuth = %v, want NoClientCert (no CA was configured)", got.ClientAuth)
Expand Down
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ words:
- neighbouring
- nestif
- Newf
- Nilf
- nilnil
- nindent
- noctx
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/goccy/go-json v0.10.6
github.com/gofiber/fiber/v3 v3.3.0
github.com/hyp3rd/ewrap v1.5.1
github.com/hyp3rd/sectools v1.2.6
github.com/hyp3rd/sectools v1.2.7
github.com/redis/go-redis/v9 v9.20.0
github.com/stretchr/testify v1.11.1
github.com/ugorji/go/codec v1.3.1
Expand All @@ -18,9 +18,9 @@ require (
go.opentelemetry.io/otel/sdk v1.44.0
go.opentelemetry.io/otel/sdk/metric v1.44.0
go.opentelemetry.io/otel/trace v1.44.0
golang.org/x/crypto v0.52.0
golang.org/x/crypto v0.53.0
golang.org/x/oauth2 v0.36.0
golang.org/x/sync v0.20.0
golang.org/x/sync v0.21.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -29,7 +29,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gofiber/schema v1.7.2 // indirect
github.com/gofiber/schema v1.8.0 // indirect
github.com/gofiber/utils/v2 v2.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.18.6 // indirect
Expand All @@ -43,6 +43,6 @@ require (
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/sys v0.46.0 // indirect
golang.org/x/text v0.38.0 // indirect
)
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/gofiber/fiber/v3 v3.3.0 h1:QBd3sYCqdy6Qs5gJYzSw4I4SbqL204jPqpdub/ueiw8=
github.com/gofiber/fiber/v3 v3.3.0/go.mod h1:YH7/TAoRaU4kF8slDCtQuFJ1NzC+3MtxUI4KfvQtaIA=
github.com/gofiber/schema v1.7.2 h1:/0+siRIDYfMTh/edbdSNDXYZESBAFAu0CjKDUjo3g9Q=
github.com/gofiber/schema v1.7.2/go.mod h1:lmbXPQ8hvzXSLkdS2DS7pb4kpunC2Roh7Sj3HMjGfzA=
github.com/gofiber/schema v1.8.0 h1:NGsC9toPHmj8Xg4KpznuXBzNmHG6V5YV0tXKpKMcmis=
github.com/gofiber/schema v1.8.0/go.mod h1:lmbXPQ8hvzXSLkdS2DS7pb4kpunC2Roh7Sj3HMjGfzA=
github.com/gofiber/utils/v2 v2.1.0 h1:WSu4COJhJw9moNfJu2nQvaM9AFvAQ/nZbigjhHqKgOQ=
github.com/gofiber/utils/v2 v2.1.0/go.mod h1:DdOgEVwQTi8cou/AKWPqhXOR4fHGRVhA/rEWL3IXG7Q=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
Expand All @@ -33,8 +33,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hyp3rd/ewrap v1.5.1 h1:rnLaig+rnpBYkL7vQsvLUJGQpCLa/Yl5RRAnWjphJPs=
github.com/hyp3rd/ewrap v1.5.1/go.mod h1:Pbote45XDYyodYzdcUH7xnWmnI6SSewbOYtTlRSsfvw=
github.com/hyp3rd/sectools v1.2.6 h1:WCrBOazUmZUSHHw34zxK41m5arK+GJ4P9nX/ZFzUc6U=
github.com/hyp3rd/sectools v1.2.6/go.mod h1:qCk5b23hquPRpe/Bi8/Kavh63nFzQ6ad8GSYW1t2h4g=
github.com/hyp3rd/sectools v1.2.7 h1:gQRtEGm1YLOhJq2z58gTa8pUX/lIt3a6hQPYw2r97Ak=
github.com/hyp3rd/sectools v1.2.7/go.mod h1:n4NvttH652ijiMgHz24HGObvOsK+KXND2Mv4X31ObJs=
github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao=
github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
Expand Down Expand Up @@ -91,18 +91,18 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto=
golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio=
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
17 changes: 8 additions & 9 deletions pkg/stats/histogramcollector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"sync/atomic"
"testing"

"github.com/stretchr/testify/assert"

"github.com/hyp3rd/hypercache/internal/constants"
)

Expand Down Expand Up @@ -156,9 +158,8 @@ func TestHistogramStatsCollector_BoundedSamples(t *testing.T) {
}

stat := c.GetStats()[constants.StatHistogram.String()]
if stat == nil {
t.Fatalf("missing stat")
}

assert.NotNil(t, stat, "missing stat")

if stat.Count != 100 {
t.Errorf("lifetime Count = %d, want 100", stat.Count)
Expand Down Expand Up @@ -224,9 +225,8 @@ func TestHistogramStatsCollector_ConcurrentRecord(t *testing.T) {
readerWG.Wait()

stat := c.GetStats()[constants.StatIncr.String()]
if stat == nil {
t.Fatalf("missing stat after concurrent recording")
}

assert.NotNil(t, stat, "missing stat after concurrent recording")

wantCount := int64(writers * perWriter)
if int64(stat.Count) != wantCount {
Expand Down Expand Up @@ -351,9 +351,8 @@ func TestHistogramStatsCollector_AtomicMinMaxRace(t *testing.T) {
wg.Wait()

stat := c.GetStats()[constants.StatIncr.String()]
if stat == nil {
t.Fatalf("missing stat")
}

assert.NotNil(t, stat, "missing stat")

if stat.Min != 0 {
t.Errorf("Min = %d, want 0", stat.Min)
Expand Down
6 changes: 3 additions & 3 deletions tests/dist_logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"sync"
"testing"

"github.com/stretchr/testify/assert"

"github.com/hyp3rd/hypercache/pkg/backend"
)

Expand Down Expand Up @@ -135,9 +137,7 @@ func TestDistMemory_LoggerEmitsListenerStart(t *testing.T) {
}
}

if startRec == nil {
t.Fatalf("expected `dist HTTP listener started` record; got %d records", len(records))
}
assert.NotNilf(t, startRec, "expected `dist HTTP listener started` record; got %d records", len(records))

if startRec.Level != slog.LevelInfo {
t.Fatalf("expected Info level, got %v", startRec.Level)
Expand Down
7 changes: 4 additions & 3 deletions tests/merkle_single_missing_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/hyp3rd/hypercache/pkg/backend"
cache "github.com/hyp3rd/hypercache/pkg/cache/v2"
)
Expand Down Expand Up @@ -57,9 +59,8 @@ func TestMerkleSingleMissingKey(t *testing.T) {
}

got, _ := db.Get(ctx, "k1")
if got == nil {
t.Fatalf("expected key pulled")
}

assert.NotNil(t, got, "expected key pulled")

if bs, ok := got.Value.([]byte); !ok || string(bs) != "v1" {
t.Fatalf("unexpected value %v", got.Value)
Expand Down
8 changes: 5 additions & 3 deletions tests/merkle_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/hyp3rd/hypercache/pkg/backend"
cache "github.com/hyp3rd/hypercache/pkg/cache/v2"
)
Expand Down Expand Up @@ -42,9 +44,9 @@ func TestMerkleSyncConvergence(t *testing.T) {
itA, _ := dmA.Get(ctx, k)

itB, _ := dmB.Get(ctx, k)
if itA == nil || itB == nil {
t.Fatalf("missing key %s after sync", k)
}

assert.NotNil(t, itA, "missing key %s after sync", k)
assert.NotNil(t, itB, "missing key %s after sync", k)

if itB.Version < itA.Version {
t.Fatalf("expected B version >= A version for %s", k)
Expand Down
Loading