Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ function launchBrowser(browser) {
browser.build = config.build;
}

if(config.tunnelIdentifier) {
browser["tunnel_identifier"] = config.tunnelIdentifier;
}

client.createWorker(browser, function (err, worker) {
if (err || typeof worker !== 'object') {
utils.alertBrowserStack("Failed to launch worker",
Expand Down Expand Up @@ -135,7 +139,7 @@ function launchBrowser(browser) {
}

if (config.browsers && config.browsers.length > 0) {
tunnel = new Tunnel(config.key, serverPort, function () {
tunnel = new Tunnel(config.key, serverPort, config.tunnelIdentifier, function () {
config.browsers.forEach(function(browser) {
if (browser.browser_version === "latest") {
console.log("[%s] Finding version.", utils.browserString(browser));
Expand Down
2 changes: 2 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ if (!fs.existsSync(config.test_path)){
process.exit(1);
}

config.tunnelIdentifier = process.env.TUNNEL_ID || process.env.TRAVIS_BUILD_ID;

for (key in config) {
if (config.hasOwnProperty(key)) {
exports[key] = config[key];
Expand Down
4 changes: 2 additions & 2 deletions lib/tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var exec = require('child_process').exec,
tunnelJar = '/tmp/BrowserStackTunnel.jar',
utils = require('./utils');

var Tunnel = function Tunnel (key, port, callback, err) {
var Tunnel = function Tunnel (key, port, tunnelIdentifier, callback, err) {
var that = {};

function tunnelLauncher () {
Expand All @@ -13,7 +13,7 @@ var Tunnel = function Tunnel (key, port, callback, err) {
tunnelCommand += 'localhost' + ',';
tunnelCommand += port.toString() + ',';
tunnelCommand += '0';
tunnelCommand += ' -force -onlyAutomate';
tunnelCommand += (typeof tunnelIdentifier === 'undefined')? ' -force -onlyAutomate' : ' -tunnelIdentifier ' + tunnelIdentifier;

if (typeof callback !== 'function') {
callback = function () {};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "git://github.com/browserstack/browserstack-runner.git"
},
"dependencies": {
"browserstack": "git://github.com/browserstack/node-browserstack.git"
"browserstack": "1.0.1"
},
"bin": {
"browserstack-runner": "bin/cli.js"
Expand Down