This is an automated email from the ASF dual-hosted git repository.

suyanhanx pushed a commit to branch random-root-nodejs-test
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/random-root-nodejs-test by 
this push:
     new c4835562d fix
c4835562d is described below

commit c4835562d6a4a36a131de384a60df6f2d01d96d5
Author: suyanhanx <[email protected]>
AuthorDate: Wed Nov 1 19:45:01 2023 +0800

    fix
    
    Signed-off-by: suyanhanx <[email protected]>
---
 bindings/nodejs/tests/suites/index.mjs | 2 +-
 bindings/nodejs/tests/utils.mjs        | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bindings/nodejs/tests/suites/index.mjs 
b/bindings/nodejs/tests/suites/index.mjs
index 7ed5f613e..5a25bfc3d 100644
--- a/bindings/nodejs/tests/suites/index.mjs
+++ b/bindings/nodejs/tests/suites/index.mjs
@@ -33,7 +33,7 @@ export function runner(testName, scheme) {
   const config = loadConfigFromEnv(scheme)
 
   if (checkRandomRootEnabled()) {
-    config.root = generateRandomRoot()
+    config.root = generateRandomRoot(config.root)
   }
 
   const operator = scheme ? new Operator(scheme, config) : undefined
diff --git a/bindings/nodejs/tests/utils.mjs b/bindings/nodejs/tests/utils.mjs
index 8998f6cd1..4c5292ddd 100644
--- a/bindings/nodejs/tests/utils.mjs
+++ b/bindings/nodejs/tests/utils.mjs
@@ -35,11 +35,11 @@ export function loadTestSchemeFromEnv() {
 }
 
 export function checkRandomRootEnabled() {
-  return process.env.OPENDAL_DISABLE_RANDOM_ROOT !== 'false'
+  return process.env.OPENDAL_DISABLE_RANDOM_ROOT === 'true'
 }
 
-export function generateRandomRoot() {
-  return `/opendal_${crypto.randomUUID()}`
+export function generateRandomRoot(baseRoot) {
+  return `${baseRoot}/opendal_${crypto.randomUUID()}`
 }
 
 export function loadConfigFromEnv(scheme) {

Reply via email to