From e4f26476a8b707332225c6a1f6f8d74f400ab8c4 Mon Sep 17 00:00:00 2001 From: ofekshenawa Date: Sun, 15 Dec 2024 17:45:37 +0200 Subject: [PATCH] Add docker compose file --- .github/workflows/build.yml | 8 ++++++-- .github/docker-compose.yml => docker-compose.yml | 5 ++--- main_test.go | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) rename .github/docker-compose.yml => docker-compose.yml (56%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc80fc3b..59244058 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,13 +72,17 @@ jobs: # Set up Docker Compose environment - name: Set up Docker Compose environment run: | - docker compose -f src/test/resources/env/docker-compose.yml up -d + docker compose --profile all up -d --build - name: Run tests + env: + 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" \ \ No newline at end of file + --ginkgo.skip-file="gears_commands_test.go" \ + --ginkgo.label-filter='!NonRedisEnterprise' \ No newline at end of file diff --git a/.github/docker-compose.yml b/docker-compose.yml similarity index 56% rename from .github/docker-compose.yml rename to docker-compose.yml index 4bc5949b..fc6775d9 100644 --- a/.github/docker-compose.yml +++ b/docker-compose.yml @@ -3,14 +3,13 @@ services: redis: - image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.0-M01} + image: redislabs/client-libs-test:8.0-M01 container_name: redis-standalone environment: - - TLS_ENABLED=yes - REDIS_CLUSTER=no - PORT=6379 - TLS_PORT=6666 - command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""} + command: --enable-module-command yes ports: - 6379:6379 - 6380:6379 diff --git a/main_test.go b/main_test.go index 19e94444..38c6173e 100644 --- a/main_test.go +++ b/main_test.go @@ -66,6 +66,7 @@ var cluster = &clusterScenario{ } var RECluster = false +var USE_PREBUILT_REDIS = false func registerProcess(port string, p *redisProcess) { if processes == nil { @@ -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)) + if !RECluster || !USE_PREBUILT_REDIS { redisMain, err = startRedis(redisPort) Expect(err).NotTo(HaveOccurred())