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

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

commit 1b327a54104631ccea4d80fd3a8a084f449854d8
Author: G-XD <[email protected]>
AuthorDate: Tue Nov 14 23:05:59 2023 +0800

    refactor(services/tikv): migrate to test planner
---
 .github/services/tikv/tikv/action.yml     |  45 ++++++++++
 .github/services/tikv/tikv_tls/action.yml |  75 ++++++++++++++++
 .github/workflows/service_test_tikv.yml   | 137 ------------------------------
 3 files changed, 120 insertions(+), 137 deletions(-)

diff --git a/.github/services/tikv/tikv/action.yml 
b/.github/services/tikv/tikv/action.yml
new file mode 100644
index 000000000..d46c14e14
--- /dev/null
+++ b/.github/services/tikv/tikv/action.yml
@@ -0,0 +1,45 @@
+# 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: tikv
+description: 'Behavior test for TiKV'
+
+runs:
+  using: "composite"
+  steps:
+    - name: install tiup
+      run: curl --proto '=https' --tlsv1.2 -sSf 
https://tiup-mirrors.pingcap.com/install.sh | sh
+
+    - name: start tiup playground
+      working-directory: fixtures/tikv
+      run: |
+        # use latest stable version
+        ~/.tiup/bin/tiup install tikv pd
+        ~/.tiup/bin/tiup playground --mode tikv-slim --kv 3 --without-monitor 
--kv.config tikv.toml --pd.config pd.toml &
+        while :; do
+          echo "waiting cluster to be ready"
+          [[ "$(curl -I http://127.0.0.1:2379/pd/api/v1/regions 2>/dev/null | 
head -n 1 | cut -d$' ' -f2)" -ne "405" ]] || break
+          sleep 1
+        done
+
+    - name: Setup
+      shell: bash
+      run: |
+        cat << EOF >> $GITHUB_ENV
+        OPENDAL_TIKV_ENDPOINTS=http://127.0.0.1:2379
+        OPENDAL_TIKV_INSECURE=true
+        EOF
diff --git a/.github/services/tikv/tikv_tls/action.yml 
b/.github/services/tikv/tikv_tls/action.yml
new file mode 100644
index 000000000..31019bbe8
--- /dev/null
+++ b/.github/services/tikv/tikv_tls/action.yml
@@ -0,0 +1,75 @@
+# 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: tikv_with_tls
+description: 'Behavior test for TiKV with tls'
+
+runs:
+  using: "composite"
+  steps:
+    - name: Copy TiKV Certificate Files
+      shell: bash
+      working-directory: fixtures/tikv
+      run: |
+        mkdir -p /tmp/tikv/ssl
+        cp -r `pwd`/ssl/* /tmp/tikv/ssl
+
+    - name: install tiup
+      run: curl --proto '=https' --tlsv1.2 -sSf 
https://tiup-mirrors.pingcap.com/install.sh | sh
+
+    - name: Start tikv-tls
+      working-directory: fixtures/tikv
+      run: |
+        # use latest stable version
+        ~/.tiup/bin/tiup install tikv:v7.3.0 pd:v7.3.0
+
+        ~/.tiup/components/tikv/v7.3.0/tikv-server \
+            --addr=127.0.0.1:20160 \
+            --advertise-addr=127.0.0.1:20160 \
+            --status-addr=127.0.0.1:20180 \
+            --pd-endpoints=https://127.0.0.1:2379 \
+            --data-dir=/tmp/tikv/data \
+            --log-file=/tmp/tikv/tikv.log \
+            --config=tikv-tls.toml &
+
+        ~/.tiup/components/pd/v7.3.0/pd-server \
+            --name=pd1 \
+            --peer-urls=https://127.0.0.1:2380 \
+            --advertise-peer-urls=https://127.0.0.1:2380 \
+            --client-urls=https://127.0.0.1:2379 \
+            --advertise-client-urls=https://127.0.0.1:2379 \
+            --initial-cluster=pd1=https://127.0.0.1:2380 \
+            --data-dir=/tmp/pd1/data \
+            --log-file=/tmp/pd1/pd.log \
+            --config=pd-tls.toml &
+
+        while :; do
+            echo "waiting tikv-tls-cluster to be ready"
+            [[ "$(curl -I --cacert /tmp/tikv/ssl/ca.pem --cert 
/tmp/tikv/ssl/client.pem --key /tmp/tikv/ssl/client-key.pem 
https://127.0.0.1:2379/pd/api/v1/regions 2>/dev/null | head -n 1 | cut -d$' ' 
-f2)" -ne "405" ]] || break
+            sleep 1
+        done
+
+    - name: Setup
+      shell: bash
+      run: |
+        cat << EOF >> $GITHUB_ENV
+        OPENDAL_TIKV_ENDPOINTS=https://127.0.0.1:2379
+        OPENDAL_TIKV_INSECURE=false
+        OPENDAL_TIKV_CA_PATH=/tmp/tikv/ssl/ca.pem
+        OPENDAL_TIKV_CERT_PATH=/tmp/tikv/ssl/client.pem
+        OPENDAL_TIKV_KEY_PATH=/tmp/tikv/ssl/client-key.pem
+        EOF
diff --git a/.github/workflows/service_test_tikv.yml 
b/.github/workflows/service_test_tikv.yml
deleted file mode 100644
index 74a39358c..000000000
--- a/.github/workflows/service_test_tikv.yml
+++ /dev/null
@@ -1,137 +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 TiKV
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    branches:
-      - main
-    paths:
-      - "core/src/**"
-      - "core/tests/**"
-      - "!core/src/docs/**"
-      - "!core/src/services/**"
-      - "core/src/services/tikv/**"
-      - ".github/workflows/service_test_tikv.yml"
-      - "fixtures/tikv/**"
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
-  cancel-in-progress: true
-
-jobs:
-  tikv:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-
-      - name: install tiup
-        run: curl --proto '=https' --tlsv1.2 -sSf 
https://tiup-mirrors.pingcap.com/install.sh | sh
-      - name: start tiup playground
-        run: |
-          # use latest stable version
-          ~/.tiup/bin/tiup install tikv pd
-          ~/.tiup/bin/tiup playground --mode tikv-slim --kv 3 
--without-monitor --kv.config tikv.toml --pd.config pd.toml &
-          while :; do
-            echo "waiting cluster to be ready"
-            [[ "$(curl -I http://127.0.0.1:2379/pd/api/v1/regions 2>/dev/null 
| head -n 1 | cut -d$' ' -f2)" -ne "405" ]] || break
-            sleep 1
-          done
-        working-directory: fixtures/tikv
-
-      - name: Setup Rust toolchain
-        uses: ./.github/actions/setup
-        with:
-          need-protoc: true
-          need-nextest: true
-
-      - name: Test
-        shell: bash
-        working-directory: core
-        run: cargo nextest run behavior --features tests,services-tikv
-        env:
-          OPENDAL_TEST: tikv
-          OPENDAL_TIKV_ENDPOINTS: "127.0.0.1:2379"
-          OPENDAL_TIKV_INSECURE: true
-
-  tikv-tls:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-
-      - name: Copy Tikv Certificate Files
-        shell: bash
-        working-directory: fixtures/tikv
-        run: |
-          mkdir -p /tmp/tikv/ssl
-          cp -r `pwd`/ssl/* /tmp/tikv/ssl
-
-      - name: install tiup
-        run: curl --proto '=https' --tlsv1.2 -sSf 
https://tiup-mirrors.pingcap.com/install.sh | sh
-      - name: Start tikv-tls
-        run: |
-          # use latest stable version
-          ~/.tiup/bin/tiup install tikv:v7.3.0 pd:v7.3.0
-
-          ~/.tiup/components/tikv/v7.3.0/tikv-server \
-              --addr=127.0.0.1:20160 \
-              --advertise-addr=127.0.0.1:20160 \
-              --status-addr=127.0.0.1:20180 \
-              --pd-endpoints=https://127.0.0.1:2379 \
-              --data-dir=/tmp/tikv/data \
-              --log-file=/tmp/tikv/tikv.log \
-              --config=tikv-tls.toml &
-
-          ~/.tiup/components/pd/v7.3.0/pd-server \
-              --name=pd1 \
-              --peer-urls=https://127.0.0.1:2380 \
-              --advertise-peer-urls=https://127.0.0.1:2380 \
-              --client-urls=https://127.0.0.1:2379 \
-              --advertise-client-urls=https://127.0.0.1:2379 \
-              --initial-cluster=pd1=https://127.0.0.1:2380 \
-              --data-dir=/tmp/pd1/data \
-              --log-file=/tmp/pd1/pd.log \
-              --config=pd-tls.toml &
-
-          while :; do
-              echo "waiting tikv-tls-cluster to be ready"
-              [[ "$(curl -I --cacert /tmp/tikv/ssl/ca.pem --cert 
/tmp/tikv/ssl/client.pem --key /tmp/tikv/ssl/client-key.pem 
https://127.0.0.1:2379/pd/api/v1/regions 2>/dev/null | head -n 1 | cut -d$' ' 
-f2)" -ne "405" ]] || break
-              sleep 1
-          done
-        working-directory: fixtures/tikv
-
-      - name: Setup Rust toolchain
-        uses: ./.github/actions/setup
-        with:
-          need-protoc: true
-          need-nextest: true
-
-      - name: Test
-        shell: bash
-        working-directory: core
-        run: cargo nextest run behavior --features tests,services-tikv
-        env:
-          OPENDAL_TEST: tikv
-          OPENDAL_TIKV_ENDPOINTS: "https://127.0.0.1:2379";
-          OPENDAL_TIKV_INSECURE: false
-          OPENDAL_TIKV_CA_PATH: "/tmp/tikv/ssl/ca.pem"
-          OPENDAL_TIKV_CERT_PATH: "/tmp/tikv/ssl/client.pem"
-          OPENDAL_TIKV_KEY_PATH: "/tmp/tikv/ssl/client-key.pem"

Reply via email to