thywill
Version:
A Node.js clustered framework for single page web applications based on asynchronous messaging.
54 lines (47 loc) • 1.25 kB
JavaScript
/**
* @fileOverview
* Vows tests for the RedisCluster component.
*
* These are cluster tests using Express, Redis, and multiple Thywill
* processes.
*/
var clone = require('clone');
var tools = require('../lib/tools');
var clusterConfig = require('../config/clusterTestThywillConfig');
var config = clone(clusterConfig);
config.cluster = {
implementation: {
type: 'core',
name: 'httpCluster'
},
// The cluster has two members.
clusterMembers: {
'alpha': {
host: '127.0.0.1',
port: 20078
},
'beta': {
host: '127.0.0.1',
port: 20079
}
},
upCheck: {
consecutiveFailedChecks: 2,
interval: 200,
requestTimeout: 500
},
// The local member name is filled in later.
localClusterMemberId: undefined,
taskRequestTimeout: 500
};
// Obtain a test suit that launches Thywill.
var suite = tools.headless.clusterVowsSuite('Cluster: cluster/httpCluster', {
config: config,
useRedisSocketStore: true,
useRedisSessionStore: true
});
tools.headless.addBatches(suite, 'cluster', 'cluster');
//-----------------------------------------------------------
// Exports - Vows test suite
//-----------------------------------------------------------
module.exports.suite = suite;