-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ci/behavior_test): Migrate to 1password instead (#3338)
* Save work Signed-off-by: Xuanwo <[email protected]> * Renaming Signed-off-by: Xuanwo <[email protected]> * Refactor python Signed-off-by: Xuanwo <[email protected]> * refactor Signed-off-by: Xuanwo <[email protected]> * Refactor Signed-off-by: Xuanwo <[email protected]> * Fix Signed-off-by: Xuanwo <[email protected]> * remove debug log Signed-off-by: Xuanwo <[email protected]> * Fix file changed Signed-off-by: Xuanwo <[email protected]> * compare with pr base Signed-off-by: Xuanwo <[email protected]> * Migrate Signed-off-by: Xuanwo <[email protected]> * migrate existing s3 tests Signed-off-by: Xuanwo <[email protected]> * fix secrets Signed-off-by: Xuanwo <[email protected]> * Fix typo Signed-off-by: Xuanwo <[email protected]> * Fix endpoint Signed-off-by: Xuanwo <[email protected]> * Test directly Signed-off-by: Xuanwo <[email protected]> * Fix plan Signed-off-by: Xuanwo <[email protected]> * remove needs Signed-off-by: Xuanwo <[email protected]> * Remove features Signed-off-by: Xuanwo <[email protected]> --------- Signed-off-by: Xuanwo <[email protected]>
- Loading branch information
Showing
15 changed files
with
334 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
import unittest | ||
from 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) | ||
|
||
cases = [v["service"] for v in result["core"][0]["cases"]] | ||
# Should not contain fs | ||
self.assertTrue("fs" in cases) | ||
# Should not contain s3 | ||
self.assertFalse("s3" in cases) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# 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: aws_s3 | ||
description: 'Behavior test for AWS S3. This service is sponsored by @datafuse_labs.' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 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: aws_s3_with_sse_c | ||
description: 'Behavior test for AWS S3 with SSE-C. This service is sponsored by @datafuse_labs.' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup | ||
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 | ||
|
||
- name: Add extra settings | ||
shell: bash | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
OPENDAL_S3_SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM=AES256 | ||
OPENDAL_S3_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY=MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA= | ||
OPENDAL_S3_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5=zZ5FnqcIqUjVwvWmyog4zw== | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: minio_s3 | ||
description: 'Behavior test for Minio S3.' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup MinIO Server | ||
shell: bash | ||
working-directory: fixtures/s3 | ||
run: docker-compose -f docker-compose-minio.yml up -d | ||
- name: Setup test bucket | ||
shell: bash | ||
env: | ||
AWS_ACCESS_KEY_ID: "minioadmin" | ||
AWS_SECRET_ACCESS_KEY: "minioadmin" | ||
AWS_EC2_METADATA_DISABLED: "true" | ||
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test | ||
- name: Setup | ||
shell: bash | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
OPENDAL_S3_BUCKET=test | ||
OPENDAL_S3_ENDPOINT=http://127.0.0.1:9000 | ||
OPENDAL_S3_ACCESS_KEY_ID=minioadmin | ||
OPENDAL_S3_SECRET_ACCESS_KEY=minioadmin | ||
OPENDAL_S3_REGION=us-east-1 | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 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: minio_s3_with_anonymous | ||
description: 'Behavior test for Minio S3 with anonymous access.' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup MinIO Server | ||
shell: bash | ||
working-directory: fixtures/s3 | ||
run: | | ||
docker-compose -f docker-compose-minio.yml up -d | ||
- name: Setup test bucket | ||
shell: bash | ||
env: | ||
AWS_ACCESS_KEY_ID: "minioadmin" | ||
AWS_SECRET_ACCESS_KEY: "minioadmin" | ||
AWS_EC2_METADATA_DISABLED: "true" | ||
run: | | ||
aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test | ||
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc | ||
chmod +x mc | ||
./mc alias set local http://127.0.0.1:9000/ minioadmin minioadmin | ||
./mc anonymous set public local/test | ||
- name: Setup | ||
shell: bash | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
OPENDAL_S3_BUCKET=test | ||
OPENDAL_S3_ENDPOINT=http://127.0.0.1:9000 | ||
OPENDAL_S3_REGION=us-east-1 | ||
OPENDAL_S3_ALLOW_ANONYMOUS=on | ||
EOF |
Oops, something went wrong.