This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 76fa7eb2c ci(services/redb): migrate to test planner (#3518)
76fa7eb2c is described below

commit 76fa7eb2ce2f6e62872b5f7e75dac3c810434277
Author: Suyan <[email protected]>
AuthorDate: Thu Nov 9 17:38:14 2023 +0800

    ci(services/redb): migrate to test planner (#3518)
    
    test(services/redb): migrate to test planner
    
    Signed-off-by: suyanhanx <[email protected]>
---
 .github/services/libsql/libsql-auth/action.yml     | 52 +++++++++----------
 .github/services/libsql/libsql/action.yml          | 48 ++++++++---------
 .../services/redb/redb/action.yml                  | 31 +++++++----
 .github/workflows/service_test_redb.yml            | 60 ----------------------
 fixtures/swift/docker-compose-swift.yml            |  2 +-
 5 files changed, 71 insertions(+), 122 deletions(-)

diff --git a/.github/services/libsql/libsql-auth/action.yml 
b/.github/services/libsql/libsql-auth/action.yml
index ac0bb2010..079cc99eb 100644
--- a/.github/services/libsql/libsql-auth/action.yml
+++ b/.github/services/libsql/libsql-auth/action.yml
@@ -19,8 +19,8 @@ name: libsql-auth
 description: 'Behavior test for libsql auth'
 
 runs:
-    using: "composite"
-    steps:
+  using: "composite"
+  steps:
     - name: Setup libsql
       shell: bash
       working-directory: fixtures/libsql
@@ -29,30 +29,30 @@ runs:
       shell: bash
       working-directory: core
       run: |
-          curl --location '127.0.0.1:8080/v2/pipeline' \
-          --header 'Content-Type: application/json' \
-          --header 'Authorization: Bearer 
eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjc5ODg0ODM4Mjd9.MatB2aLnPFusagqH2RMoVExP37o2GFLmaJbmd52OdLtAehRNeqeJZPrefP1t2GBFidApUTLlaBRL6poKq_s3CQ'
 \
-          --data '{
-              "baton": null,
-              "requests": [
-                  {
-                      "type": "execute",
-                      "stmt": {
-                          "sql": "CREATE TABLE IF NOT EXISTS `data` (`key` 
TEXT PRIMARY KEY NOT NULL CHECK(length(key) <= 255),`data` BLOB);",
-                          "args": [],
-                          "want_rows": true
-                      }
-                  }
-              ]
-          }'
+        curl --location '127.0.0.1:8080/v2/pipeline' \
+        --header 'Content-Type: application/json' \
+        --header 'Authorization: Bearer 
eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjc5ODg0ODM4Mjd9.MatB2aLnPFusagqH2RMoVExP37o2GFLmaJbmd52OdLtAehRNeqeJZPrefP1t2GBFidApUTLlaBRL6poKq_s3CQ'
 \
+        --data '{
+            "baton": null,
+            "requests": [
+                {
+                    "type": "execute",
+                    "stmt": {
+                        "sql": "CREATE TABLE IF NOT EXISTS `data` (`key` TEXT 
PRIMARY KEY NOT NULL CHECK(length(key) <= 255),`data` BLOB);",
+                        "args": [],
+                        "want_rows": true
+                    }
+                }
+            ]
+        }'
     - name: Setup
       shell: bash
       run: |
-          cat << EOF >> $GITHUB_ENV
-          RUST_TEST_THREADS=1
-          OPENDAL_LIBSQL_CONNECTION_STRING=http://127.0.0.1:8080
-          
OPENDAL_LIBSQL_AUTH_TOKEN=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjc5ODg0ODM4Mjd9.MatB2aLnPFusagqH2RMoVExP37o2GFLmaJbmd52OdLtAehRNeqeJZPrefP1t2GBFidApUTLlaBRL6poKq_s3CQ
-          OPENDAL_LIBSQL_TABLE=data
-          OPENDAL_LIBSQL_KEY_FIELD=key
-          OPENDAL_LIBSQL_VALUE_FIELD=data
-          EOF
\ No newline at end of file
+        cat << EOF >> $GITHUB_ENV
+        RUST_TEST_THREADS=1
+        OPENDAL_LIBSQL_CONNECTION_STRING=http://127.0.0.1:8080
+        
OPENDAL_LIBSQL_AUTH_TOKEN=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJleHAiOjc5ODg0ODM4Mjd9.MatB2aLnPFusagqH2RMoVExP37o2GFLmaJbmd52OdLtAehRNeqeJZPrefP1t2GBFidApUTLlaBRL6poKq_s3CQ
+        OPENDAL_LIBSQL_TABLE=data
+        OPENDAL_LIBSQL_KEY_FIELD=key
+        OPENDAL_LIBSQL_VALUE_FIELD=data
+        EOF
diff --git a/.github/services/libsql/libsql/action.yml 
b/.github/services/libsql/libsql/action.yml
index 5e61a9b94..6d4feaae8 100644
--- a/.github/services/libsql/libsql/action.yml
+++ b/.github/services/libsql/libsql/action.yml
@@ -19,8 +19,8 @@ name: libsql
 description: 'Behavior test for libsql'
 
 runs:
-    using: "composite"
-    steps:
+  using: "composite"
+  steps:
     - name: Setup libsql
       shell: bash
       working-directory: fixtures/libsql
@@ -29,28 +29,28 @@ runs:
       shell: bash
       working-directory: core
       run: |
-          curl --location '127.0.0.1:8080/v2/pipeline' \
-          --header 'Content-Type: application/json' \
-          --data '{
-              "baton": null,
-              "requests": [
-                  {
-                      "type": "execute",
-                      "stmt": {
-                          "sql": "CREATE TABLE IF NOT EXISTS `data` (`key` 
TEXT PRIMARY KEY NOT NULL CHECK(length(key) <= 255),`data` BLOB);",
-                          "args": [],
-                          "want_rows": true
-                      }
-                  }
-              ]
-          }'
+        curl --location '127.0.0.1:8080/v2/pipeline' \
+        --header 'Content-Type: application/json' \
+        --data '{
+            "baton": null,
+            "requests": [
+                {
+                    "type": "execute",
+                    "stmt": {
+                        "sql": "CREATE TABLE IF NOT EXISTS `data` (`key` TEXT 
PRIMARY KEY NOT NULL CHECK(length(key) <= 255),`data` BLOB);",
+                        "args": [],
+                        "want_rows": true
+                    }
+                }
+            ]
+        }'
     - name: Setup
       shell: bash
       run: |
-          cat << EOF >> $GITHUB_ENV
-          RUST_TEST_THREADS=1
-          OPENDAL_LIBSQL_CONNECTION_STRING=http://127.0.0.1:8080
-          OPENDAL_LIBSQL_TABLE=data
-          OPENDAL_LIBSQL_KEY_FIELD=key
-          OPENDAL_LIBSQL_VALUE_FIELD=data
-          EOF
\ No newline at end of file
+        cat << EOF >> $GITHUB_ENV
+        RUST_TEST_THREADS=1
+        OPENDAL_LIBSQL_CONNECTION_STRING=http://127.0.0.1:8080
+        OPENDAL_LIBSQL_TABLE=data
+        OPENDAL_LIBSQL_KEY_FIELD=key
+        OPENDAL_LIBSQL_VALUE_FIELD=data
+        EOF
diff --git a/fixtures/swift/docker-compose-swift.yml 
b/.github/services/redb/redb/action.yml
similarity index 61%
copy from fixtures/swift/docker-compose-swift.yml
copy to .github/services/redb/redb/action.yml
index 02b83572b..e2241b91c 100644
--- a/fixtures/swift/docker-compose-swift.yml
+++ b/.github/services/redb/redb/action.yml
@@ -15,15 +15,24 @@
 # specific language governing permissions and limitations
 # under the License.
 
-version: '3.8'
+name: redb
+description: 'Behavior test for redb'
 
-services:
-  swift:
-    image: openstackswift/saio:py3
-    ports:
-      - 8080:8080
-    healthcheck:
-      test: ["CMD", "curl", "-i", "-H", "X-Storage-User: test:tester", "-H", 
"X-Storage-Pass: testing", "http://localhost:8080/";]
-      interval: 3s
-      timeout: 20s
-      retries: 10
\ No newline at end of file
+runs:
+  using: "composite"
+  steps:
+    - name: Setup data dir
+      shell: bash
+      working-directory: core
+      run: mkdir -p $OPENDAL_REDB_DATADIR
+      env:
+        OPENDAL_REDB_DATADIR: /tmp/opendal/
+    - name: Setup
+      shell: bash
+      run: |
+        cat << EOF >> $GITHUB_ENV
+        RUST_TEST_THREADS=1
+        OPENDAL_REDB_ROOT=/
+        OPENDAL_REDB_DATADIR=/tmp/opendal/redb
+        OPENDAL_REDB_TABLE=redb-table
+        EOF
diff --git a/.github/workflows/service_test_redb.yml 
b/.github/workflows/service_test_redb.yml
deleted file mode 100644
index bf4796557..000000000
--- a/.github/workflows/service_test_redb.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-# 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: Service Test Redb
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    branches:
-      - main
-    paths:
-      - "core/src/**"
-      - "core/tests/**"
-      - "!core/src/docs/**"
-      - "!core/src/services/**"
-      - "core/src/services/redb/**"
-      - ".github/workflows/service-test-redb.yml"
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
-  cancel-in-progress: true
-
-jobs:
-  redb:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-      - name: Setup Rust toolchain
-        uses: ./.github/actions/setup
-      - name: Prepare for tests
-        shell: bash
-        working-directory: core
-        run: mkdir -p $OPENDAL_REDB_DATADIR
-        env:
-          OPENDAL_REDB_DATADIR: /tmp/opendal/
-      - name: Test
-        shell: bash
-        working-directory: core
-        run: cargo test behavior --features tests,services-redb -j=1
-        env:
-          OPENDAL_TEST: redb
-          OPENDAL_REDB_ROOT: /
-          OPENDAL_REDB_DATADIR: /tmp/opendal/redb
-          OPENDAL_REDB_TABLE: redb-table
diff --git a/fixtures/swift/docker-compose-swift.yml 
b/fixtures/swift/docker-compose-swift.yml
index 02b83572b..7f7906a3c 100644
--- a/fixtures/swift/docker-compose-swift.yml
+++ b/fixtures/swift/docker-compose-swift.yml
@@ -26,4 +26,4 @@ services:
       test: ["CMD", "curl", "-i", "-H", "X-Storage-User: test:tester", "-H", 
"X-Storage-Pass: testing", "http://localhost:8080/";]
       interval: 3s
       timeout: 20s
-      retries: 10
\ No newline at end of file
+      retries: 10

Reply via email to