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/10/18 07:51:46 UTC
[incubator-opendal] branch planner created (now a22de2da9)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a change to branch planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
at a22de2da9 Refactor
This branch includes the following new commits:
new 7592ac3be Save work
new 9b2b08538 Renaming
new 7e7baacd5 Refactor python
new ed7d72bae refactor
new a22de2da9 Refactor
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-opendal] 02/05: Renaming
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 9b2b085384056a3163833ff5b7ae0d53703e63cd
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Oct 18 13:14:02 2023 +0800
Renaming
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
.github/actions/{test-core => behavior_test_core}/action.yaml | 2 +-
.../workflow_planner.py => .github/scripts/behavior_test_plan.py | 0
.github/workflows/behavior_test.yml | 6 +++---
.github/workflows/{core_test.yml => behavior_test_core.yml} | 9 +++++----
4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/.github/actions/test-core/action.yaml b/.github/actions/behavior_test_core/action.yaml
similarity index 98%
rename from .github/actions/test-core/action.yaml
rename to .github/actions/behavior_test_core/action.yaml
index 7e29b6b41..2447ac920 100644
--- a/.github/actions/test-core/action.yaml
+++ b/.github/actions/behavior_test_core/action.yaml
@@ -44,7 +44,7 @@ runs:
- name: Run Test Core
shell: bash
working-directory: core
- run: cargo nextest run behavior --archive-file=./core-test.tar.zst
+ run: cargo nextest run behavior --archive-file=./test-core.tar.zst
env:
OPENDAL_TEST: ${{ inputs.service }}
EOF
diff --git a/scripts/workflow_planner.py b/.github/scripts/behavior_test_plan.py
similarity index 100%
rename from scripts/workflow_planner.py
rename to .github/scripts/behavior_test_plan.py
diff --git a/.github/workflows/behavior_test.yml b/.github/workflows/behavior_test.yml
index bc53b4d59..04a60b022 100644
--- a/.github/workflows/behavior_test.yml
+++ b/.github/workflows/behavior_test.yml
@@ -73,12 +73,12 @@ jobs:
export GITHUB_IS_PUSH=$is_push
# Run the workflow planner script
- PLAN=$(./scripts/workflow_planner.py $files_changed)
+ PLAN=$(./.github/scripts/behavior_test_plan.py $files_changed)
echo "Plan:"
echo "$PLAN" | jq .
echo "plan=$PLAN" >> $GITHUB_OUTPUT
- core_test:
+ test_core:
name: core / ${{ matrix.os }}
needs: [plan]
if: fromJson(needs.plan.outputs.plan).components.core
@@ -86,7 +86,7 @@ jobs:
strategy:
matrix:
include: ${{ fromJson(needs.plan.outputs.plan).core }}
- uses: ./.github/workflows/core_test.yml
+ uses: ./.github/workflows/behavior_test_core.yml
with:
os: ${{ matrix.os }}
cases: ${{ toJson(matrix.cases) }}
diff --git a/.github/workflows/core_test.yml b/.github/workflows/behavior_test_core.yml
similarity index 91%
rename from .github/workflows/core_test.yml
rename to .github/workflows/behavior_test_core.yml
index 9cd213d4e..3d16b1111 100644
--- a/.github/workflows/core_test.yml
+++ b/.github/workflows/behavior_test_core.yml
@@ -56,13 +56,13 @@ jobs:
shell: bash
working-directory: core
run: |
- cargo nextest archive --features ${{ inputs.features }} --archive-file ./core-test.tar.zst
+ cargo nextest archive --features ${{ inputs.features }} --archive-file ./test-core.tar.zst
- name: Upload
uses: actions/upload-artifact@v3
with:
- name: ${{ inputs.os }}-core-test
- path: ./core/core-test.tar.zst
+ name: ${{ inputs.os }}-test-core
+ path: ./core/test-core.tar.zst
test:
name: ${{ matrix.cases.service }} / ${{ matrix.cases.setup }}
@@ -79,11 +79,12 @@ jobs:
need-nextest: true
need-protoc: true
need-rocksdb: true
+ github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download
uses: actions/download-artifact@v3
with:
- name: ${{ inputs.os }}-core-test
+ name: ${{ inputs.os }}-test-core
path: ./core
- name: Test Core
[incubator-opendal] 03/05: Refactor python
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 7e7baacd593640100574e33cff38495492d95fe7
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Oct 18 15:30:09 2023 +0800
Refactor python
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
.github/scripts/__init__.py | 17 ++++++++++++
.github/scripts/behavior_test_plan.py | 22 ++++++++++++---
.github/scripts/test_behavior_test_plan.py | 43 ++++++++++++++++++++++++++++++
.gitignore | 3 +++
4 files changed, 81 insertions(+), 4 deletions(-)
diff --git a/.github/scripts/__init__.py b/.github/scripts/__init__.py
new file mode 100644
index 000000000..dae607cde
--- /dev/null
+++ b/.github/scripts/__init__.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+# 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.
diff --git a/.github/scripts/behavior_test_plan.py b/.github/scripts/behavior_test_plan.py
index 534c68ae5..65fe55ef8 100755
--- a/.github/scripts/behavior_test_plan.py
+++ b/.github/scripts/behavior_test_plan.py
@@ -21,9 +21,21 @@ import json
import os
from pathlib import Path
+# The path for current script.
+SCRIPT_PATH = Path(__file__).parent.absolute()
+print(f"SCRIPT_PATH: {SCRIPT_PATH}")
+
+# The path for `.github` dir.
+GITHUB_DIR = SCRIPT_PATH.parent
+print(f"GITHUB_DIR: {GITHUB_DIR}")
+
+# The project dir for opendal.
+PROJECT_DIR = GITHUB_DIR.parent
+print(f"PROJECT_DIR: {PROJECT_DIR}")
+
def get_provided_cases():
- root_dir = ".github/services"
+ root_dir = f"{GITHUB_DIR}/services"
cases = [
{
@@ -62,7 +74,9 @@ def calculate_core_cases(cases, changed_files):
# If any of the core files changed, we will run all cases.
if any(
- p.startswith("core/src/") and not p.startswith("core/src/services")
+ p.startswith("core/")
+ and not p.startswith("core/src/services/")
+ and not p.endswith(".md")
for p in changed_files
):
return cases
@@ -108,7 +122,7 @@ def plan(changed_files):
}
)
- return json.dumps(jobs)
+ return jobs
# For quick test:
@@ -117,4 +131,4 @@ def plan(changed_files):
if __name__ == "__main__":
changed_files = sys.argv[1:]
result = plan(changed_files)
- print(result)
+ print(json.dumps(result))
diff --git a/.github/scripts/test_behavior_test_plan.py b/.github/scripts/test_behavior_test_plan.py
new file mode 100644
index 000000000..5f2a662b0
--- /dev/null
+++ b/.github/scripts/test_behavior_test_plan.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+# 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.
+
+import unittest
+from behavior_test_plan import plan
+
+
+class BehaviorTestPlan(unittest.TestCase):
+ def test_empty(self):
+ result = plan([])
+ self.assertEqual(result, {})
+
+ def test_core_cargo_toml(self):
+ result = plan(["core/Cargo.toml"])
+ self.assertTrue(result["components"]["core"])
+
+ def test_core_services_fs(self):
+ result = plan(["core/src/services/fs/mod.rs"])
+ self.assertTrue(result["components"]["core"])
+ self.assertTrue(len(result["core"]) > 0)
+ # Should not contain fs
+ self.assertTrue("services-fs" in result["core"][0]["features"])
+ # Should not contain s3
+ self.assertFalse("services-s3" in result["core"][0]["features"])
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/.gitignore b/.gitignore
index d5fd6da84..dc9a92312 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,6 @@ perf.*
# Yarn Integrity file
.yarn-integrity
+
+# Python cache files
+**/__pycache__/
[incubator-opendal] 01/05: Save work
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 7592ac3bead2c30b468ffd0087b4c941a69c35b8
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Oct 18 12:37:50 2023 +0800
Save work
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
.github/workflows/{test_planner.yml => behavior_test.yml} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/test_planner.yml b/.github/workflows/behavior_test.yml
similarity index 99%
rename from .github/workflows/test_planner.yml
rename to .github/workflows/behavior_test.yml
index 29eabd6f9..bc53b4d59 100644
--- a/.github/workflows/test_planner.yml
+++ b/.github/workflows/behavior_test.yml
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-name: Test
+name: Behavior Test
on:
push:
[incubator-opendal] 05/05: Refactor
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit a22de2da9fc524a7d721e675fcbcf675d958891f
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Oct 18 15:51:36 2023 +0800
Refactor
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
.github/services/fs/local-fs/action.yml | 2 +-
.github/services/s3/aws-s3/action.yml | 26 +++++++++++---------------
.github/workflows/behavior_test_core.yml | 9 +++++++--
.github/workflows/service_test_s3.yml | 1 -
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/.github/services/fs/local-fs/action.yml b/.github/services/fs/local-fs/action.yml
index 72d54608c..7b36dc3a9 100644
--- a/.github/services/fs/local-fs/action.yml
+++ b/.github/services/fs/local-fs/action.yml
@@ -16,7 +16,7 @@
# under the License.
name: local_fs
-description: "Setup local fs"
+description: 'Behavior test for local fs'
runs:
using: "composite"
diff --git a/.github/services/s3/aws-s3/action.yml b/.github/services/s3/aws-s3/action.yml
index b560b4434..ce95ec863 100644
--- a/.github/services/s3/aws-s3/action.yml
+++ b/.github/services/s3/aws-s3/action.yml
@@ -16,23 +16,19 @@
# under the License.
name: aws_s3
-description: "Setup AWS S3"
+description: 'Behavior test for AWS S3. This service is sponsored by @datafuse_labs.'
-inputs:
- secrets:
- description: "The secrets for test"
- default: "{}"
-
-# TODO: we should migrate to 1password instead.
runs:
using: "composite"
steps:
- name: Setup
- shell: bash
- run: |
- echo "OPENDAL_S3_ROOT=${{ fromJson(inputs.secrets).OPENDAL_S3_ROOT }}" >> $GITHUB_ENV
- echo "OPENDAL_S3_BUCKET=${{ fromJson(inputs.secrets).OPENDAL_S3_BUCKET }}" >> $GITHUB_ENV
- echo "OPENDAL_S3_ENDPOINT=${{ fromJson(inputs.secrets).OPENDAL_S3_ENDPOINT }}" >> $GITHUB_ENV
- echo "OPENDAL_S3_ACCESS_KEY_ID=${{ fromJson(inputs.secrets).OPENDAL_S3_ACCESS_KEY_ID }}" >> $GITHUB_ENV
- echo "OPENDAL_S3_SECRET_ACCESS_KEY=${{ fromJson(inputs.secrets).OPENDAL_S3_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
- echo "OPENDAL_S3_REGION=ap-northeast-1" >> $GITHUB_ENV
+ uses: 1password/load-secrets-action@v1
+ with:
+ export-env: true
+ env:
+ OPENDAL_S3_ROOT: op://services/s3/root
+ OPENDAL_S3_BUCKET: op://services/s3/bucket
+ OPENDAL_S3_ENDPOINT: op://services/s3/endpoint
+ OPENDAL_S3_ACCESS_KEY_ID: op://services/s3/access_key_id
+ OPENDAL_S3_SECRET_ACCESS_KEY: op://services/s3/secret_access_key
+ OPENDAL_S3_REGION: op://services/s3/region
diff --git a/.github/workflows/behavior_test_core.yml b/.github/workflows/behavior_test_core.yml
index 3d16b1111..748f5ba34 100644
--- a/.github/workflows/behavior_test_core.yml
+++ b/.github/workflows/behavior_test_core.yml
@@ -87,9 +87,14 @@ jobs:
name: ${{ inputs.os }}-test-core
path: ./core
+ # TODO: 1password is only supported on linux, waiting for https://github.com/1Password/load-secrets-action/issues/46
+ - name: Setup service account token for 1password
+ if: runner.os == 'Linux'
+ shell: bash
+ run: echo "OP_SERVICE_ACCOUNT_TOKEN=${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}" >> $GITHUB_ENV
+
- name: Test Core
- uses: ./.github/actions/test-core
+ uses: ./.github/actions/behavior_test_core
with:
setup: ${{ matrix.cases.setup }}
service: ${{ matrix.cases.service }}
- secrets: ${{ toJson(secrets) }}
diff --git a/.github/workflows/service_test_s3.yml b/.github/workflows/service_test_s3.yml
index d97a36bb4..efa8b1e4a 100644
--- a/.github/workflows/service_test_s3.yml
+++ b/.github/workflows/service_test_s3.yml
@@ -197,7 +197,6 @@ jobs:
need-nextest: true
- name: Load secret
- id: op-load-secret
uses: 1password/load-secrets-action@v1
with:
export-env: true
[incubator-opendal] 04/05: refactor
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch planner
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit ed7d72bae55b61dd68717260a278d87333c4c91e
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Wed Oct 18 15:32:33 2023 +0800
refactor
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
.github/scripts/{ => behavior_test}/__init__.py | 1 -
.github/scripts/{behavior_test_plan.py => behavior_test/plan.py} | 0
.../scripts/{test_behavior_test_plan.py => behavior_test/test_plan.py} | 3 +--
.github/workflows/behavior_test.yml | 2 +-
4 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/.github/scripts/__init__.py b/.github/scripts/behavior_test/__init__.py
similarity index 97%
rename from .github/scripts/__init__.py
rename to .github/scripts/behavior_test/__init__.py
index dae607cde..13a83393a 100644
--- a/.github/scripts/__init__.py
+++ b/.github/scripts/behavior_test/__init__.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# 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
diff --git a/.github/scripts/behavior_test_plan.py b/.github/scripts/behavior_test/plan.py
similarity index 100%
rename from .github/scripts/behavior_test_plan.py
rename to .github/scripts/behavior_test/plan.py
diff --git a/.github/scripts/test_behavior_test_plan.py b/.github/scripts/behavior_test/test_plan.py
similarity index 96%
rename from .github/scripts/test_behavior_test_plan.py
rename to .github/scripts/behavior_test/test_plan.py
index 5f2a662b0..d023095ff 100644
--- a/.github/scripts/test_behavior_test_plan.py
+++ b/.github/scripts/behavior_test/test_plan.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
# 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
@@ -17,7 +16,7 @@
# under the License.
import unittest
-from behavior_test_plan import plan
+from plan import plan
class BehaviorTestPlan(unittest.TestCase):
diff --git a/.github/workflows/behavior_test.yml b/.github/workflows/behavior_test.yml
index 04a60b022..3997f8b0c 100644
--- a/.github/workflows/behavior_test.yml
+++ b/.github/workflows/behavior_test.yml
@@ -73,7 +73,7 @@ jobs:
export GITHUB_IS_PUSH=$is_push
# Run the workflow planner script
- PLAN=$(./.github/scripts/behavior_test_plan.py $files_changed)
+ PLAN=$(./.github/scripts/behavior_test/plan.py $files_changed)
echo "Plan:"
echo "$PLAN" | jq .
echo "plan=$PLAN" >> $GITHUB_OUTPUT