Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1f42b00
fix(benchmarks): re-add redis install for ruedis and valkey
mdelapenya Apr 30, 2025
b90664b
feat: add a test module for testing redis and friends
mdelapenya Apr 30, 2025
76a7b0a
chore: support for overriding the redis image
mdelapenya Apr 30, 2025
05b5be3
chore: consume the testredis module in redis
mdelapenya Apr 30, 2025
5b7af06
chore: consume the testredis module in rueidis
mdelapenya Apr 30, 2025
892e6fe
chore: consume the testredis module in valkey
mdelapenya Apr 30, 2025
7866e27
chore: remove shell script for cert generation
mdelapenya Apr 30, 2025
dd7391a
chore(ci): exclude testhelpers root dir from the filters
mdelapenya Apr 30, 2025
ba60ab9
fix: indentation
mdelapenya Apr 30, 2025
b7893d7
fix: do not run benchmarks for the helpers
mdelapenya Apr 30, 2025
abdb9c7
Merge branch 'main' into fix-ruedis-benchmarks
mdelapenya May 8, 2025
a77e60f
chore: add tests for the helper module
mdelapenya Apr 30, 2025
46267c6
Merge branch 'main' into fix-ruedis-benchmarks
mdelapenya May 15, 2025
b85c022
Merge branch 'main' into fix-ruedis-benchmarks
mdelapenya May 22, 2025
30b2073
chore: verify mtls properly in tests
mdelapenya May 23, 2025
941ef46
chore: add integration tests to the redis helper module
mdelapenya May 23, 2025
5794b50
chore: proper parallel layout
mdelapenya May 23, 2025
1e6e787
fix: missing eval of redis image from env var
mdelapenya May 23, 2025
4d516c3
chore: pass the redis-like image explicitly in tests
mdelapenya May 23, 2025
331a84b
fix: reuse valkey container in benchmarks
mdelapenya May 23, 2025
168125a
chore: refine message
mdelapenya May 23, 2025
ba248c9
chore: align valkey expiration test with redis
mdelapenya May 23, 2025
4c19cba
chore: skip cluster tests
mdelapenya May 23, 2025
288cedb
chore: align ruedis expiration test with redis
mdelapenya May 23, 2025
bf7c309
chore: read redis image for ruedis
mdelapenya May 23, 2025
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
63 changes: 0 additions & 63 deletions .github/scripts/gen-test-certs.sh

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: the helper tests won't be executed because of this. Have you considered moving to go.work so that it's easier to identify the module paths?

echo "filters<<EOF" >> $GITHUB_OUTPUT
echo "$filters" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -111,6 +111,7 @@ jobs:
TEST_REDIS_IMAGE: "docker.io/redis:7"
TEST_SCYLLADB_IMAGE: "scylladb/scylla:6.2"
TEST_SURREALDB_IMAGE: "surrealdb/surrealdb:latest"
TEST_VALKEY_IMAGE: "valkey/valkey:8"
COHERENCE_LOG_LEVEL: "ERROR"

- name: Get Previous Benchmark Results
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ jobs:
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
# Add all testhelpers subdirectories to filters
testhelpers_filters=$(find ./testhelpers -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | awk '{printf "testhelpers/%s: \"testhelpers/%s/**\"\n", $1, $1}')
echo "filters<<EOF" >> $GITHUB_OUTPUT
echo "$filters" >> $GITHUB_OUTPUT
echo "$testhelpers_filters" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
echo "filters<<EOF" >> $GITHUB_OUTPUT
echo "$filters" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Expand Down
28 changes: 6 additions & 22 deletions .github/workflows/test-rueidis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,15 @@ jobs:
strategy:
matrix:
go-version:
- 1.20.x
- 1.21.x
- 1.23.x
- 1.24.x
redis:
- '6.x'
- '7.x'
- '6'
- '7'
steps:
- name: Fetch Repository
uses: actions/checkout@v4

- name: Generate TLS certs
run: ./.github/scripts/gen-test-certs.sh

- name: Setup Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: ${{ matrix.redis }}
auto-start: 'false'
redis-port: '6379'
redis-tls-port: '6380'

- name: Run Redis
run: |
redis-server --tls-port 6380 --port 6379 \
--tls-cert-file /home/runner/work/storage/storage/tls/redis.crt \
--tls-key-file /home/runner/work/storage/storage/tls/redis.key \
--tls-ca-cert-file /home/runner/work/storage/storage/tls/ca.crt &

- name: Setup Redis Cluster
uses: vishnudxb/redis-cluster@1.0.9
with:
Expand All @@ -59,4 +41,6 @@ jobs:
go-version: '${{ matrix.go-version }}'

- name: Run Test
env:
TEST_REDIS_IMAGE: "docker.io/redis:${{ matrix.redis }}"
run: cd ./rueidis && go test ./... -v -race
36 changes: 36 additions & 0 deletions .github/workflows/test-teshelpers-redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
push:
branches:
- master
- main
paths:
- 'testhelpers/redis/**'
pull_request:
paths:
- 'testhelpers/redis/**'
name: "Tests TestHelper Redis"
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.23.x
- 1.24.x
redis:
- '6'
- '7'
steps:
- name: Fetch Repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'

- name: Run Test
env:
TEST_REDIS_IMAGE: "docker.io/redis:${{ matrix.redis }}"
working-directory: testhelpers/redis
run: go test ./... -v -race
26 changes: 5 additions & 21 deletions .github/workflows/test-valkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,14 @@ jobs:
matrix:
go-version:
- 1.23.x
- 1.24.x
valkey:
- '7.x'
- '8.x'
- '7'
- '8'
steps:
- name: Fetch Repository
uses: actions/checkout@v4

- name: Generate TLS certs
run: ./.github/scripts/gen-test-certs.sh

- name: Setup Valkey
uses: shogo82148/actions-setup-redis@v1
with:
distribution: 'valkey'
redis-version: ${{ matrix.valkey }}
auto-start: 'false'
redis-port: '6379'
redis-tls-port: '6380'

- name: Run Valkey
run: |
valkey-server --tls-port 6380 --port 6379 \
--tls-cert-file /home/runner/work/storage/storage/tls/valkey.crt \
--tls-key-file /home/runner/work/storage/storage/tls/valkey.key \
--tls-ca-cert-file /home/runner/work/storage/storage/tls/ca.crt &

- name: Setup Valkey Cluster
uses: vishnudxb/redis-cluster@1.0.9
with:
Expand All @@ -60,4 +42,6 @@ jobs:
go-version: '${{ matrix.go-version }}'

- name: Run Test
env:
TEST_VALKEY_IMAGE: "valkey/valkey:${{ matrix.valkey }}"
run: cd ./valkey && go test ./... -v -race
8 changes: 6 additions & 2 deletions redis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ module github.com/gofiber/storage/redis/v3
go 1.23.0

require (
github.com/gofiber/storage/testhelpers/redis v0.0.0-00010101000000-000000000000
github.com/redis/go-redis/v9 v9.8.0
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.37.0
github.com/testcontainers/testcontainers-go/modules/redis v0.37.0
)

replace github.com/gofiber/storage/testhelpers/redis => ../testhelpers/redis

require (
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
Expand Down Expand Up @@ -49,6 +50,8 @@ require (
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/testcontainers/testcontainers-go v0.37.0 // indirect
github.com/testcontainers/testcontainers-go/modules/redis v0.37.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
Expand All @@ -62,6 +65,7 @@ require (
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/sys v0.32.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions redis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
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/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
Expand Down Expand Up @@ -180,12 +180,12 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d h1:H8tOf8XM88HvKqLTxe755haY6r1fqqzLbEnfrmLXlSA=
google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d/go.mod h1:2v7Z7gP2ZUOGsaFyxATQSRoBnKygqVq2Cwnvom7QiqY=
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950=
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e h1:ztQaXfzEXTmCBvbtWYRhJxW+0iJcz2qXfd38/e9l7bA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU=
google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
Loading