From d9057ad695772a20b256300ba4c9abd821fb5983 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 29 Jul 2019 14:56:22 +0200 Subject: [PATCH] fix runInArangosh result evaluation (#9589) --- js/client/modules/@arangodb/test-utils.js | 10 +++++++--- js/client/modules/@arangodb/testsuites/recovery.js | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/js/client/modules/@arangodb/test-utils.js b/js/client/modules/@arangodb/test-utils.js index bf62222563..9a79a4861e 100755 --- a/js/client/modules/@arangodb/test-utils.js +++ b/js/client/modules/@arangodb/test-utils.js @@ -687,7 +687,7 @@ function runThere (options, instanceInfo, file) { } runThere.info = 'runThere'; -function readTestResult(path, rc) { +function readTestResult(path, rc, testCase) { const jsonFN = fs.join(path, 'testresult.json'); let buf; try { @@ -732,7 +732,11 @@ function readTestResult(path, rc) { return rc; } } else if (_.isObject(result)) { - return result; + if ((testCase !== undefined) && result.hasOwnProperty(testCase)) { + return result[testCase]; + } else { + return result; + } } else { rc.failed = rc.status ? 0 : 1; rc.message = "don't know howto handle '" + buf + "'"; @@ -766,7 +770,7 @@ function runInArangosh (options, instanceInfo, file, addArgs) { } require('internal').env.INSTANCEINFO = JSON.stringify(instanceInfo); let rc = pu.executeAndWait(pu.ARANGOSH_BIN, toArgv(args), options, 'arangosh', instanceInfo.rootDir, false, options.coreCheck); - return readTestResult(instanceInfo.rootDir, rc); + return readTestResult(instanceInfo.rootDir, rc, args['javascript.unit-tests']); } runInArangosh.info = 'arangosh'; diff --git a/js/client/modules/@arangodb/testsuites/recovery.js b/js/client/modules/@arangodb/testsuites/recovery.js index 3eb51900b1..6faa441a6e 100644 --- a/js/client/modules/@arangodb/testsuites/recovery.js +++ b/js/client/modules/@arangodb/testsuites/recovery.js @@ -197,7 +197,8 @@ function recovery (options) { params.args['temp.path'], { status: false - } + }, + test ); if (!results[test].status) { print("Not cleaning up " + params.testDir);