Add docker compose file

This commit is contained in:
ofekshenawa 2024-12-15 17:45:37 +02:00
parent 1dcda5e6a6
commit e4f26476a8
3 changed files with 12 additions and 7 deletions

View File

@ -72,13 +72,17 @@ jobs:
# Set up Docker Compose environment # Set up Docker Compose environment
- name: Set up Docker Compose environment - name: Set up Docker Compose environment
run: | run: |
docker compose -f src/test/resources/env/docker-compose.yml up -d docker compose --profile all up -d --build
- name: Run tests - name: Run tests
env:
USE_PREBUILT_REDIS: "true"
RE_CLUSTER: "true"
run: | run: |
go test \ go test \
--ginkgo.skip-file="ring_test.go" \ --ginkgo.skip-file="ring_test.go" \
--ginkgo.skip-file="sentinel_test.go" \ --ginkgo.skip-file="sentinel_test.go" \
--ginkgo.skip-file="osscluster_test.go" \ --ginkgo.skip-file="osscluster_test.go" \
--ginkgo.skip-file="pubsub_test.go" \ --ginkgo.skip-file="pubsub_test.go" \
--ginkgo.skip-file="gears_commands_test.go" \ --ginkgo.skip-file="gears_commands_test.go" \
--ginkgo.label-filter='!NonRedisEnterprise'

View File

@ -3,14 +3,13 @@
services: services:
redis: 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 container_name: redis-standalone
environment: environment:
- TLS_ENABLED=yes
- REDIS_CLUSTER=no - REDIS_CLUSTER=no
- PORT=6379 - PORT=6379
- TLS_PORT=6666 - 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: ports:
- 6379:6379 - 6379:6379
- 6380:6379 - 6380:6379

View File

@ -66,6 +66,7 @@ var cluster = &clusterScenario{
} }
var RECluster = false var RECluster = false
var USE_PREBUILT_REDIS = false
func registerProcess(port string, p *redisProcess) { func registerProcess(port string, p *redisProcess) {
if processes == nil { if processes == nil {
@ -82,8 +83,9 @@ var _ = BeforeSuite(func() {
} }
var err error var err error
RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER")) RECluster, _ = strconv.ParseBool(os.Getenv("RE_CLUSTER"))
USE_PREBUILT_REDIS, _ = strconv.ParseBool(os.Getenv("USE_PREBUILT_REDIS"))
if !RECluster { // panic("RECluster: " + strconv.FormatBool(RECluster) + " USE_PREBUILT_REDIS: " + strconv.FormatBool(USE_PREBUILT_REDIS))
if !RECluster || !USE_PREBUILT_REDIS {
redisMain, err = startRedis(redisPort) redisMain, err = startRedis(redisPort)
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())