Skip to content

Commit

Permalink
Testing against Redis Enterprise in CI (#229)
Browse files Browse the repository at this point in the history
* NRedisStack Enterprise Test

* enters

* try to change the image

* update the image as it was before

* add --environment="NUM_REDIS_CLUSTER_NODES=6" to dotnet test

* change to 127

* skip if enterprise - start

* change IS_REDIS_ENTERPRISE: 'true' location

* skip gears in enterprise

* skip tests with ft.config

* dont send REDISGEARS_2.REFRESHCLUSTER if enterprise

* skip unknown command test

* chayim

* add oss-cluetr as another job

* try add standalone host+port at the start of endpoints

* fix dotnet test and change the nodes to 3

* start skipping

* try chayim changes

* cahange 100.0.1-64402 to 7.2.4-92 + skip + return to previus env names

* skips

* print the info

* skip setinfo in enterprise

* change verbosity to detailed

* dotnet format

* use .env file

* checkout

* chanfe : to =

* change to chayims method

* add IS_ENTERPRISE=true

* use matrix to run both tests

* add ' '

* use xom9ikk/dotenv@v2 in reusable

* fix path

* delete IMAGE from .env

* add OSS_CLUSTER to the .env's

* skip if oss cluster

* skip oss cluster

* update var names

* fix integrations

* change to .net 8

* add lcov to gitignor

* Skip tests if enterprise

* skip TestBLMPop if enterprise

* skip all blocking commands if enterprise
  • Loading branch information
shacharPash authored Feb 25, 2024
1 parent db17b89 commit 2ec5430
Show file tree
Hide file tree
Showing 34 changed files with 331 additions and 239 deletions.
62 changes: 55 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,62 @@ concurrency:
cancel-in-progress: true

jobs:
enterprise-tests:
name: Redis Enterprise
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
enterprise_version: ['7.2.4-92']
env_file_mode: ['enterprise', 'enterprise_oss_cluster']

steps:
- uses: actions/checkout@v4

- name: Load dotnenv for CI
uses: xom9ikk/dotenv@v2
with:
path: .github/workflows/modes
mode: ${{ matrix.env_file_mode }}

- name: Clone ee docker code
uses: actions/checkout@v4
with:
repository: redislabs/redis-ee-docker
path: redis-ee-docker


- name: Start docker
working-directory: redis-ee-docker
env:
IMAGE: redislabs/redis-internal:${{ matrix.enterprise_version }}
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: ./build.sh

- name: .NET Core 8
uses: actions/setup-dotnet@v2

with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true

- name: Test
run: dotnet test -f net8.0 --no-build --verbosity detailed

dotnet_6_cluster:
name: .NET 6 on [redis-stack cluster]
uses: ./.github/workflows/reusable.yml
with:
redis_stack_type: cluster
clr_version: net6.0
mode: oss_cluster
dotnet_sdk_version: 6.0.0
dotenv_file: .github/cluster.env
secrets: inherit

dotnet_6:
Expand All @@ -37,8 +85,8 @@ jobs:
with:
redis_stack_type: ${{matrix.redis-stack-type}}
clr_version: net6.0
mode: standalone
dotnet_sdk_version: 6.0.0
dotenv_file: .github/standalone.env
secrets: inherit

dotnet_7_cluster:
Expand All @@ -47,8 +95,8 @@ jobs:
with:
redis_stack_type: cluster
clr_version: net7.0
mode: oss_cluster
dotnet_sdk_version: 7.0.0
dotenv_file: .github/cluster.env
secrets: inherit

dotnet_7:
Expand All @@ -62,8 +110,8 @@ jobs:
with:
redis_stack_type: ${{matrix.redis-stack-type}}
clr_version: net7.0
mode: standalone
dotnet_sdk_version: 7.0.0
dotenv_file: .github/standalone.env
secrets: inherit

dotnet_8_cluster:
Expand All @@ -72,8 +120,8 @@ jobs:
with:
redis_stack_type: cluster
clr_version: net8.0
mode: oss_cluster
dotnet_sdk_version: 8.0.0
dotenv_file: .github/cluster.env
secrets: inherit

dotnet_8:
Expand All @@ -87,8 +135,8 @@ jobs:
with:
redis_stack_type: ${{matrix.redis-stack-type}}
clr_version: net8.0
mode: standalone
dotnet_sdk_version: 8.0.0
dotenv_file: .github/standalone.env
secrets: inherit

build_and_test_windows:
Expand Down Expand Up @@ -130,4 +178,4 @@ jobs:
shell: cmd
run: |
START wsl ./redis-stack-server-${{env.redis_stack_version}}/bin/redis-stack-server &
dotnet test -f net481 --no-build --verbosity normal
dotnet test -f net481 --no-build --verbosity detailed
7 changes: 7 additions & 0 deletions .github/workflows/modes/.env.enterprise
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REDIS=127.0.0.1:6379
IS_ENTERPRISE=true
RE_USERNAME=test@test.com
RE_PASS=12345
RE_CLUSTER_NAME=test
RE_USE_OSS_CLUSTER=false
RE_DB_PORT=6379
8 changes: 8 additions & 0 deletions .github/workflows/modes/.env.enterprise_oss_cluster
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REDIS_CLUSTER=127.0.0.1:6372
NUM_REDIS_CLUSTER_NODES=3
IS_ENTERPRISE=true
RE_USERNAME=test@test.com
RE_PASS=12345
RE_CLUSTER_NAME=test
RE_USE_OSS_CLUSTER=true
RE_DB_PORT=6378
File renamed without changes.
File renamed without changes.
11 changes: 6 additions & 5 deletions .github/workflows/reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
required: true
type: string

dotenv_file:
mode:
required: true
type: string
jobs:
Expand All @@ -39,14 +39,15 @@ jobs:
with:
dotnet-version: 8

- name: run redis-stack-server docker
- name: Run redis-stack-server docker
working-directory: .github
run: docker-compose up -d redis-stack-${{inputs.redis_stack_type}}

- name: set variables in dotenv
uses: c-py/action-dotenv-to-setenv@v2
- name: Set .env variables
uses: xom9ikk/dotenv@v2
with:
env-file: ${{inputs.dotenv_file}}
path: .github/workflows/modes
mode: ${{ inputs.mode }}

# Make sure only the desired dotnet version is set both as target and as active SDK.
- name: Tweak target frameworks
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,4 @@ tests/NRedisStack.Tests/redis_credentials/redis_user.crt

# global.json
global.json
tests/NRedisStack.Tests/lcov.net8.0.info
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ dotnet test --environment="REDIS=<redisServer:port>"
```
e.g:
```bash
dotnet test --environment="REDIS=172.17.0.1:6379"
dotnet test --environment="REDIS=127.17.0.1:6379"
```

To run your tests against an oss cluster:
Expand Down
Loading

0 comments on commit 2ec5430

Please sign in to comment.