Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #811 from drewfish/test-yaml-disable
Browse files Browse the repository at this point in the history
disable yaml tests, other cleanups
  • Loading branch information
drewfish committed Nov 29, 2012
2 parents edeffd7 + 46513f6 commit 1c67823
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 116 deletions.
196 changes: 98 additions & 98 deletions tests/func/applications/apps.json

Large diffs are not rendered by default.

Empty file modified tests/func/common/commonclienttest_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/common/commonservertest_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/common/html5apptest_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/config/configtest_descriptor.json 100755 → 100644
Empty file.
Empty file.
Empty file modified tests/func/examples/input/input_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/examples/newsboxes/newsboxes_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/examples/simple/simple_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/routing/routingtest_descriptor.json 100755 → 100644
Empty file.
Empty file modified tests/func/usecases/usecasestest_descriptor.json 100755 → 100644
Empty file.
@@ -1,3 +1,6 @@

see trello mojito-perf card #204

[
{
"settings": [ "master" ],
Expand All @@ -8,7 +11,7 @@
"baseUrl" : "http://localhost:4000"
},

"dataprovider" : {
"dataprovider" : {
"yamlconfig1" : {
"group" : "smoke,yaml",
"params" : {
Expand All @@ -23,7 +26,7 @@
"page" : "$$config.baseUrl$$/spec"
}
}
}
}
},

{
Expand Down
36 changes: 20 additions & 16 deletions tests/run.js
Expand Up @@ -177,24 +177,23 @@ function deploy (cmd, callback) {

for (var i=0; i<apps.length; i++) {
(function (app) {
var port = app.port ? parseInt(app.port, 10) : null,
var port = app.port || null,
type = app.type || 'mojito';

if ('mojito' === type) {
if (app.tests) {
var mytests = app.tests;
for(var j=0; j<mytests.length; j++) {
(function () {
var test = mytests[j],
port = test.port ? parseInt(test.port) : null;
(function (test) {
var port = test.port || app.port || null;
appSeries.push(function (callback) {
runMojitoApp(cmd, cmd.funcPath + '/applications', app.path, port, test.param, callback);
runMojitoApp(app, cmd, cmd.funcPath + '/applications', port, test.param, callback);
});
})();
})(mytests[j]);
}
} else if (app.enabled === "true" && app.path) {
} else {
appSeries.push(function (callback) {
runMojitoApp(cmd, cmd.funcPath + '/applications', app.path, port, app.param, callback);
runMojitoApp(app, cmd, cmd.funcPath + '/applications', port, app.param, callback);
});
}
} else if ('static' === type) {
Expand Down Expand Up @@ -310,31 +309,36 @@ function runCommand (path, command, argv, callback) {
return cmd;
}

function runMojitoApp (cliOptions, basePath, path, port, params, callback) {
function runMojitoApp (app, cliOptions, basePath, port, params, callback) {
if (!app.enabled) {
console.error('------------------------------- DISABLED APP ' + app.name + ':' + port);
callback();
return;
}
/* useful when debugging
var OK = {
4081: true,
};
if (! OK[port]) {
console.error('------------------------------- SKIPPING APP ON PORT ' + port);
console.error('------------------------------- SKIPPING APP ' + app.name);
callback();
return;
}
*/
params = params || '';
console.log('Starting ' + path + ' at port ' + port + ' with params ' + (params || 'empty'));
console.log('Starting ' + app.name + ' at port ' + port + ' with params ' + (params || 'empty'));
var cmdArgs = ['start'];
if (port) {
cmdArgs.push(port);
}
if (params) {
cmdArgs.push('--context');
cmdArgs.push(params);
}
var p = runCommand(basePath + '/' + path, cwd + "/../bin/mojito", cmdArgs, function () {});
}
var p = runCommand(basePath + '/' + app.path, cwd + "/../bin/mojito", cmdArgs, function () {});

pids.push(p.pid);
pidNames[p.pid] = libpath.basename(path) + ':' + port + (params ? '?' + params : '');
pidNames[p.pid] = app.name + ':' + port + (params ? '?' + params : '');
if (cliOptions.debugApps) {
p.stdout.on('data', function(data) {
console.error('---DEBUG ' + port + ' STDOUT--- ' + data.toString());
Expand Down

0 comments on commit 1c67823

Please sign in to comment.