Permalink
Browse files

Fix run.sh sample

- Rename to -sample to allow keeping a clean working copy

- Add .gitignore for the customized run.sh and log file

- Add EOL line breaks

- Use 'node' explicitly to avoid errors where `#!/opt/local/bin/node` doesn't exist
  (such as on MacOSX, depending on how it was installed)
  • Loading branch information...
1 parent 6c5980e commit 7118a1d1ac768698299b1bbd7706cf08cb235415 @Krinkle Krinkle committed Apr 30, 2012
View
@@ -1 +1,4 @@
-node_modules
+node_modules
+testswarm-browserstack.run.log
+testswarm-browserstack.run.sh
+.DS_Store
View
@@ -94,4 +94,4 @@ this is a nodejs CLI interface wrapper around testswarm-browserstack.js. Use --h
--swarmRunUrl [url] URL to the TestSwarm run page (including client name), for BrowserStack workers to open
--clientTimeout [min] Number of minutes to run each client (BrowserStack timeout, defaults to 10 minutes)
-</pre>
+</pre>
@@ -9,19 +9,23 @@ program
.option('--getNeeded', 'Shows a list of browser IDs that have pending jobs in TestSwarm')
.option('--kill', 'Kill BrowserStack workers if they are no longer needed (Only if --run is also specified)')
.option('--run', 'Start new workers in BrowserStack based on the swarm state')
+ .option('--dryRun', 'Use this option in combination with --kill, --run and/or --killAll. Will stop any action from taking place and only report what it would do in reality. Intended for debugging or getting statistics.')
.option('-u, --user [username]', 'BrowserStack username', '')
.option('-p, --pass [password]', 'BrowserStack password', '')
.option('-v, --verbose', 'Output more debug messages (all output via console.log)')
.option('--swarmUrl [url]', 'URL of TestSwarm root (without trailing slash)', '')
.option('--swarmRunUrl [url]', 'URL to the TestSwarm run page (including client name), for BrowserStack workers to open', '')
- .option('--clientTimeout [min]', 'Number of minutes to run each client (BrowserStack timeout defaults to 10 minutes)', parseInt)
+ .option('--stackLimit [workers]', 'How many workers can be running simultaneously in BrowserStack (default: 4 workers)', parseInt)
+ .option('--clientTimeout [min]', 'Number of minutes to run each client (default: 10 minutes)', parseInt)
.parse(process.argv);
if (!process.argv[2]) {
console.log(program.helpInformation());
return;
}
+console.log('\n--\n-- testswarm-browserstack.cli.js: ' + new Date().toString() + '\n--');
+
tsbs.options(program);
if (program.getNeeded) {
@@ -67,9 +71,10 @@ if (program.run) {
return;
}
- // Set default timeout if not set
+ // Default options
+ program.stackLimit = program.stackLimit || 4;
program.clientTimeout = program.clientTimeout || 10;
- // Convert timeout to min
+ // Convert timeout to ming
program.clientTimeout = program.clientTimeout * 60;
tsbs.run();
}
@@ -103,4 +103,4 @@ var map = {
module.exports = {
map:map
-};
+};
@@ -0,0 +1,2 @@
+# This is an example script that could be run by cron on set interval.
+node ./testswarm-browserstack.cli.js --swarmUrl "http://swarm.jquery.org" --swarmRunUrl "http://swarm.jquery.org/run/swarmuser/" -u "browserstackUser" -p "browserstackPass" --run --kill --clientTimeout 15 -v > ./testswarm-browserstack.run.log;
@@ -1,2 +0,0 @@
-#this is an example script that could be run by cron on set interval.
-./testswarm-browserstack.cli.js --swarmUrl "http://swarm.jquery.org" --swarmRunUrl "http://swarm.jquery.org/run/swarmuser/" -p browserstackPass -u browserstackUser --run --kill --clientTimeout 15 -v >> ./testswarm-browserstack.log;

0 comments on commit 7118a1d

Please sign in to comment.