mirror of https://gitee.com/bigwinds/arangodb
conditional execution of agency tests
This commit is contained in:
parent
b07ad28c35
commit
c48d54c49b
|
@ -126,6 +126,22 @@ static v8::Handle<v8::Value> JS_CreateDirectoryAgency (v8::Arguments const& argv
|
||||||
return scope.Close(v8::True());
|
return scope.Close(v8::True());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief whether or not the agency is enabled
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
static v8::Handle<v8::Value> JS_IsEnabledAgency (v8::Arguments const& argv) {
|
||||||
|
v8::HandleScope scope;
|
||||||
|
|
||||||
|
if (argv.Length() != 0) {
|
||||||
|
TRI_V8_EXCEPTION_USAGE(scope, "isEnabled()");
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string prefix = AgencyComm::prefix();
|
||||||
|
|
||||||
|
return scope.Close(v8::Boolean::New(! prefix.empty()));
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief gets a value from the agency
|
/// @brief gets a value from the agency
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -507,6 +523,7 @@ void TRI_InitV8Cluster (v8::Handle<v8::Context> context) {
|
||||||
TRI_AddMethodVocbase(rt, "cas", JS_CasAgency);
|
TRI_AddMethodVocbase(rt, "cas", JS_CasAgency);
|
||||||
TRI_AddMethodVocbase(rt, "createDirectory", JS_CreateDirectoryAgency);
|
TRI_AddMethodVocbase(rt, "createDirectory", JS_CreateDirectoryAgency);
|
||||||
TRI_AddMethodVocbase(rt, "get", JS_GetAgency);
|
TRI_AddMethodVocbase(rt, "get", JS_GetAgency);
|
||||||
|
TRI_AddMethodVocbase(rt, "isEnabled", JS_IsEnabledAgency);
|
||||||
TRI_AddMethodVocbase(rt, "remove", JS_RemoveAgency);
|
TRI_AddMethodVocbase(rt, "remove", JS_RemoveAgency);
|
||||||
TRI_AddMethodVocbase(rt, "set", JS_SetAgency);
|
TRI_AddMethodVocbase(rt, "set", JS_SetAgency);
|
||||||
TRI_AddMethodVocbase(rt, "watch", JS_WatchAgency);
|
TRI_AddMethodVocbase(rt, "watch", JS_WatchAgency);
|
||||||
|
|
|
@ -534,7 +534,10 @@ function AgencySuite () {
|
||||||
/// @brief executes the test suites
|
/// @brief executes the test suites
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
jsunity.run(AgencySuite);
|
var agency = new ArangoAgency();
|
||||||
|
if (agency.isEnabled()) {
|
||||||
|
jsunity.run(AgencySuite);
|
||||||
|
}
|
||||||
|
|
||||||
return jsunity.done();
|
return jsunity.done();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue