-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(binding/nodejs): upgrade test behavior and infra (#3297)
* feat: upgrade unit test * chore: update ci file * fix: cr & ci problems * fix: ci * feat: add file header * fix: ci * fix: ci * fix: ci fail * fix: upgrade test * fix: ci * fix: add test * fix: test case name * fix: cr * fix: cr * feat: add ci test config * fix: test logic * fix: test logic * Generate plan for nodejs Signed-off-by: Xuanwo <[email protected]> * Fix typo Signed-off-by: Xuanwo <[email protected]> * Fix working directory Signed-off-by: Xuanwo <[email protected]> * Fix config loading Signed-off-by: Xuanwo <[email protected]> * polish Signed-off-by: Xuanwo <[email protected]> * Fix format Signed-off-by: Xuanwo <[email protected]> * FIx dotenv Signed-off-by: Xuanwo <[email protected]> * Fix tests Signed-off-by: Xuanwo <[email protected]> --------- Signed-off-by: Xuanwo <[email protected]> Co-authored-by: Xuanwo <[email protected]>
- Loading branch information
Showing
21 changed files
with
2,838 additions
and
1,431 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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: Test Core | ||
description: 'Test Core with given setup and service' | ||
inputs: | ||
setup: | ||
description: "The setup action for test" | ||
service: | ||
description: "The service to test" | ||
feature: | ||
description: "The feature to test" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup | ||
shell: bash | ||
run: | | ||
mkdir -p ./dynamic_test_binding_nodejs && | ||
cat <<EOF >./dynamic_test_binding_nodejs/action.yml | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Test | ||
uses: ./.github/services/${{ inputs.service }}/${{ inputs.setup }} | ||
- name: Run Test Binding NodeJS | ||
shell: bash | ||
working-directory: bindings/nodejs | ||
run: | | ||
yarn build:debug | ||
yarn test | ||
env: | ||
NAPI_FEATURES: ${{ inputs.feature }} | ||
OPENDAL_TEST: ${{ inputs.service }} | ||
EOF | ||
- name: Run | ||
uses: ./dynamic_test_binding_nodejs |
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
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,74 @@ | ||
# 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: Behavior Test Binding NodeJS | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
cases: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.cases.service }} / ${{ matrix.cases.setup }} | ||
runs-on: ${{ inputs.os }} | ||
strategy: | ||
matrix: | ||
cases: ${{ fromJson(inputs.cases) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
uses: ./.github/actions/setup | ||
with: | ||
need-nextest: true | ||
need-protoc: true | ||
need-rocksdb: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# TODO: 1password is only supported on linux | ||
# | ||
# Waiting for https://github.com/1Password/load-secrets-action/issues/46 | ||
- name: Setup 1Password Connect | ||
if: runner.os == 'Linux' | ||
uses: 1password/load-secrets-action/configure@v1 | ||
with: | ||
connect-host: ${{ secrets.OP_CONNECT_HOST }} | ||
connect-token: ${{ secrets.OP_CONNECT_TOKEN }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: yarn | ||
cache-dependency-path: "bindings/nodejs/yarn.lock" | ||
- name: Corepack | ||
working-directory: bindings/nodejs | ||
run: corepack enable | ||
- name: Install dependencies | ||
working-directory: bindings/nodejs | ||
run: yarn install --immutable | ||
|
||
- name: Test Core | ||
uses: ./.github/actions/behavior_test_binding_nodejs | ||
with: | ||
setup: ${{ matrix.cases.setup }} | ||
service: ${{ matrix.cases.service }} | ||
feature: ${{ matrix.cases.feature }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.