You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "eryue0220 (via GitHub)" <gi...@apache.org> on 2023/10/16 07:31:13 UTC

[PR] test(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

eryue0220 opened a new pull request, #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297

   Related: #3066 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1360846019


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   The test suite could not receive the custom args from the cli or `ctx` from the test framework. 
   
   A tricky way is binding the scheme to the test file name, but I think it's worst than hardcode.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1788913248

   > THank you @eryue0220!
   
   Welcome. I appricate the opendal WG and your effort. I also really learned more from this contribution experience. Finally, this is my first Apache PR, achieve.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1772082704

   Currently, the scheme and config will be loaded from the `.env` configuration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1360353517


##########
bindings/nodejs/package.json:
##########
@@ -64,7 +64,7 @@
     "build:debug": "napi build --platform --target \"${NAPI_TARGET:-}\" --js generated.js && node ./scripts/header.js",
     "docs": "typedoc",
     "format": "prettier --write .",
-    "test": "cucumber-js",
+    "test": "NODE_ENV=test & vitest",

Review Comment:
   Remove `NODE_ENV`.



##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   We should not hardcode scheme here. Our test framework should access the scheme from input like `vitest memory` or `vitest s3`.



##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })
+const encoder = new TextEncoder()
+const content = 'Hello, World!'
+const encodeContent = encoder.encode(content)

Review Comment:
   Apologies for the confusion. I mean that we should utilize random bytes instead of manually writing "Hello, World!".



##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })
+const encoder = new TextEncoder()
+const content = 'Hello, World!'
+const encodeContent = encoder.encode(content)
+
+test('sync IO test case', () => {
+  const filename = `random_file_${Math.floor(Math.random() * 10) + 1}`

Review Comment:
   It's better to use `uuid`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1366602501


##########
bindings/nodejs/tests/memory.test.mjs:
##########
@@ -0,0 +1,22 @@
+/*
+ * 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 { runner } from './suites/index.mjs'
+
+runner('OpenDal Memory Test suites', 'memory')

Review Comment:
   This is not we want. The logic is like the following:
   
   - Load `OPENDAL_TEST` as scheme.
   - Init operator via given scheme and configuration read from env.
   - Using this operator to do test.



##########
bindings/nodejs/tests/suites/index.mjs:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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 { describe } from 'vitest'
+import { Operator } from '../../index.js'
+import { loadConfigFromEnv } from '../utils.mjs'
+
+import { run as AsyncIOTestRun } from './async.suite.mjs'
+import { run as MetaTestRun } from './meta.suite.mjs'
+import { run as SyncIOTestRun } from './sync.suite.mjs'
+
+export function runner(testName, scheme) {
+    const config = loadConfigFromEnv(scheme)
+    const operator = scheme ? new Operator(scheme, { root: '/tmp', ...config }) : undefined

Review Comment:
   root should not be hardcoded.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1774425836

   > Thus, all the test cases will be omitted in local environment and `ci` environment?
   
   For local testing, users need to correctly set `OPENDAL_TEST`. In CI, our new testing planner will ensure that `OPENDAL_TEST` is configured. If `OPENDAL_TEST` isn't present, we'll bypass all behavior tests and only run unit tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1378631837


##########
bindings/nodejs/tests/utils.mjs:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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 'dotenv/config'
+
+export function generateBytes() {
+    const size = Math.floor(Math.random() * 1024) + 1
+    const content = []
+
+    for (let i = 0; i < size; i++) {
+        content.push(Math.floor(Math.random() * 256))
+    }
+
+    return Buffer.from(content)
+}
+
+export function loadTestSchemeFromEnv() {
+    return process.env.OPENDAL_TEST
+}
+
+export function loadConfigFromEnv(scheme) {
+    if (!scheme) return {}
+
+    const prefix = `opendal_${scheme}_`
+
+    return Object.fromEntries(
+        Object.entries(process.env)
+            .map(([key, value]) => [key.toLowerCase(), value])
+            .filter(([key]) => key.startsWith(prefix)),

Review Comment:
   Yep.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1360952047


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   Hi, thanks for the contribution, but this feature is required.
   
   As you may have noticed, OpenDAL supports over 30 services, all of which need to be tested. Our developers will create local `.env` files, and the GitHub action will be set up using environment variables.
   
   We expect to run tests such as `whatever s3` or `whatever fs`, so that we can maintain a consistent calling convention that benefits both the development experience and the automatic generation of GitHub actions. It is not acceptable to merge a test framework that only runs the `memory` service tests.
   
   Can we have different test classes which represent different services? Or we can switch to other frameworks?



##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   Hi, thanks for the contribution, but this feature is required.
   
   As you may have noticed, OpenDAL supports over 30 services, all of which need to be tested. Our developers will create local `.env` files, and the GitHub action will be set up using environment variables. We expect to run tests such as `whatever s3` or `whatever fs`, so that we can maintain a consistent calling convention that benefits both the development experience and the automatic generation of GitHub actions. It is not acceptable to merge a test framework that only runs the `memory` service tests.
   
   Can we have different test classes which represent different services? Or we can switch to other frameworks?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1772278465

   Hi, @eryue0220, I apologize for the length of this PR and the numerous changes it has undergone. Our ideas are inpired a lot by your contributions like the introduce of `OPENDAL_TEST`.
   
   I've written this comment to clarify the current design. Please let me know if anything remains unclear. Let's get start.
   
   ---
   
   OpenDAL is a data access layer that allows users to easily and efficiently retrieve data from various storage services in a unified way.
   
   We will accept configruations to build an `Operator`. Our tests is used to simulate the process and test like real users. Additionally, we have over 40 services to test currently. Therefore, we need a generalized method to initiate the operator and evaluate it using the same test suites.
   
   So our design looks the following:
   
   - Test framework should read `OPENDAL_TEST` as `scheme`.
   - Test framework should read all envs that starts with `OPENDAL_{scheme}_`
   - To make our developement easier, test framework should also support `dotenv` at `{root}/.env`
   - Test framework should build the `Operator` with given config.
   - Test framework should pass the built `Operator` to all test cases.
   
   As of current changes, we should:
   
   - Don't set `root` to `/tmp` since `root` is part of our config.
   - Don't create `fs.test.mjs` since we will use `OPENDAL_TEST` instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1361505450


##########
bindings/nodejs/package.json:
##########
@@ -64,7 +64,7 @@
     "build:debug": "napi build --platform --target \"${NAPI_TARGET:-}\" --js generated.js && node ./scripts/header.js",
     "docs": "typedoc",
     "format": "prettier --write .",
-    "test": "cucumber-js",
+    "test": "SCHEME=memory vitest",

Review Comment:
   You're still hard-coding `memory`. 
   we'll have to get this externally. 
   If you don't provide a scheme, skip the test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1360236497


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+// Config will be loaded from `../.env.test` file
+const config = {

Review Comment:
   We should not configure services one by one. They should be able to read env without mapping. How about using https://www.npmjs.com/package/dotenv?



##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+// Config will be loaded from `../.env.test` file
+const config = {
+  AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID,
+  AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY,
+  AWS_S3_REGION: process.env.AWS_S3_REGION,
+  AWS_S3_ENDPOINT: process.env.AWS_S3_ENDPOINT,
+  AWS_BUCKET: process.env.AWS_BUCKET,
+}
+
+test('sync IO test case', () => {
+  const operator = new Operator('memory', { root: '/tmp', ...config })
+  const filename = `random_file_${Math.floor(Math.random() * 10) + 1}`
+  const content = 'Hello, World!'

Review Comment:
   content should be bytes intead of UTF-8 string.



##########
bindings/nodejs/index.js:
##########
@@ -19,6 +19,17 @@
 
 /// <reference types="node" />
 
+const { existsSync } = require('fs')
 const { Operator } = require('./generated.js')
 
+process.env.NODE_ENV = process.env.NODE_ENV || 'development'
+
+require("dotenv").config({
+  path: process.env.NODE_ENV === 'production'
+    ? '.env'
+    : existsSync(`.env.${process.env.NODE_ENV}.local`)

Review Comment:
   We don't need this feature.



##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+// Config will be loaded from `../.env.test` file
+const config = {
+  AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID,
+  AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY,
+  AWS_S3_REGION: process.env.AWS_S3_REGION,
+  AWS_S3_ENDPOINT: process.env.AWS_S3_ENDPOINT,
+  AWS_BUCKET: process.env.AWS_BUCKET,
+}
+
+test('sync IO test case', () => {
+  const operator = new Operator('memory', { root: '/tmp', ...config })

Review Comment:
   We should be able to test services that enabled in `.env` instead of by hardcoding.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1774422657

   > > I think read the `scheme` properties from the `.env` is ok
   > 
   > scheme should only be fetched from `OPENDAL_TEST` which is not included in `.env`. Users who want to do behavior test must specify a valid `OPENDAL_TEST`.
   
   Sorry for late response. 
   
   Thus,  all the test cases will be omitted in local environment and `ci` environment?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1775449452

   > > Thus, all the test cases will be omitted in local environment and `ci` environment?
   > 
   > For local testing, users need to correctly set `OPENDAL_TEST`. In CI, our new testing planner will ensure that `OPENDAL_TEST` is configured. If `OPENDAL_TEST` isn't present, we'll bypass all behavior tests and only run unit tests.
   > 
   > For example:
   > 
   > https://github.com/apache/incubator-opendal/blob/c1c7f9464748a11f5eb8351ea5ef1089a8bfedfb/.github/actions/behavior_test_core/action.yaml#L41-L46
   
   Thanks for the details. I'll upgrade to follow this feature.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1366495314


##########
bindings/nodejs/tests/suites/sync.suite.mjs:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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 { randomUUID } from 'node:crypto'
+import { expect, test } from 'vitest'
+import { generateBytes } from '../utils.mjs'
+
+export function run(operator) {
+    test('async io test case', () => {

Review Comment:
   ```suggestion
       test('sync io test case', () => {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1361943988


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { randomUUID } from 'node:crypto'
+import { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+import { generateBytes } from './utils.js'
+
+const operator = new Operator(process.env.SCHEME, { root: '/tmp' })

Review Comment:
   I prefer using `OPENDAL_TEST` over `SCHEME`. Another issue is that the configuration isn't loading from the environment. We need to load all environments starting with `OPENDAL_XXX_{KEY}` as configuration here.



##########
bindings/nodejs/generated.js:
##########
@@ -36,7 +36,7 @@ function isMusl() {
   // For Node 10
   if (!process.report || typeof process.report.getReport !== 'function') {
     try {
-      const lddPath = require('child_process').execSync('which ldd').toString().trim();
+      const lddPath = require('child_process').execSync('which ldd').toString().trim()

Review Comment:
   Please don't change this file by hand.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1363048499


##########
bindings/nodejs/generated.js:
##########
@@ -36,7 +36,7 @@ function isMusl() {
   // For Node 10
   if (!process.report || typeof process.report.getReport !== 'function') {
     try {
-      const lddPath = require('child_process').execSync('which ldd').toString().trim();
+      const lddPath = require('child_process').execSync('which ldd').toString().trim()

Review Comment:
   I did not change it. Just ran `yarn build` and regenerated it, if I didn't commit this, the ci will occur an error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1360952047


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   Hi, thanks for the contribution, but this feature is required.
   
   As you may have noticed, OpenDAL supports over 30 services, all of which need to be tested. Our developers will create local `.env` files, and the GitHub action will be set up using environment variables.
   
   We expect to run tests such as `whatever s3` or `whatever fs`, so that we can maintain a consistent calling convention that benefits both the development experience and the automatic generation of GitHub actions.
   
   Can we have different test classes which represent different services? Or we can switch to other frameworks?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1361422113


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   I changed another method maybe can achieve this requirement.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1772473829

   Hi, @Xuanwo Thank you for your patient and explaining the details for me. I'm the new guy for this project. Most of the designs I understood, but some questions about the `scheme`.
   
   I think read the `scheme` properties from the `.env` is ok, but currently the project omit the `.env` file, thus will occur all the tests will be ignore when running in `ci` environment, and it might have no senses for the tests. so I added `memory.test.js` file for the test.
   
   Secondly, set test from `.env` just only support one scheme of the thirty, and some others may not ignorance, and every scheme test needs to update the `.env`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1772483585

   > I think read the `scheme` properties from the `.env` is ok
   
   scheme should only be fetched from `OPENDAL_TEST` which is not included in `.env`. Users who want to do behavior test must specify a valid `OPENDAL_TEST`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1374076580


##########
bindings/nodejs/tests/suites/index.mjs:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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 { describe } from 'vitest'
+import { Operator } from '../../index.js'
+import { loadConfigFromEnv } from '../utils.mjs'
+
+import { run as AsyncIOTestRun } from './async.suite.mjs'
+import { run as MetaTestRun } from './meta.suite.mjs'
+import { run as SyncIOTestRun } from './sync.suite.mjs'
+
+export function runner(testName, scheme) {

Review Comment:
   We can return here directly if scheme is empty. Otherwise, we should return an error instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1378600305


##########
bindings/nodejs/tests/utils.mjs:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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 'dotenv/config'
+
+export function generateBytes() {
+    const size = Math.floor(Math.random() * 1024) + 1
+    const content = []
+
+    for (let i = 0; i < size; i++) {
+        content.push(Math.floor(Math.random() * 256))
+    }
+
+    return Buffer.from(content)
+}
+
+export function loadTestSchemeFromEnv() {
+    return process.env.OPENDAL_TEST
+}
+
+export function loadConfigFromEnv(scheme) {
+    if (!scheme) return {}
+
+    const prefix = `opendal_${scheme}_`
+
+    return Object.fromEntries(
+        Object.entries(process.env)
+            .map(([key, value]) => [key.toLowerCase(), value])
+            .filter(([key]) => key.startsWith(prefix)),

Review Comment:
   Seems we didn't remove the prefix. And we didn't handle the `OPENDAL_DISABLE_RAMDOM_ROOT`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1788628061

   Hi, @eryue0220, this PR is almost set. Can I directly push some additional changes to this PR to align it with the modifications we've made for the main branch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1788762756

   Apologies for the length of this PR, it has taken @eryue0220 more time than anticipated.
   
   I learnt some lessons from this PR:
   
   - Don't start work too soon: It's better to discuss about the details first especially for complex work and new contributors like this one.
   - Don't push work too large: It's better to split work in different PRs instead of a huge one.
   
   I believe that we could make the exprience much better if we:
   
   - Implement the test framework first
   - Integrate with the simplest test case to make sure it works
   - Expand to all services
   - Remove old tests
   
   Regardless, thank you @eryue0220 for your patience and hard work! I promise that we will make the exprience better :heart:


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1788743697

   This feature still have a lot work to do:
   
   - implement capability
   - implement OPENDAL_DISABLE_RAMDOM_ROOT
   
   But this PR is large enough that I removed not passing test cases to make it mergable first. We can improve it in the coming PRs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#issuecomment-1788633350

   > most set. Can I directly push some additional changes to this PR to align it with the modifications we've made for the main bra
   
   Yeah, for sure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1363050365


##########
bindings/nodejs/generated.js:
##########
@@ -36,7 +36,7 @@ function isMusl() {
   // For Node 10
   if (!process.report || typeof process.report.getReport !== 'function') {
     try {
-      const lddPath = require('child_process').execSync('which ldd').toString().trim();
+      const lddPath = require('child_process').execSync('which ldd').toString().trim()

Review Comment:
   Got it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(binding/nodejs): upgrade test behavior and infra [incubator-opendal]

Posted by "eryue0220 (via GitHub)" <gi...@apache.org>.
eryue0220 commented on code in PR #3297:
URL: https://github.com/apache/incubator-opendal/pull/3297#discussion_r1360846019


##########
bindings/nodejs/tests/test_service.test.js:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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 { expect, test } from 'vitest'
+import { Operator } from '../index.js'
+
+const operator = new Operator('memory', { root: '/tmp' })

Review Comment:
   The test suite could not received the custom args from the cli or `ctx` from the test framework. 
   
   A tricky way is binding the scheme to the test file name, but I think it's worst than hardcode.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org