mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
76fdd17d6b
|
@ -2916,4 +2916,29 @@ background-color: rgba(240,240,0,0.4);
|
|||
|
||||
.book .book-body .page-wrapper .page-inner section.normal .deprecated pre{
|
||||
background-color: rgba(240,240,0,0.4);
|
||||
}
|
||||
|
||||
#clear-search {
|
||||
display: inline;
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 9px;
|
||||
font-size: 18pt;
|
||||
line-height: 18pt;
|
||||
color: #364149; // needs to be updated on theme change
|
||||
}
|
||||
|
||||
#clear-search:hover {
|
||||
color: #008cff; // needs to be updated on theme change
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.book .book-summary .book-search input{
|
||||
padding-right: 20px !important;
|
||||
}
|
||||
|
||||
.book .book-header {
|
||||
background-color: #FFFFFF !important;
|
||||
width: 84%;
|
||||
position:fixed !important;
|
||||
}
|
|
@ -10,50 +10,9 @@
|
|||
</a>
|
||||
{% include "./font-settings.html" %}
|
||||
</div>
|
||||
|
||||
<!-- Actions Right (Disabled dropdown for social links)
|
||||
{% if options.links.sharing.all !== false %}
|
||||
<div class="dropdown pull-right">
|
||||
<a href="#" class="btn toggle-dropdown" aria-label="Toggle share dropdown"><i class="fa fa-share-alt"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu font-settings dropdown-left">
|
||||
<div class="dropdown-caret">
|
||||
<span class="caret-outer"></span>
|
||||
<span class="caret-inner"></span>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button type="button" data-sharing="twitter" class="button">Twitter</button>
|
||||
<button type="button" data-sharing="google-plus" class="button">Google</button>
|
||||
<button type="button" data-sharing="facebook" class="button">Facebook</button>
|
||||
<button type="button" data-sharing="weibo" class="button">Weibo</button>
|
||||
<button type="button" data-sharing="instapaper" class="button">Instapaper</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
-->
|
||||
<!-- Disabled social buttons
|
||||
{% if options.links.sharing.google !== false %}
|
||||
<a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a>
|
||||
{% endif %}
|
||||
{% if options.links.sharing.facebook !== false %}
|
||||
<a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Share on Facebook"><i class="fa fa-facebook"></i></a>
|
||||
{% endif %}
|
||||
{% if options.links.sharing.weibo === true %}
|
||||
<a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="weibo" aria-label="Share on Weibo"><i class="fa fa-weibo"></i></a>
|
||||
{% endif %}
|
||||
-->
|
||||
{% if githubId %}
|
||||
<a href="{{ githubHost }}{{ githubId }}/stargazers" target="_blank" class="btn pull-right count-star hidden-xs"><i class="fa fa-star-o"></i> Star (<span>-</span>)</a>
|
||||
<a href="{{ githubHost }}{{ githubId }}/watchers" target="_blank" class="btn pull-right count-watch hidden-xs"><i class="fa fa-eye"></i> Watch (<span>-</span>)</a>
|
||||
{% endif %}
|
||||
{% if options.links.sharing.twitter !== false %}
|
||||
<a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Title -->
|
||||
<h1>
|
||||
<i class="fa fa-circle-o-notch fa-spin"></i>
|
||||
<a href="https://www.arangodb.org" target="blank" style="margin-left:5px"> <img src="{{ basePath }}/Arangodb_Logo.png" alt="ArangoDB" style="position:relative; border:0px; top:7px; margin-left:-160px; margin-right:15px">2.2.3</a>
|
||||
</h1>
|
||||
</div>
|
||||
<h1><a href="https://www.arangodb.org" target="blank" style="margin-left:5px"> <img src="{{ basePath }}/Arangodb_Logo.png" alt="ArangoDB" style="position:relative; border:0px; top:7px; margin-left: -80px; margin-right:15px">2.2.3</a></h1>
|
||||
</div>
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
<div class="book-summary">
|
||||
<div class="book-search">
|
||||
<a id="clear-search" href="#">×</a>
|
||||
<input type="text" placeholder="Type to search" class="form-control" />
|
||||
</div>
|
||||
<ul class="summary">
|
||||
|
@ -87,4 +88,10 @@ $(function(){
|
|||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$('#clear-search').on('click', function(event){
|
||||
event.preventDefault();
|
||||
$('.book-search input').val("").trigger("keyup");
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,187 @@
|
|||
ArangoDB Unittesting Framework
|
||||
------------------------------
|
||||
------------------------------
|
||||
------------------------------
|
||||
|
||||
|
||||
|
||||
Filename conventions
|
||||
====================
|
||||
Special patterns in filenames are used to select tests to be executed or skipped depending no parameters:
|
||||
|
||||
-cluster
|
||||
--------
|
||||
These tests will only run if clustering is tested. (option 'cluster' needs to be true).
|
||||
|
||||
-noncluster
|
||||
-----------
|
||||
These tests will only run if no cluster is used. (option 'cluster' needs to be false)
|
||||
|
||||
-timecritical
|
||||
-------------
|
||||
These tests are critical to execution time - and thus may fail if arangod is to slow. This may happen i.e. if you run the tests in valgrind, so you want to avoid them. To skip them, set the option 'skipTimeCritical' to true.
|
||||
|
||||
-disabled
|
||||
---------
|
||||
These tests are disabled. You may however want to run them by hand.
|
||||
|
||||
replication
|
||||
-----------
|
||||
(only applies to ruby tests)
|
||||
These tests aren't run automaticaly since they require a manual set up environment.
|
||||
|
||||
-spec
|
||||
-----
|
||||
These tests are ran using the jasmine framework instead of jsunity.
|
||||
|
||||
Test frameworks used
|
||||
====================
|
||||
There are several major places where unittests live:
|
||||
- UnitTests/HttpInterface
|
||||
- UnitTests/Basics
|
||||
- UnitTests/Geo
|
||||
- js/server/tests
|
||||
- js/common/tests
|
||||
- js/common/test-data
|
||||
- /js/apps/system/aardvark/test
|
||||
|
||||
|
||||
HttpInterface - RSpec Client Tests
|
||||
---------------------------------
|
||||
TODO: which tests are these?
|
||||
|
||||
|
||||
jsUnity on arangod
|
||||
------------------
|
||||
|
||||
jsUnity via arangosh
|
||||
--------------------
|
||||
|
||||
|
||||
|
||||
|
||||
jasmine tests
|
||||
-------------
|
||||
|
||||
Jasmine tests cover two important usecase:
|
||||
- testing the UI components of aardvark
|
||||
-spec
|
||||
|
||||
aardvark
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
UnitTests/Makefile.unittests
|
||||
|
||||
|
||||
Invocation methods
|
||||
==================
|
||||
|
||||
|
||||
|
||||
Make-targets
|
||||
------------
|
||||
(used in travis CI integration)
|
||||
Most of the tests can be invoked via the main Makefile:
|
||||
- unittests
|
||||
- unittests-brief
|
||||
- unittests-verbose
|
||||
- unittests-recovery
|
||||
- unittests-config
|
||||
- unittests-boost
|
||||
- unittests-single
|
||||
- unittests-shell-server
|
||||
- unittests-shell-server-only
|
||||
- unittests-shell-server-ahuacatl
|
||||
- unittests-shell-client-readonly
|
||||
- unittests-shell-client
|
||||
- unittests-http-server
|
||||
- unittests-ssl-server
|
||||
- unittests-import
|
||||
- unittests-replication
|
||||
- unittests-replication-server
|
||||
- unittests-replication-http
|
||||
- unittests-replication-data
|
||||
- unittests-upgrade
|
||||
- unittests-dfdb
|
||||
- unittests-foxx-manager
|
||||
- unittests-dump
|
||||
- unittests-arangob
|
||||
- unittests-authentication
|
||||
- unittests-authentication-parameters
|
||||
|
||||
|
||||
Javascript framework
|
||||
--------------------
|
||||
(used in Jenkins integration)
|
||||
Invoked like that:
|
||||
scripts/run scripts/unittest.js all
|
||||
|
||||
Choosing facility
|
||||
_________________
|
||||
|
||||
The first parameter chooses the facility to execute.
|
||||
Available choices include:
|
||||
- all: (calls multiple) This target is utilized by most of the jenkins builds invoking unit tests.
|
||||
- single_client: (see Running a single unittestsuite)
|
||||
|
||||
- single_server: (see Running a single unittestsuite)
|
||||
- many more - call without arguments for more details.
|
||||
|
||||
|
||||
Passing Options
|
||||
_______________
|
||||
|
||||
Options are passed in as one json; Please note that formating blanks may cause problems.
|
||||
|
||||
so a commandline for running a single test using valgrind could look like this:
|
||||
|
||||
scripts/run scripts/unittest.js single_server \
|
||||
'{"test":"js/server/tests/aql-escaping.js",'\
|
||||
'"extraargs":["--server.threads=1",'\
|
||||
'"--scheduler.threads=1",'\
|
||||
'"--javascript.gc-frequency","1000000",'\
|
||||
'"--javascript.gc-interval","65536"],'\
|
||||
'"valgrind":"/usr/bin/valgrind",'\
|
||||
'"valgrindargs":["--log-file=/tmp/valgrindlog.%p"]}'
|
||||
|
||||
- we specify the test to execute
|
||||
- we specify some arangod arguments which increase the server performance
|
||||
- we specify to run using valgrind
|
||||
- we specify some valgrind commandline arguments
|
||||
|
||||
Running a single unittestsuite
|
||||
------------------------------
|
||||
Testing a single test with the frame work directly on a server:
|
||||
scripts/run scripts/unittest.js single_server '{"test":"js/server/tests/aql-escaping.js"}'
|
||||
|
||||
Testing a single test with the frame work via arangosh:
|
||||
scripts/run scripts/unittest.js single_client '{"test":"js/server/tests/aql-escaping.js"}'
|
||||
|
||||
unittest.js is mostly only a wrapper; The backend functionality lives in:
|
||||
js/server/modules/org/arangodb/testing.js
|
||||
|
||||
|
||||
|
||||
arangod Emergency console
|
||||
-------------------------
|
||||
|
||||
require("jsunity").runTest("js/server/tests/aql-escaping.js");
|
||||
|
||||
arangosh client
|
||||
---------------
|
||||
|
||||
require("jsunity").runTest("js/server/tests/aql-escaping.js");
|
||||
|
||||
|
||||
arangod commandline arguments
|
||||
-----------------------------
|
||||
|
||||
bin/arangod /tmp/dataUT --javascript.unit-tests="js/server/tests/aql-escaping.js" --no-server
|
||||
|
||||
|
||||
make unittest
|
||||
|
||||
js/common/modules/loadtestrunner.js
|
|
@ -35,57 +35,51 @@
|
|||
/// This function gets one or two arguments, the first describes which tests
|
||||
/// to perform and the second is an options object. For `which` the following
|
||||
/// values are allowed:
|
||||
///
|
||||
/// - "all": do all tests
|
||||
/// - "config"
|
||||
/// - "boost"
|
||||
/// - "shell_server"
|
||||
/// - "shell_server_ahuacatl"
|
||||
/// - "shell_server_aql"
|
||||
/// - "shell_server_perf": bulk tests intended to get an overview of executiontime needed.
|
||||
/// - "http_server"
|
||||
/// - "ssl_server"
|
||||
/// - "shell_client"
|
||||
/// - "single_client" : run one test suite isolated via the arangosh
|
||||
/// - "single_server" : run one test suite on the server
|
||||
/// - "dump"
|
||||
/// - "arangob"
|
||||
/// - "import"
|
||||
/// - "upgrade"
|
||||
/// - "dfdb"
|
||||
/// - "foxx-manager"
|
||||
/// - "authentication"
|
||||
/// - "authentication-parameters
|
||||
/// - "single": convenience to execute a single test file
|
||||
///
|
||||
/// The following properties of `options` are defined:
|
||||
///
|
||||
/// - `jsonReply`: if set a json is returned which the caller has to
|
||||
/// present the user
|
||||
/// - `force`: if set to true the tests are continued even if one fails
|
||||
/// - `skipBoost`: if set to true the boost unittests are skipped
|
||||
/// - `skipGeo`: if set to true the geo index tests are skipped
|
||||
/// - `skipAhuacatl`: if set to true the ahuacatl tests are skipped
|
||||
/// - `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.
|
||||
/// - `valgrind`: if set to true the arangods are run with the valgrind
|
||||
/// memory checker
|
||||
/// - `valgrindXmlFileBase`: string to prepend to the xml report name
|
||||
/// - `valgrindargs`: commandline parameters to add to valgrind
|
||||
/// - `extraargs`: extra commandline arguments to add to arangod
|
||||
/// - `cluster`: if set to true the tests are run with the coordinator
|
||||
/// of a small local cluster
|
||||
/// - `test`: path to single test to execute for "single" test target
|
||||
/// - `cleanup`: if set to true (the default), the cluster data files
|
||||
/// and logs are removed after termination of the test.
|
||||
/// - `jasmineReportFormat`: this option is passed on to the `format`
|
||||
/// option of the Jasmin options object, only for Jasmin tests.
|
||||
/// Empty will give you a complete list.
|
||||
var functionDoku = {
|
||||
'all' : " do all tests (marked with [x])",
|
||||
"shell_server_perf" : "bulk tests intended to get an overview of executiontime needed.",
|
||||
"single_client" : "run one test suite isolated via the arangosh; options required\n" +
|
||||
" Run without to get more detail",
|
||||
"single_server" : "run one test suite on the server; options required\n" +
|
||||
" Run without to get more detail"
|
||||
};
|
||||
|
||||
var optiondoku = [
|
||||
'',
|
||||
' The following properties of `options` are defined:',
|
||||
'',
|
||||
' - `jsonReply`: if set a json is returned which the caller has to ',
|
||||
' present the user',
|
||||
' - `force`: if set to true the tests are continued even if one fails',
|
||||
' - `skipBoost`: if set to true the boost unittests are skipped',
|
||||
' - `skipGeo`: if set to true the geo index tests are skipped',
|
||||
' - `skipAhuacatl`: if set to true the ahuacatl tests are skipped',
|
||||
' - `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.',
|
||||
'',
|
||||
' - `cluster`: if set to true the tests are run with the coordinator',
|
||||
' of a small local cluster',
|
||||
' - `test`: path to single test to execute for "single" test target',
|
||||
' - `cleanup`: if set to true (the default), the cluster data files',
|
||||
' and logs are removed after termination of the test.',
|
||||
' - `jasmineReportFormat`: this option is passed on to the `format`',
|
||||
' option of the Jasmin options object, only for Jasmin tests.',
|
||||
'',
|
||||
' - `valgrind`: if set to true the arangods are run with the valgrind',
|
||||
' memory checker',
|
||||
' - `valgrindXmlFileBase`: string to prepend to the xml report name',
|
||||
' - `valgrindargs`: list of commandline parameters to add to valgrind',
|
||||
'',
|
||||
' - `extraargs`: list of extra commandline arguments to add to arangod',
|
||||
''
|
||||
];
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var _ = require("underscore");
|
||||
|
||||
var testFuncs = {};
|
||||
var testFuncs = {'all': function(){}};
|
||||
var print = require("internal").print;
|
||||
var time = require("internal").time;
|
||||
var fs = require("fs");
|
||||
|
@ -117,6 +111,57 @@ var optionsDefaults = { "cluster": false,
|
|||
"test": undefined,
|
||||
"cleanup": true,
|
||||
"jsonReply": false};
|
||||
var allTests =
|
||||
[
|
||||
"config",
|
||||
"boost",
|
||||
"shell_server",
|
||||
"shell_server_ahuacatl",
|
||||
"shell_server_aql",
|
||||
"http_server",
|
||||
"ssl_server",
|
||||
"shell_client",
|
||||
"dump",
|
||||
"arangob",
|
||||
"importing",
|
||||
"upgrade",
|
||||
"foxx_manager",
|
||||
"authentication",
|
||||
"authentication_parameters"
|
||||
];
|
||||
|
||||
|
||||
function printUsage () {
|
||||
print();
|
||||
print("Usage: UnitTest( which, options )");
|
||||
print();
|
||||
print(' where "which" is one of:\n');
|
||||
var i;
|
||||
var checkAll;
|
||||
var oneFunctionDoku;
|
||||
for (i in testFuncs) {
|
||||
if (testFuncs.hasOwnProperty(i)) {
|
||||
if (functionDoku.hasOwnProperty(i)) {
|
||||
oneFunctionDoku = ' - ' + functionDoku[i];
|
||||
}
|
||||
else {
|
||||
oneFunctionDoku = '';
|
||||
}
|
||||
if (allTests.indexOf(i) !== -1) {
|
||||
checkAll = '[x]';
|
||||
}
|
||||
else {
|
||||
checkAll = ' ';
|
||||
}
|
||||
print(' ' + checkAll + ' '+i+' ' + oneFunctionDoku);
|
||||
}
|
||||
}
|
||||
for (i in optiondoku) {
|
||||
if (optiondoku.hasOwnProperty(i)) {
|
||||
print(optiondoku[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function findTopDir () {
|
||||
var topDir = fs.normalize(fs.makeAbsolute("."));
|
||||
|
@ -520,6 +565,72 @@ function performTests(options, testList, testname) {
|
|||
return results;
|
||||
}
|
||||
|
||||
function single_usage(testsuite) {
|
||||
print("single_" + testsuite + ": No test specified!\n Available tests:");
|
||||
var filelist = "";
|
||||
var list = fs.list(makePath("js/server/tests"));
|
||||
for (var fileNo in list) {
|
||||
if (/\.js$/.test(list[fileNo])) {
|
||||
filelist += " js/server/tests/"+list[fileNo];
|
||||
}
|
||||
}
|
||||
print(filelist);
|
||||
print("usage: single_" + testsuite + " '{\"test\":\"<testfilename>\"}'");
|
||||
print(" where <testfilename> is one from the list above.");
|
||||
return { status: false, message: "No test specified!"};
|
||||
}
|
||||
|
||||
|
||||
testFuncs.single_server = function (options) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single");
|
||||
var result = { };
|
||||
if (options.test !== undefined) {
|
||||
var te = options.test;
|
||||
print("\nTrying",te,"on server...");
|
||||
result = {};
|
||||
result[te] = runThere(options, instanceInfo, makePath(te));
|
||||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return single_usage("server");
|
||||
}
|
||||
};
|
||||
|
||||
testFuncs.single_client = function (options) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single");
|
||||
var result = { };
|
||||
if (options.test !== undefined) {
|
||||
var te = options.test;
|
||||
var topDir = findTopDir();
|
||||
var args = makeTestingArgsClient(options);
|
||||
args.push("--server.endpoint");
|
||||
args.push(instanceInfo.endpoint);
|
||||
args.push("--javascript.unit-tests");
|
||||
args.push(fs.join(topDir,te));
|
||||
print("\nTrying",te,"on client...");
|
||||
var arangosh = fs.join("bin","arangosh");
|
||||
result = {};
|
||||
result[te] = executeAndWait(arangosh, args);
|
||||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return single_usage("client");
|
||||
}
|
||||
};
|
||||
|
||||
testFuncs.shell_server_perf = function(options) {
|
||||
findTests();
|
||||
return performTests(options,
|
||||
tests_shell_server_aql_performance,
|
||||
'tests_shell_server_aql_performance');
|
||||
};
|
||||
|
||||
testFuncs.shell_server = function (options) {
|
||||
findTests();
|
||||
return performTests(options, tests_shell_server, 'tests_shell_server');
|
||||
|
@ -564,13 +675,6 @@ testFuncs.shell_server_aql = function(options) {
|
|||
return "skipped";
|
||||
};
|
||||
|
||||
testFuncs.shell_server_perf = function(options) {
|
||||
findTests();
|
||||
return performTests(options,
|
||||
tests_shell_server_aql_performance,
|
||||
'tests_shell_server_aql_performance');
|
||||
};
|
||||
|
||||
testFuncs.shell_client = function(options) {
|
||||
findTests();
|
||||
var instanceInfo = startInstance("tcp", options, [], "shell_client");
|
||||
|
@ -651,66 +755,6 @@ testFuncs.boost = function (options) {
|
|||
return results;
|
||||
};
|
||||
|
||||
|
||||
function single_usage(testsuite) {
|
||||
print("single_" + testsuite + ": No test specified!\n Available tests:");
|
||||
var filelist = "";
|
||||
var list = fs.list(makePath("js/server/tests"));
|
||||
for (var fileNo in list) {
|
||||
if (/\.js$/.test(list[fileNo])) {
|
||||
filelist += " js/server/tests/"+list[fileNo];
|
||||
}
|
||||
}
|
||||
print(filelist);
|
||||
print("usage: single_" + testsuite + " '{\"test\":\"<testfilename>\"}'");
|
||||
print(" where <testfilename> is one from the list above.");
|
||||
return { status: false, message: "No test specified!"};
|
||||
}
|
||||
|
||||
|
||||
testFuncs.single_server = function (options) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single");
|
||||
var result = { };
|
||||
if (options.test !== undefined) {
|
||||
var te = options.test;
|
||||
print("\nTrying",te,"on server...");
|
||||
result = {};
|
||||
result[te] = runThere(options, instanceInfo, makePath(te));
|
||||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return single_usage("server");
|
||||
}
|
||||
};
|
||||
|
||||
testFuncs.single_client = function (options) {
|
||||
var instanceInfo = startInstance("tcp", options, [], "single");
|
||||
var result = { };
|
||||
if (options.test !== undefined) {
|
||||
var te = options.test;
|
||||
var topDir = findTopDir();
|
||||
var args = makeTestingArgsClient(options);
|
||||
args.push("--server.endpoint");
|
||||
args.push(instanceInfo.endpoint);
|
||||
args.push("--javascript.unit-tests");
|
||||
args.push(fs.join(topDir,te));
|
||||
print("\nTrying",te,"on client...");
|
||||
var arangosh = fs.join("bin","arangosh");
|
||||
result = {};
|
||||
result[te] = executeAndWait(arangosh, args);
|
||||
print("Shutting down...");
|
||||
shutdownInstance(instanceInfo,options);
|
||||
print("done.");
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return single_usage("client");
|
||||
}
|
||||
};
|
||||
|
||||
function rubyTests (options, ssl) {
|
||||
var instanceInfo;
|
||||
if (ssl) {
|
||||
|
@ -751,6 +795,7 @@ function rubyTests (options, ssl) {
|
|||
if ((n.indexOf("-cluster") === -1 || options.cluster) &&
|
||||
(n.indexOf("-noncluster") === -1 || options.cluster === false) &&
|
||||
(n.indexOf("-timecritical") === -1 || options.skipTimeCritical === false) &&
|
||||
(n.indexOf("-disabled") === -1) &&
|
||||
n.indexOf("replication") === -1) {
|
||||
args = ["--color", "-I", fs.join("UnitTests","HttpInterface"),
|
||||
"--format", "d", "--require", tmpname,
|
||||
|
@ -1255,50 +1300,6 @@ function unitTestPrettyPrintResults(r) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
var allTests =
|
||||
[
|
||||
"config",
|
||||
"boost",
|
||||
"shell_server",
|
||||
"shell_server_ahuacatl",
|
||||
"shell_server_aql",
|
||||
"http_server",
|
||||
"ssl_server",
|
||||
"shell_client",
|
||||
"dump",
|
||||
"arangob",
|
||||
"importing",
|
||||
"upgrade",
|
||||
"foxx_manager",
|
||||
"authentication",
|
||||
"authentication_parameters"
|
||||
];
|
||||
|
||||
function printUsage () {
|
||||
print("Usage: UnitTest( which, options )");
|
||||
print(' where "which" is one of:');
|
||||
print(' "all": do all tests');
|
||||
var i;
|
||||
for (i in testFuncs) {
|
||||
if (testFuncs.hasOwnProperty(i)) {
|
||||
print(' "'+i+'"');
|
||||
}
|
||||
}
|
||||
print(' and options can contain the following boolean properties:');
|
||||
print(' "force": continue despite a failed test');
|
||||
print(' "skipBoost": skip the boost unittests');
|
||||
print(' "skipGeo": skip the geo index tests');
|
||||
print(' "skipAhuacatl": skip the ahuacatl tests');
|
||||
print(' "skipAql": skip the AQL tests');
|
||||
print(' "skipRanges": skip the ranges tests');
|
||||
print(' "valgrind": arangods are run with valgrind');
|
||||
print(' "cluster": tests are run on a small local cluster');
|
||||
print(' "test": name of test to run for "single" test');
|
||||
print(' "skipClient": for "single" test');
|
||||
print(' "skipServer": for "single" test');
|
||||
}
|
||||
|
||||
function UnitTest (which, options) {
|
||||
var allok = true;
|
||||
var results = {};
|
||||
|
|
|
@ -89,15 +89,18 @@ function resultsToXml(results, baseName) {
|
|||
|
||||
|
||||
function main (argv) {
|
||||
if (argv.length < 2) {
|
||||
print("Usage: unittest TESTNAME [OPTIONS]");
|
||||
return;
|
||||
}
|
||||
var test = argv[1];
|
||||
var options = {};
|
||||
var r;
|
||||
if (argv.length >= 3) {
|
||||
options = JSON.parse(argv[2]);
|
||||
try {
|
||||
options = JSON.parse(argv[2]);
|
||||
}
|
||||
catch (x) {
|
||||
print("failed to parse the json options");
|
||||
print(x);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
options.jsonReply = true;
|
||||
var UnitTest = require("org/arangodb/testing");
|
||||
|
|
Loading…
Reference in New Issue