Skip to content

Commit 898b07c

Browse files
authored
ci: update Go version and improve Redis test setup (#24)
* ci: update Go version and improve Redis test setup - Remove Go 1.21 from the GitHub Actions workflow - Remove environment variables and Redis setup steps from GitHub Actions workflow - Update Go version to 1.22 in go.mod - Add testcontainers-go and other dependencies to go.mod - Add setup functions for Redis and Redis Cluster containers in tests - Replace hardcoded Redis host with dynamic endpoint in tests - Enable and update the TestRedisCluster test - Add context and container cleanup to various tests Signed-off-by: appleboy <[email protected]> * refactor: improve test reliability and API usage in RedisCluster tests - Replace `t.Helper()` with `t.Skip()` in `TestRedisCluster` function Signed-off-by: appleboy <[email protected]> --------- Signed-off-by: appleboy <[email protected]>
1 parent 2f62c01 commit 898b07c

File tree

4 files changed

+334
-33
lines changed

4 files changed

+334
-33
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,14 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest]
25-
go: [1.21, 1.22, 1.23]
25+
go: [1.22, 1.23]
2626
include:
2727
- os: ubuntu-latest
2828
go-build: ~/.cache/go-build
2929
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
3030
runs-on: ${{ matrix.os }}
31-
env:
32-
GO111MODULE: on
33-
GOPROXY: https://proxy.golang.org
3431

3532
steps:
36-
- name: Start Redis
37-
uses: supercharge/[email protected]
38-
with:
39-
redis-version: 6
40-
41-
# Running Test
42-
- name: Running Test
43-
run: |
44-
sudo apt-get install -y redis-tools
45-
docker ps -a
46-
redis-cli -h 127.0.0.1 -p 6379 ping
47-
redis-cli -h 127.0.0.1 -p 6379 cluster nodes
48-
4933
- name: Set up Go ${{ matrix.go }}
5034
uses: actions/setup-go@v5
5135
with:

go.mod

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,64 @@
11
module github.com/golang-queue/redisdb-stream
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
github.com/appleboy/com v0.2.1
77
github.com/golang-queue/queue v0.1.4-0.20221230133718-0314ef173f98
88
github.com/redis/go-redis/v9 v9.7.0
99
github.com/stretchr/testify v1.10.0
10+
github.com/testcontainers/testcontainers-go v0.35.0
1011
go.uber.org/goleak v1.3.0
1112
)
1213

1314
require (
15+
dario.cat/mergo v1.0.0 // indirect
16+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
17+
github.com/Microsoft/go-winio v0.6.2 // indirect
18+
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
1419
github.com/cespare/xxhash/v2 v2.2.0 // indirect
20+
github.com/containerd/containerd v1.7.18 // indirect
21+
github.com/containerd/log v0.1.0 // indirect
22+
github.com/containerd/platforms v0.2.1 // indirect
23+
github.com/cpuguy83/dockercfg v0.3.2 // indirect
1524
github.com/davecgh/go-spew v1.1.1 // indirect
1625
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
26+
github.com/distribution/reference v0.6.0 // indirect
27+
github.com/docker/docker v27.1.1+incompatible // indirect
28+
github.com/docker/go-connections v0.5.0 // indirect
29+
github.com/docker/go-units v0.5.0 // indirect
30+
github.com/felixge/httpsnoop v1.0.4 // indirect
31+
github.com/go-logr/logr v1.4.1 // indirect
32+
github.com/go-logr/stdr v1.2.2 // indirect
33+
github.com/go-ole/go-ole v1.2.6 // indirect
1734
github.com/goccy/go-json v0.10.0 // indirect
35+
github.com/gogo/protobuf v1.3.2 // indirect
36+
github.com/google/uuid v1.6.0 // indirect
37+
github.com/klauspost/compress v1.17.4 // indirect
38+
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
39+
github.com/magiconair/properties v1.8.7 // indirect
40+
github.com/moby/docker-image-spec v1.3.1 // indirect
41+
github.com/moby/patternmatcher v0.6.0 // indirect
42+
github.com/moby/sys/sequential v0.5.0 // indirect
43+
github.com/moby/sys/user v0.1.0 // indirect
44+
github.com/moby/term v0.5.0 // indirect
45+
github.com/morikuni/aec v1.0.0 // indirect
46+
github.com/opencontainers/go-digest v1.0.0 // indirect
47+
github.com/opencontainers/image-spec v1.1.0 // indirect
48+
github.com/pkg/errors v0.9.1 // indirect
1849
github.com/pmezard/go-difflib v1.0.0 // indirect
50+
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
51+
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
52+
github.com/shoenig/go-m1cpu v0.1.6 // indirect
53+
github.com/sirupsen/logrus v1.9.3 // indirect
54+
github.com/tklauser/go-sysconf v0.3.12 // indirect
55+
github.com/tklauser/numcpus v0.6.1 // indirect
56+
github.com/yusufpapurcu/wmi v1.2.3 // indirect
57+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
58+
go.opentelemetry.io/otel v1.24.0 // indirect
59+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
60+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
61+
golang.org/x/crypto v0.31.0 // indirect
62+
golang.org/x/sys v0.28.0 // indirect
1963
gopkg.in/yaml.v3 v3.0.1 // indirect
2064
)

0 commit comments

Comments
 (0)