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 bb438d80f refactor(services/azblob): migrate to test planner (#3370)
bb438d80f is described below
commit bb438d80f7bbea2285611957b3f6fa6098ce7f9e
Author: Suyan <[email protected]>
AuthorDate: Tue Oct 24 16:54:50 2023 +0800
refactor(services/azblob): migrate to test planner (#3370)
Signed-off-by: suyanhanx <[email protected]>
---
.../sqlite => azblob/azure_azblob}/action.yml | 26 +++---
.github/services/azblob/azurite_azblob/action.yml | 44 +++++++++
.github/services/sqlite/sqlite/action.yml | 8 +-
.github/workflows/service_test_azblob.yml | 103 ---------------------
.../azblob/docker-compose-azurite.yml | 24 ++---
5 files changed, 65 insertions(+), 140 deletions(-)
diff --git a/.github/services/sqlite/sqlite/action.yml
b/.github/services/azblob/azure_azblob/action.yml
similarity index 62%
copy from .github/services/sqlite/sqlite/action.yml
copy to .github/services/azblob/azure_azblob/action.yml
index e5d3e6c47..339e6f87b 100644
--- a/.github/services/sqlite/sqlite/action.yml
+++ b/.github/services/azblob/azure_azblob/action.yml
@@ -15,22 +15,18 @@
# specific language governing permissions and limitations
# under the License.
-name: sqlite
-description: 'Behavior test for sqlite'
+name: azure_azblob
+description: 'Behavior test for Azure azblob. This service is sponsored by
@datafuse_labs.'
runs:
using: "composite"
steps:
- - name: Setup Sqlite
- shell: bash
- working-directory: fixtures/sqlite
- run: mkdir -p /tmp/opendal && sqlite3 /tmp/opendal/test.db < data.sql
- - name: Setup
- shell: bash
- run: |
- cat << EOF >> $GITHUB_ENV
- OPENDAL_SQLITE_CONNECTION_STRING=file:///tmp/opendal/test.db
- OPENDAL_SQLITE_TABLE=data
- OPENDAL_SQLITE_KEY_FIELD=key
- OPENDAL_SQLITE_VALUE_FIELD=data
- EOF
+ - name: Setup
+ uses: 1password/load-secrets-action@v1
+ with:
+ export-env: true
+ env:
+ OPENDAL_AZBLOB_CONTAINER: op://services/azblob/container
+ OPENDAL_AZBLOB_ENDPOINT: op://services/azblob/endpoint
+ OPENDAL_AZBLOB_ACCOUNT_NAME: op://services/azblob/account_name
+ OPENDAL_AZBLOB_ACCOUNT_KEY: op://services/azblob/account_key
diff --git a/.github/services/azblob/azurite_azblob/action.yml
b/.github/services/azblob/azurite_azblob/action.yml
new file mode 100644
index 000000000..ac1c1abed
--- /dev/null
+++ b/.github/services/azblob/azurite_azblob/action.yml
@@ -0,0 +1,44 @@
+# 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: azurite_azblob
+description: 'Behavior test for azurite azblob'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Setup azurite azblob service
+ shell: bash
+ working-directory: fixtures/azblob
+ run: docker-compose -f docker-compose-azurite.yml up -d
+ - name: Setup test bucket
+ shell: bash
+ run: |
+ az storage container create \
+ --name test \
+ --connection-string
"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
+ - name: Setup
+ shell: bash
+ run: |
+ cat << EOF >> $GITHUB_ENV
+ RUST_BACKTRACE=full
+ RUST_LOG=debug
+ OPENDAL_AZBLOB_CONTAINER=test
+ OPENDAL_AZBLOB_ENDPOINT=http://127.0.0.1:10000/devstoreaccount1
+ OPENDAL_AZBLOB_ACCOUNT_NAME=devstoreaccount1
+
OPENDAL_AZBLOB_ACCOUNT_KEY=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
+ EOF
diff --git a/.github/services/sqlite/sqlite/action.yml
b/.github/services/sqlite/sqlite/action.yml
index e5d3e6c47..1612e6246 100644
--- a/.github/services/sqlite/sqlite/action.yml
+++ b/.github/services/sqlite/sqlite/action.yml
@@ -21,13 +21,13 @@ description: 'Behavior test for sqlite'
runs:
using: "composite"
steps:
- - name: Setup Sqlite
+ - name: Setup Sqlite
shell: bash
working-directory: fixtures/sqlite
run: mkdir -p /tmp/opendal && sqlite3 /tmp/opendal/test.db < data.sql
- - name: Setup
- shell: bash
- run: |
+ - name: Setup
+ shell: bash
+ run: |
cat << EOF >> $GITHUB_ENV
OPENDAL_SQLITE_CONNECTION_STRING=file:///tmp/opendal/test.db
OPENDAL_SQLITE_TABLE=data
diff --git a/.github/workflows/service_test_azblob.yml
b/.github/workflows/service_test_azblob.yml
deleted file mode 100644
index 102d36eb6..000000000
--- a/.github/workflows/service_test_azblob.yml
+++ /dev/null
@@ -1,103 +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 Azblob
-
-on:
- push:
- branches:
- - main
- pull_request:
- branches:
- - main
- paths:
- - "core/src/**"
- - "core/tests/**"
- - "!core/src/docs/**"
- - "!core/src/services/**"
- - "core/src/services/azblob/**"
- - ".github/workflows/service_test_azblob.yml"
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
- cancel-in-progress: true
-
-jobs:
- azurite_azblob:
- runs-on: ubuntu-latest
-
- # Setup azurite server
- services:
- azurite:
- image: mcr.microsoft.com/azure-storage/azurite
- ports:
- - 10000:10000
-
- steps:
- - uses: actions/checkout@v4
- - name: Setup test bucket
- run: |
- az storage container create \
- --name test \
- --connection-string
"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
-
- - name: Setup Rust toolchain
- uses: ./.github/actions/setup
- with:
- need-nextest: true
-
- - name: Test
- shell: bash
- working-directory: core
- run: cargo nextest run behavior
- env:
- RUST_BACKTRACE: full
- RUST_LOG: debug
- OPENDAL_TEST: azblob
- OPENDAL_AZBLOB_CONTAINER: test
- OPENDAL_AZBLOB_ENDPOINT: "http://127.0.0.1:10000/devstoreaccount1"
- OPENDAL_AZBLOB_ACCOUNT_NAME: devstoreaccount1
- OPENDAL_AZBLOB_ACCOUNT_KEY:
Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
-
- azure_azblob:
- runs-on: ubuntu-latest
- if: (github.event_name == 'push' && github.repository ==
'apache/incubator-opendal') || !github.event.pull_request.head.repo.fork
- steps:
- - uses: actions/checkout@v4
- - name: Setup Rust toolchain
- uses: ./.github/actions/setup
- with:
- need-nextest: true
-
- - name: Load secret
- id: op-load-secret
- uses: 1password/load-secrets-action@v1
- with:
- export-env: true
- env:
- OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- OPENDAL_AZBLOB_CONTAINER: op://services/azblob/container
- OPENDAL_AZBLOB_ENDPOINT: op://services/azblob/endpoint
- OPENDAL_AZBLOB_ACCOUNT_NAME: op://services/azblob/account_name
- OPENDAL_AZBLOB_ACCOUNT_KEY: op://services/azblob/account_key
-
- - name: Test
- shell: bash
- working-directory: core
- run: cargo nextest run behavior
- env:
- OPENDAL_TEST: azblob
diff --git a/.github/services/sqlite/sqlite/action.yml
b/fixtures/azblob/docker-compose-azurite.yml
similarity index 60%
copy from .github/services/sqlite/sqlite/action.yml
copy to fixtures/azblob/docker-compose-azurite.yml
index e5d3e6c47..abbbc7e09 100644
--- a/.github/services/sqlite/sqlite/action.yml
+++ b/fixtures/azblob/docker-compose-azurite.yml
@@ -15,22 +15,10 @@
# specific language governing permissions and limitations
# under the License.
-name: sqlite
-description: 'Behavior test for sqlite'
+version: '3.8'
-runs:
- using: "composite"
- steps:
- - name: Setup Sqlite
- shell: bash
- working-directory: fixtures/sqlite
- run: mkdir -p /tmp/opendal && sqlite3 /tmp/opendal/test.db < data.sql
- - name: Setup
- shell: bash
- run: |
- cat << EOF >> $GITHUB_ENV
- OPENDAL_SQLITE_CONNECTION_STRING=file:///tmp/opendal/test.db
- OPENDAL_SQLITE_TABLE=data
- OPENDAL_SQLITE_KEY_FIELD=key
- OPENDAL_SQLITE_VALUE_FIELD=data
- EOF
+services:
+ redis:
+ image: mcr.microsoft.com/azure-storage/azurite
+ ports:
+ - 10000:10000