Skip to content

Commit 529479a

Browse files
authored
test: add integration tests using Testcontainers for Redis (#32)
* test: add integration tests using Testcontainers for Redis - Update Go version from 1.20 to 1.22 - Add `github.com/testcontainers/testcontainers-go` dependency - Add multiple indirect dependencies including `dario.cat/mergo`, `github.com/Azure/go-ansiterm`, `github.com/Microsoft/go-winio`, and others - Add `require` and `testcontainers` packages to `redis_test.go` - Add a new test `TestWithRedis` to `redis_test.go` using `testcontainers` to set up a Redis container for testing Signed-off-by: appleboy <[email protected]> * ci: update GitHub Actions and API usage for improved compatibility - Remove support for Go versions 1.20 and 1.21 in the GitHub Actions workflow Signed-off-by: appleboy <[email protected]> --------- Signed-off-by: appleboy <[email protected]>
1 parent daddcc3 commit 529479a

File tree

4 files changed

+249
-4
lines changed

4 files changed

+249
-4
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest]
25-
go: ["1.20", 1.21, 1.22, 1.23]
25+
go: [1.22, 1.23]
2626
include:
2727
- os: ubuntu-latest
2828
go-build: ~/.cache/go-build

go.mod

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

3-
go 1.20
3+
go 1.22
44

55
require (
66
github.com/golang-queue/queue v0.1.4-0.20221210024521-cb8720b0c721
77
github.com/redis/go-redis/v9 v9.7.0
88
github.com/stretchr/testify v1.10.0
9+
github.com/testcontainers/testcontainers-go v0.35.0
910
go.uber.org/goleak v1.3.0
1011
)
1112

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

0 commit comments

Comments
 (0)