Skip to content

Commit

Permalink
refactor(services/redis): migrate to test planner for kvrocks,dragonf…
Browse files Browse the repository at this point in the history
…ly (#3369)

refactor(services/redis): migrate to test planner for kvrocks & dragonfly

Signed-off-by: suyanhanx <[email protected]>
  • Loading branch information
suyanhanx authored Oct 24, 2023
1 parent 5fba6a6 commit 6e5197a
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 46 deletions.
35 changes: 35 additions & 0 deletions .github/services/redis/dragonfly/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: dragonfly
description: 'Behavior test for dragonfly'

runs:
using: "composite"
steps:
- name: Setup Dragonfly Server
shell: bash
working-directory: fixtures/redis
run: docker-compose -f docker-compose-dragonfly.yml up -d
- name: Setup
shell: bash
run: |
cat << EOF >> $GITHUB_ENV
OPENDAL_REDIS_ENDPOINT=tcp://127.0.0.1:6379
OPENDAL_REDIS_ROOT=/
OPENDAL_REDIS_DB=0
EOF
35 changes: 35 additions & 0 deletions .github/services/redis/kvrocks/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: kvrocks
description: 'Behavior test for kvrocks'

runs:
using: "composite"
steps:
- name: Setup Kvrocks Server
shell: bash
working-directory: fixtures/redis
run: docker-compose -f docker-compose-kvrocks.yml up -d
- name: Setup
shell: bash
run: |
cat << EOF >> $GITHUB_ENV
OPENDAL_REDIS_ENDPOINT=tcp://127.0.0.1:6379
OPENDAL_REDIS_ROOT=/
OPENDAL_REDIS_DB=0
EOF
46 changes: 0 additions & 46 deletions .github/workflows/service_test_redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,49 +101,3 @@ jobs:
OPENDAL_REDIS_PASSWORD: opendal
OPENDAL_REDIS_ROOT: /test/opendal
OPENDAL_REDIS_DB: 0

dragonfly:
runs-on: ubuntu-latest
services:
redis:
image: docker.dragonflydb.io/dragonflydb/dragonfly
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run behavior --features services-redis
env:
OPENDAL_TEST: redis
OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379
OPENDAL_REDIS_ROOT: /
OPENDAL_REDIS_DB: 0

kvrocks:
runs-on: ubuntu-latest
services:
redis:
image: apache/kvrocks:2.5.1
ports:
- 6379:6666
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run behavior --features services-redis
env:
OPENDAL_TEST: redis
OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379
OPENDAL_REDIS_ROOT: /
OPENDAL_REDIS_DB: 0
24 changes: 24 additions & 0 deletions fixtures/redis/docker-compose-dragonfly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3.8'

services:
redis:
image: docker.dragonflydb.io/dragonflydb/dragonfly
ports:
- '6379:6379'
24 changes: 24 additions & 0 deletions fixtures/redis/docker-compose-kvrocks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3.8'

services:
redis:
image: apache/kvrocks:2.5.1
ports:
- '6379:6666'

0 comments on commit 6e5197a

Please sign in to comment.