Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test against Redis CE #3191

Merged
merged 10 commits into from
Dec 16, 2024
45 changes: 44 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,47 @@ jobs:
uses: codecov/codecov-action@v5
with:
files: coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}

test-redis-ce:
name: test-redis-ce
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
redis_version:
- "8.0-M01"
- "7.4.1"
- "7.2.6"
- "6.2.16"
go-version:
- "1.19.x"
- "1.20.x"
- "1.21.x"

steps:
- name: Set up ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v4

# Set up Docker Compose environment
- name: Set up Docker Compose environment
run: |
ggivo marked this conversation as resolved.
Show resolved Hide resolved
docker compose --profile all up -d --build

- name: Run tests
env:
ggivo marked this conversation as resolved.
Show resolved Hide resolved
USE_PREBUILT_REDIS: "true"
RE_CLUSTER: "true"
run: |
go test \
--ginkgo.skip-file="ring_test.go" \
--ginkgo.skip-file="sentinel_test.go" \
--ginkgo.skip-file="osscluster_test.go" \
--ginkgo.skip-file="pubsub_test.go" \
--ginkgo.skip-file="gears_commands_test.go" \
--ginkgo.label-filter='!NonRedisEnterprise'
1 change: 1 addition & 0 deletions .github/workflows/test-redis-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- name: Test
env:
RE_CLUSTER: "1"
USE_PREBUILT_REDIS: "1"
run: |
go test \
--ginkgo.skip-file="ring_test.go" \
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---

services:

redis:
ggivo marked this conversation as resolved.
Show resolved Hide resolved
image: redislabs/client-libs-test:8.0-M02
container_name: redis-standalone
environment:
- REDIS_CLUSTER=no
- PORT=6379
- TLS_PORT=6666
command: --loadmodule /usr/local/lib/redis/modules/redisbloom.so --loadmodule /usr/local/lib/redis/modules/redisearch.so --loadmodule /usr/local/lib/redis/modules/redistimeseries.so --loadmodule /usr/local/lib/redis/modules/rejson.so
ports:
- 6379:6379
- 6380:6379
ggivo marked this conversation as resolved.
Show resolved Hide resolved
- 6666:6666 # TLS port
volumes:
- "./dockers/standalone:/redis/work"
ggivo marked this conversation as resolved.
Show resolved Hide resolved
profiles:
- standalone
- all
6 changes: 4 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var cluster = &clusterScenario{
}

var RECluster = false
var USE_PREBUILT_REDIS = false

func registerProcess(port string, p *redisProcess) {
if processes == nil {
Expand All @@ -82,8 +83,9 @@ var _ = BeforeSuite(func() {
}
var err error
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))

if !RECluster {
USE_PREBUILT_REDIS, _ = strconv.ParseBool(os.Getenv("USE_PREBUILT_REDIS"))
// panic("RECluster: " + strconv.FormatBool(RECluster) + " USE_PREBUILT_REDIS: " + strconv.FormatBool(USE_PREBUILT_REDIS))
ggivo marked this conversation as resolved.
Show resolved Hide resolved
if !RECluster || !USE_PREBUILT_REDIS {

redisMain, err = startRedis(redisPort)
Expect(err).NotTo(HaveOccurred())
Expand Down
Loading