From 33d7b87141806627dda9d55043f346444bfc2f30 Mon Sep 17 00:00:00 2001 From: taobo Date: Wed, 8 Nov 2023 18:22:39 +0800 Subject: [PATCH] ci: support behavior test for gridfs (#3520) * ci: support behavior test for gridfs * fix: optimize code * chore: cargo.toml add gridfs feature --- .github/services/gridfs/gridfs/action.yml | 35 +++++++++++++++++++ .../gridfs/gridfs_with_basic_auth/action.yml | 35 +++++++++++++++++++ bindings/java/Cargo.toml | 7 ++-- bindings/nodejs/Cargo.toml | 8 +++-- bindings/python/Cargo.toml | 6 ++-- 5 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 .github/services/gridfs/gridfs/action.yml create mode 100644 .github/services/gridfs/gridfs_with_basic_auth/action.yml diff --git a/.github/services/gridfs/gridfs/action.yml b/.github/services/gridfs/gridfs/action.yml new file mode 100644 index 000000000000..a457657d6d08 --- /dev/null +++ b/.github/services/gridfs/gridfs/action.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. + +name: gridfs +description: 'Behavior test for gridfs' + +runs: + using: "composite" + steps: + - name: Setup MongoDB Server + shell: bash + working-directory: fixtures/mongodb + run: docker compose -f docker-compose-no-auth.yml up -d --wait + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_GRIDFS_CONNECTION_STRING=mongodb://127.0.0.1:27017 + OPENDAL_GRIDFS_DATABASE=opendal + OPENDAL_GRIDFS_BUCKET=fs + EOF diff --git a/.github/services/gridfs/gridfs_with_basic_auth/action.yml b/.github/services/gridfs/gridfs_with_basic_auth/action.yml new file mode 100644 index 000000000000..98d1d659a6c5 --- /dev/null +++ b/.github/services/gridfs/gridfs_with_basic_auth/action.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. + +name: mongodb_with_basic_auth +description: "Behavior test for gridfs with basic auth" + +runs: + using: "composite" + steps: + - name: Setup MongoDB Server + shell: bash + working-directory: fixtures/mongodb + run: docker compose -f docker-compose-basic-auth.yml up -d --wait + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_GRIDFS_CONNECTION_STRING=mongodb://root:example@127.0.0.1:27017/admin + OPENDAL_GRIDFS_DATABASE=opendal + OPENDAL_GRIDFS_BUCKET=fs + EOF diff --git a/bindings/java/Cargo.toml b/bindings/java/Cargo.toml index b21fc2fd72d1..c93d9bfcf323 100644 --- a/bindings/java/Cargo.toml +++ b/bindings/java/Cargo.toml @@ -80,6 +80,7 @@ services-all = [ "services-vercel-artifacts", "services-wasabi", "services-mongodb", + "services-gridfs", "services-sqlite", "services-azfile", "services-libsql", @@ -111,8 +112,10 @@ services-etcd = ["opendal/services-etcd"] services-foundationdb = ["opendal/services-foundationdb"] services-ftp = ["opendal/services-ftp"] services-gdrive = ["opendal/services-gdrive"] +services-gridfs = ["opendal/services-gridfs"] services-hdfs = ["opendal/services-hdfs"] services-ipfs = ["opendal/services-ipfs"] +services-libsql = ["opendal/services-libsql"] services-memcached = ["opendal/services-memcached"] services-mini-moka = ["opendal/services-mini-moka"] services-moka = ["opendal/services-moka"] @@ -128,12 +131,10 @@ services-sftp = ["opendal/services-sftp"] services-sled = ["opendal/services-sled"] services-sqlite = ["opendal/services-sqlite"] services-supabase = ["opendal/services-supabase"] +services-swift = ["opendal/services-swift"] services-tikv = ["opendal/services-tikv"] services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] -services-libsql = ["opendal/services-libsql"] -services-swift = ["opendal/services-swift"] - [dependencies] anyhow = "1.0.71" diff --git a/bindings/nodejs/Cargo.toml b/bindings/nodejs/Cargo.toml index a8294b33aa89..9a29697a85e0 100644 --- a/bindings/nodejs/Cargo.toml +++ b/bindings/nodejs/Cargo.toml @@ -78,8 +78,9 @@ services-all = [ "services-vercel-artifacts", "services-wasabi", "services-mongodb", + "services-gridfs", "services-sqlite", - "services-libsql" + "services-libsql", ] # Default services provided by opendal. @@ -107,8 +108,10 @@ services-etcd = ["opendal/services-etcd"] services-foundationdb = ["opendal/services-foundationdb"] services-ftp = ["opendal/services-ftp"] services-gdrive = ["opendal/services-gdrive"] +services-gridfs = ["opendal/services-gridfs"] services-hdfs = ["opendal/services-hdfs"] services-ipfs = ["opendal/services-ipfs"] +services-libsql = ["opendal/services-libsql"] services-memcached = ["opendal/services-memcached"] services-mini-moka = ["opendal/services-mini-moka"] services-moka = ["opendal/services-moka"] @@ -128,7 +131,6 @@ services-swift = ["opendal/services-swift"] services-tikv = ["opendal/services-tikv"] services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] -services-libsql = ["opendal/services-libsql"] [lib] crate-type = ["cdylib"] @@ -141,8 +143,8 @@ napi = { version = "2.11.3", default-features = false, features = [ "async", ] } napi-derive = "2.12.2" -tokio = "1" opendal.workspace = true +tokio = "1" [build-dependencies] napi-build = "2" diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index dca2c5b18729..d34be0d40bdc 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -78,8 +78,9 @@ services-all = [ "services-vercel-artifacts", "services-wasabi", "services-mongodb", + "services-gridfs", "services-sqlite", - "services-libsql" + "services-libsql", ] # Default services provided by opendal. @@ -107,8 +108,10 @@ services-etcd = ["opendal/services-etcd"] services-foundationdb = ["opendal/services-foundationdb"] services-ftp = ["opendal/services-ftp"] services-gdrive = ["opendal/services-gdrive"] +services-gridfs = ["opendal/services-gridfs"] services-hdfs = ["opendal/services-hdfs"] services-ipfs = ["opendal/services-ipfs"] +services-libsql = ["opendal/services-libsql"] services-memcached = ["opendal/services-memcached"] services-mini-moka = ["opendal/services-mini-moka"] services-moka = ["opendal/services-moka"] @@ -128,7 +131,6 @@ services-swift = ["opendal/services-swift"] services-tikv = ["opendal/services-tikv"] services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] -services-libsql = ["opendal/services-libsql"] [lib] crate-type = ["cdylib"]