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

suyanhanx pushed a commit to branch ftp-test-planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit 475318944ecc1e3f8430e87c8db86855418ceef9
Author: suyanhanx <[email protected]>
AuthorDate: Tue Oct 24 21:03:02 2023 +0800

    refactor(services/ftp): migrate to test planner
    
    Signed-off-by: suyanhanx <[email protected]>
---
 .github/services/ftp/vsftpd/action.yml | 53 ++++++++++++++++++++
 .github/workflows/service_test_ftp.yml | 91 ----------------------------------
 fixtures/ftp/docker-compose-vsftpd.yml | 32 ++++++++++++
 3 files changed, 85 insertions(+), 91 deletions(-)

diff --git a/.github/services/ftp/vsftpd/action.yml 
b/.github/services/ftp/vsftpd/action.yml
new file mode 100644
index 000000000..781036545
--- /dev/null
+++ b/.github/services/ftp/vsftpd/action.yml
@@ -0,0 +1,53 @@
+# 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: vsftpd
+description: 'Behavior test for ftp service on vsftpd'
+
+runs:
+  using: "composite"
+  steps:
+    - name: Setup vsftpd service
+      shell: bash
+      working-directory: fixtures/ftp
+      run: docker-compose -f docker-compose-vsftpd.yml up -d
+    - name: Set swap
+      shell: bash
+      run: |
+        SWAP_PATH="swapfile"
+        
+        sudo fallocate -l 10G $SWAP_PATH
+        sudo chmod 600 $SWAP_PATH
+        sudo mkswap $SWAP_PATH
+        sudo swapon $SWAP_PATH
+    - name: Swap space report after modification
+      shell: bash
+      run: |
+        echo "Memory and swap:"
+        free -h
+        echo
+        swapon --show
+        echo
+    - name: Setup
+      shell: bash
+      run: |
+        cat << EOF >> $GITHUB_ENV
+        OPENDAL_FTP_ENDPOINT=ftp://127.0.0.1:2121
+        OPENDAL_FTP_ROOT=/
+        OPENDAL_FTP_USER=admin
+        OPENDAL_FTP_PASSWORD=admin
+        EOF
diff --git a/.github/workflows/service_test_ftp.yml 
b/.github/workflows/service_test_ftp.yml
deleted file mode 100644
index 6a9671ab9..000000000
--- a/.github/workflows/service_test_ftp.yml
+++ /dev/null
@@ -1,91 +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 Ftp
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    branches:
-      - main
-    paths:
-      - "core/src/**"
-      - "core/tests/**"
-      - "!core/src/docs/**"
-      - "!core/src/services/**"
-      - "core/src/services/ftp/**"
-      - ".github/workflows/service_test_ftp.yml"
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
-  cancel-in-progress: true
-
-jobs:
-  vsftpd:
-    runs-on: ubuntu-latest
-
-    services:
-      ftp:
-        image: fauria/vsftpd
-        ports:
-          - 2121:21
-          - 20000-22000:20000-22000
-        env:
-          FTP_USER: admin
-          FTP_PASS: admin
-          PASV_ADDRESS: 127.0.0.1
-          PASV_MIN_PORT: 20000
-          PASV_MAX_PORT: 22000
-        volumes:
-          - vsftpd-data:/home/vsftpd
-
-    steps:
-      - uses: actions/checkout@v4
-      - name: Set swap
-        shell: bash
-        run: |
-          SWAP_PATH="swapfile"
-
-          sudo fallocate -l 10G $SWAP_PATH
-          sudo chmod 600 $SWAP_PATH
-          sudo mkswap $SWAP_PATH
-          sudo swapon $SWAP_PATH
-      - name: Swap space report after modification
-        shell: bash
-        run: |
-          echo "Memory and swap:"
-          free -h
-          echo
-          swapon --show
-          echo
-
-      - 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-ftp
-        env:
-          OPENDAL_TEST: ftp
-          OPENDAL_FTP_ENDPOINT: ftp://127.0.0.1:2121
-          OPENDAL_FTP_ROOT: /
-          OPENDAL_FTP_USER: admin
-          OPENDAL_FTP_PASSWORD: admin
diff --git a/fixtures/ftp/docker-compose-vsftpd.yml 
b/fixtures/ftp/docker-compose-vsftpd.yml
new file mode 100644
index 000000000..6c746bcfd
--- /dev/null
+++ b/fixtures/ftp/docker-compose-vsftpd.yml
@@ -0,0 +1,32 @@
+# 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:
+  ftp:
+    image: fauria/vsftpd
+    ports:
+      - 2121:21
+      - 20000-22000:20000-22000
+    environment:
+      FTP_USER: admin
+      FTP_PASS: admin
+      PASV_ADDRESS: 127.0.0.1
+      PASV_MIN_PORT: 20000
+      PASV_MAX_PORT: 22000
+    volumes:
+      - vsftpd-data:/home/vsftpd

Reply via email to