1
0
Fork 0

Streamline agency testing

This commit is contained in:
Andreas Streichardt 2016-08-10 16:10:45 +02:00
parent 26fe5ef2ff
commit 116a4448e3
2 changed files with 8 additions and 74 deletions

View File

@ -3762,80 +3762,11 @@ testFuncs.stress_locks = function (options) {
testFuncs.agency = function (options) {
findTests();
var saveAgency = options.agency;
var saveCluster = options.cluster;
options.agency = true;
options.cluster = false;
let instanceInfo = startInstance('tcp', options, {}, 'agency');
if (instanceInfo === false) {
return {
shell_client: {
status: false,
message: 'failed to start agency!'
}
};
}
let results = {};
let filtered = {};
let continueTesting = true;
for (let i = 0; i < testsCases.agency.length; i++) {
let te = testsCases.agency[i];
if (filterTestcaseByOptions(te, options, filtered)) {
if (!continueTesting) {
print('Skipping, ' + te + ' server is gone.');
results[te] = {
status: false,
message: instanceInfo.exitStatus
};
instanceInfo.exitStatus = 'server is gone.';
break;
}
let agencyServers = instanceInfo.arangods.map(arangod => {
return arangod.url;
});
print('\narangosh: Trying', te, '...');
const reply = runInArangosh(options, instanceInfo, te, {
'flatCommands': agencyServers.join(' ')
});
results[te] = reply;
if (reply.status !== true) {
options.cleanup = false;
if (!options.force) {
break;
}
}
continueTesting = checkInstanceAlive(instanceInfo, options);
} else {
if (options.extremeVerbosity) {
print('Skipped ' + te + ' because of ' + filtered.filter);
}
}
}
print('Shutting down...');
shutdownInstance(instanceInfo, options);
print('done.');
options.agency = saveAgency;
options.cluster = saveCluster;
return results;
return performTests(options, testsCases.agency, 'agency', createArangoshRunner());
};
// //////////////////////////////////////////////////////////////////////////////

View File

@ -8,7 +8,7 @@
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
/// Copyright 2010-2016 triagens GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
@ -25,11 +25,12 @@
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Max Neunhoeffer
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
/// @author Copyright 2016, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
var jsunity = require("jsunity");
var wait = require("internal").wait;
const instanceInfo = JSON.parse(require('fs').read('instanceinfo.json'));
////////////////////////////////////////////////////////////////////////////////
/// @brief test suite
@ -42,7 +43,9 @@ function agencyTestSuite () {
/// @brief the agency servers
////////////////////////////////////////////////////////////////////////////////
var agencyServers = ARGUMENTS[0].split(" ");
var agencyServers = instanceInfo.arangods.map(arangod => {
return arangod.url;
});
var whoseTurn = 0;
var request = require("@arangodb/request");