You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/12/28 09:36:39 UTC
(incubator-opendal) 01/01: ci: Migrate ftp to test planner
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch migrate-ftp
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 0deb08e7d350e975fe1bf1f3df31de67b9df21fa
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu Dec 28 17:36:23 2023 +0800
ci: Migrate ftp to test planner
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
.github/services/ftp/vsftpd/action.yml | 36 ++++++++++++++
.github/workflows/service_test_ftp.yml | 91 ----------------------------------
fixtures/ftp/docker-compose-vsftpd.yml | 35 +++++++++++++
3 files changed, 71 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..832009eda
--- /dev/null
+++ b/.github/services/ftp/vsftpd/action.yml
@@ -0,0 +1,36 @@
+# 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 vsftpd'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Setup vsftpd cluster
+ shell: bash
+ working-directory: fixtures/ftp
+ run: docker compose -f docker-compose-vsftpd.yml up -d --wait
+ - 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 3775dcdea..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 tests,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..65f74a74d
--- /dev/null
+++ b/fixtures/ftp/docker-compose-vsftpd.yml
@@ -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.
+
+version: "3.8"
+services:
+ vsftpd:
+ 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
+
+volumes:
+ vsftpd-data: