From 24451f37094b0541b06bbf67bc1511baa61c2eda Mon Sep 17 00:00:00 2001 From: Willi Goesgens Date: Mon, 2 Mar 2015 19:09:28 +0100 Subject: [PATCH] Testsuite: - add possibility to skip ruby https tests - try to send test results from arangosh to server via a temporary file; fallback to rc. --- js/common/modules/org/arangodb/testrunner.js | 8 ++++++-- js/server/modules/org/arangodb/testing.js | 14 +++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/js/common/modules/org/arangodb/testrunner.js b/js/common/modules/org/arangodb/testrunner.js index 814ba12106..643b66f9ce 100644 --- a/js/common/modules/org/arangodb/testrunner.js +++ b/js/common/modules/org/arangodb/testrunner.js @@ -14,6 +14,8 @@ var runTest = require('jsunity').runTest, runJSUnityTests = function (tests) { 'use strict'; var result = true; + var allResults = []; + var res; _.each(tests, function (file) { // find out whether we're on server or client... @@ -30,7 +32,9 @@ runJSUnityTests = function (tests) { } try { - result = result && runTest(file).status; + res = runTest(file); + allResults.push(res); + result = result && res.status; } catch (err) { print(runenvironment + ": cannot run test file '" + file + "': " + err); print(err.stack); @@ -40,7 +44,7 @@ runJSUnityTests = function (tests) { internal.wait(0); // force GC }); - + require("fs").write("testresult.json", JSON.stringify(allResults)); return result; }; diff --git a/js/server/modules/org/arangodb/testing.js b/js/server/modules/org/arangodb/testing.js index 526fcae67f..2d1f6ab8e6 100644 --- a/js/server/modules/org/arangodb/testing.js +++ b/js/server/modules/org/arangodb/testing.js @@ -60,6 +60,7 @@ var optionsDocumentation = [ ' - `skipAql`: if set to true the AQL tests are skipped', ' - `skipRanges`: if set to true the ranges tests are skipped', ' - `skipTimeCritical`: if set to true, time critical tests will be skipped.', + ' - `skipSsl`: ommit the ssl_server rspec tests.', '', ' - `cluster`: if set to true the tests are run with the coordinator', ' of a small local cluster', @@ -777,7 +778,15 @@ function runInArangosh (options, instanceInfo, file, addArgs) { args = args.concat(addArgs); } var arangosh = fs.join("bin","arangosh"); - return executeAndWait(arangosh, args); + var result; + var rc = executeAndWait(arangosh, args); + try { + result = JSON.parse(fs.read("testresult.json")); + } + catch(x) { + return rc; + } + return result[0]; } function runArangoshCmd (options, instanceInfo, cmds) { @@ -1228,6 +1237,9 @@ testFuncs.http_server = function (options) { }; testFuncs.ssl_server = function (options) { + if (options.hasOwnProperty('skipSsl')) { + return {}; + } return rubyTests(options, true); };