From 347d17e4c4113c16e72ffb879770eb48fccb4c2f Mon Sep 17 00:00:00 2001 From: Manjusaka Date: Mon, 23 Oct 2023 23:13:09 +0800 Subject: [PATCH 1/2] refactor(services/sqlite): Migrate sqlite task to new behavior test planner Signed-off-by: Manjusaka --- .github/services/sqlite/sqlite/action.yml | 36 +++++++++++++ .github/workflows/service_test_sqlite.yml | 65 ----------------------- 2 files changed, 36 insertions(+), 65 deletions(-) create mode 100644 .github/services/sqlite/sqlite/action.yml delete mode 100644 .github/workflows/service_test_sqlite.yml diff --git a/.github/services/sqlite/sqlite/action.yml b/.github/services/sqlite/sqlite/action.yml new file mode 100644 index 000000000000..e5d3e6c47777 --- /dev/null +++ b/.github/services/sqlite/sqlite/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: sqlite +description: 'Behavior test for sqlite' + +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 diff --git a/.github/workflows/service_test_sqlite.yml b/.github/workflows/service_test_sqlite.yml deleted file mode 100644 index 0069ccd75b2c..000000000000 --- a/.github/workflows/service_test_sqlite.yml +++ /dev/null @@ -1,65 +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 Sqlite - -on: - push: - branches: - - main - pull_request: - branches: - - main - paths: - - "core/src/**" - - "core/tests/**" - - "!core/src/docs/**" - - "!core/src/services/**" - - "core/src/services/sqlite/**" - - ".github/workflows/service_test_sqlite.yml" - - "fixtures/sqlite/**" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - sqlite: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Sqlite - shell: bash - working-directory: fixtures/sqlite - run: mkdir -p /tmp/opendal && sqlite3 /tmp/opendal/test.db < data.sql - - - 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 services-sqlite - env: - OPENDAL_TEST: sqlite - OPENDAL_SQLITE_CONNECTION_STRING: file:///tmp/opendal/test.db - OPENDAL_SQLITE_TABLE: data - OPENDAL_SQLITE_KEY_FIELD: key - OPENDAL_SQLITE_VALUE_FIELD: data From 1a53c9f6b6fcb1bb2f2a5e13e574350a7b28eaa1 Mon Sep 17 00:00:00 2001 From: Manjusaka Date: Mon, 23 Oct 2023 23:35:41 +0800 Subject: [PATCH 2/2] Update code Signed-off-by: Manjusaka --- bindings/java/Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bindings/java/Cargo.toml b/bindings/java/Cargo.toml index 7a6a4792067b..df1ca7e66dd2 100644 --- a/bindings/java/Cargo.toml +++ b/bindings/java/Cargo.toml @@ -81,6 +81,7 @@ services-all = [ "services-vercel-artifacts", "services-wasabi", "services-mongodb", + "services-sqlite", ] # Default services provided by opendal. @@ -127,6 +128,7 @@ services-vercel-artifacts = ["opendal/services-vercel-artifacts"] services-wasabi = ["opendal/services-wasabi"] services-mysql = ["opendal/services-mysql"] services-mongodb = ["opendal/services-mongodb"] +services-sqlite = ["opendal/services-sqlite"] [dependencies] anyhow = "1.0.71"