This repository was archived by the owner on Jun 4, 2025. It is now read-only.
forked from limitd/limitdb
-
Notifications
You must be signed in to change notification settings - Fork 12
added tests with Valkey #90
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: Test Valkey | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| valkey-standalone: | ||
| env: | ||
| CI: true | ||
| timeout-minutes: 10 | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Setup Standalone Tests | ||
| run: make test-standalone-valkey-setup | ||
|
|
||
| - name: Run Standalone tests | ||
| run: make test-standalone-run | ||
|
|
||
| - name: Teardown Standalone Tests | ||
| run: make test-standalone-valkey-teardown | ||
|
|
||
| valkey-cluster: | ||
| env: | ||
| CI: true | ||
| timeout-minutes: 10 | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x] | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - name: install redis-cli | ||
| run: sudo apt-get install redis-tools | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Setup Clustered Tests | ||
| run: make test-cluster-valkey-setup | ||
|
|
||
| - name: Check valkey Cluster | ||
| run: timeout 60 bash <<< "until redis-cli -c -p 16371 cluster info | grep 'cluster_state:ok'; do sleep 1; done" | ||
|
|
||
| - name: Run Clustered tests | ||
| run: make test-cluster-run | ||
|
|
||
| - name: Teardown Clustered Tests | ||
| run: make test-cluster-valkey-teardown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,51 @@ | ||
| export CLUSTER_NO_TLS_VALIDATION=true | ||
| .ONESHELL: | ||
|
|
||
| test-standalone-setup: | ||
| docker compose up -d | ||
| VALKEY_DOCKER_IMAGE=bitnami/valkey:8.0.2-debian-12-r5 | ||
| REDIS_DOCKER_IMAGE=redis:6 | ||
|
|
||
| test-standalone-teardown: | ||
| docker compose down | ||
| test: test-redis test-valkey | ||
| @echo "All tests executed" | ||
|
|
||
| test-cluster-setup: | ||
| docker compose -f docker-compose-cluster.yml up -d | ||
| test-%: test-setup-% test-standalone-run test-cluster-run test-teardown-% | ||
| @echo "Test executed" | ||
|
|
||
| test-cluster-teardown: | ||
| docker compose -f docker-compose-cluster.yml down | ||
| test-setup-%: test-standalone-%-setup test-cluster-%-setup | ||
| @echo "Test setup executed" | ||
|
|
||
| test-cluster: | ||
| test-teardown-%: test-standalone-%-teardown test-cluster-%-teardown | ||
| @echo "Test teardown executed" | ||
|
|
||
| test-standalone-redis-setup: | ||
| REDIS_IMAGE=${REDIS_DOCKER_IMAGE} docker compose up -d | ||
|
|
||
| test-standalone-valkey-setup: | ||
| REDIS_IMAGE=${VALKEY_DOCKER_IMAGE} docker compose up -d | ||
|
|
||
| test-standalone-redis-teardown: | ||
| REDIS_IMAGE=${REDIS_DOCKER_IMAGE} docker compose down | ||
|
|
||
| test-standalone-valkey-teardown: | ||
| REDIS_IMAGE=${VALKEY_DOCKER_IMAGE} docker compose down | ||
|
|
||
| test-cluster-redis-setup: | ||
| REDIS_IMAGE=${REDIS_DOCKER_IMAGE} docker compose -f docker-compose-cluster.yml up -d | ||
|
|
||
| test-cluster-valkey-setup: | ||
| REDIS_IMAGE=${VALKEY_DOCKER_IMAGE} docker compose -f docker-compose-cluster.yml up -d | ||
|
|
||
| test-cluster-redis-teardown: | ||
| REDIS_IMAGE=${REDIS_DOCKER_IMAGE} docker compose -f docker-compose-cluster.yml down | ||
|
|
||
| test-cluster-valkey-teardown: | ||
| REDIS_IMAGE=${VALKEY_DOCKER_IMAGE} docker compose -f docker-compose-cluster.yml down | ||
|
|
||
| test-cluster-run: | ||
| npm run test-cluster | ||
| test-standalone: | ||
|
|
||
| test-standalone-run: | ||
| npm run test-standalone | ||
|
|
||
| test: test-standalone test-cluster | ||
| test-setup: test-standalone-setup test-cluster-setup | ||
| test-teardown: test-standalone-teardown test-cluster-teardown | ||
| test-teardown-all: test-standalone-redis-teardown test-cluster-redis-teardown test-standalone-valkey-teardown test-cluster-valkey-teardown | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,59 @@ | ||
| services: | ||
| redis-1: | ||
| image: 'redis:6' | ||
| image: ${REDIS_IMAGE} | ||
| healthcheck: | ||
| interval: "1s" | ||
| test: [ "CMD", "redis-cli", "-p", "16371", "ping", "|", "grep", "PONG" ] | ||
| test: ["CMD", "redis-cli", "-p", "16371", "ping", "|", "grep", "PONG"] | ||
| command: ["redis-server", "/etc/redis/redis.conf"] | ||
| user: root | ||
| environment: | ||
| - ALLOW_EMPTY_PASSWORD=yes | ||
| volumes: | ||
| - ${PWD}/test-resources/redis-cluster/node-1/conf/redis.conf:/etc/redis/redis.conf | ||
| network_mode: host | ||
| redis-2: | ||
| image: 'redis:6' | ||
| image: ${REDIS_IMAGE} | ||
| healthcheck: | ||
| interval: "1s" | ||
| test: [ "CMD", "redis-cli", "-p", "16372", "ping", "|", "grep", "PONG" ] | ||
| command: [ "redis-server", "/etc/redis/redis.conf" ] | ||
| test: ["CMD", "redis-cli", "-p", "16372", "ping", "|", "grep", "PONG"] | ||
| command: ["redis-server", "/etc/redis/redis.conf"] | ||
| user: root | ||
| environment: | ||
| - ALLOW_EMPTY_PASSWORD=yes | ||
| volumes: | ||
| - ${PWD}/test-resources/redis-cluster/node-2/conf/redis.conf:/etc/redis/redis.conf | ||
| network_mode: host | ||
| redis-3: | ||
| image: 'redis:6' | ||
| image: ${REDIS_IMAGE} | ||
| healthcheck: | ||
| interval: "1s" | ||
| test: [ "CMD", "redis-cli", "-p", "16373", "ping", "|", "grep", "PONG" ] | ||
| command: [ "redis-server", "/etc/redis/redis.conf" ] | ||
| test: ["CMD", "redis-cli", "-p", "16373", "ping", "|", "grep", "PONG"] | ||
| command: ["redis-server", "/etc/redis/redis.conf"] | ||
| user: root | ||
| environment: | ||
| - ALLOW_EMPTY_PASSWORD=yes | ||
| volumes: | ||
| - ${PWD}/test-resources/redis-cluster/node-3/conf/redis.conf:/etc/redis/redis.conf | ||
| network_mode: host | ||
| redis-cluster-create: | ||
| image: 'redis:6' | ||
| command: '/usr/local/etc/redis/redis-cluster-create.sh' | ||
| image: ${REDIS_IMAGE} | ||
| command: "/usr/local/etc/redis/redis-cluster-create.sh" | ||
| depends_on: | ||
| redis-1: | ||
| condition: service_healthy | ||
| redis-2: | ||
| condition: service_healthy | ||
| redis-3: | ||
| condition: service_healthy | ||
| user: root | ||
| environment: | ||
| - ALLOW_EMPTY_PASSWORD=yes | ||
| volumes: | ||
| - ${PWD}/test-resources/redis-cluster/redis-cluster-create.sh:/usr/local/etc/redis/redis-cluster-create.sh | ||
| network_mode: host | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "redis-cli -p 16371 -c cluster info | grep cluster_state:ok"] | ||
| test: | ||
| [ | ||
| "CMD-SHELL", | ||
| "redis-cli -p 16371 -c cluster info | grep cluster_state:ok", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| services: | ||
| redis: | ||
| image: 'redis:6' | ||
| command: --save "" --appendonly no | ||
| image: ${REDIS_IMAGE} | ||
| environment: | ||
| - ALLOW_EMPTY_PASSWORD=yes | ||
| ports: | ||
| - "6379:6379" | ||
| toxiproxy: | ||
| image: 'shopify/toxiproxy' | ||
| image: "shopify/toxiproxy" | ||
| ports: | ||
| - "8474:8474" | ||
| - "22222:22222" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.