Skip to content

Commit 4b897c3

Browse files
author
Yash Ladha
committed
add: LOCAL_BINARY_PATH variable to the config
User can use the already present local binary on their file system for setting up the local tunnel on their system. As a fallback it will use the legacy path so that the build doesn't break for already running users.
1 parent 4b54c3a commit 4b897c3

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ To avoid duplication of system or user specific information across several confi
320320
* `BROWSERSTACK_KEY`: BrowserStack key.
321321
* `TUNNEL_ID`: Identifier for the current instance of the tunnel process. In `TRAVIS` setup `TRAVIS_JOB_ID` will be the default identifier.
322322
* `BROWSERSTACK_JSON`: Path to the browserstack.json file. If null, `browserstack.json` in the root directory will be used.
323+
* `BROWSERSTACK_LOCAL_BINARY_PATH`: Path to the browserstack local binary present on the system. If null, `BrowserStackLocal` in the `lib/` directory will be used.
323324

324325

325326
### Secure Information
@@ -348,10 +349,10 @@ To run a larger suite of tests ensuring compatibility with older versions of QUn
348349
Tests are also run for every pull request, courtesy [Travis CI](https://travis-ci.org/).
349350

350351
### Timeout issue with Travis CI
351-
352-
You might face [build timeout issue on Travis](https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received) if runner takes more than 10 minutes to run tests.
353352

354-
There are 2 possible ways to solve this problem:
353+
You might face [build timeout issue on Travis](https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received) if runner takes more than 10 minutes to run tests.
354+
355+
There are 2 possible ways to solve this problem:
355356
1. Run a script which does `console.log` every 1-2 minutes. This will output to console and hence avoid Travis build timeout
356357
2. Use `travis_wait` function provided by Travis-CI. You can prefix `browserstack-runner` command by `travis-wait` in your `travis.yml` file
357358

bin/cli.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,11 @@ function runTests(config, callback) {
421421
}
422422
}
423423

424-
exports.run = function(user_config, callback) {
424+
exports.run = function(userConfig, callback) {
425425
callback = callback || function() {};
426426

427427
try {
428-
config = new (require('../lib/config').config)(user_config);
428+
config = new (require('../lib/config').config)(userConfig);
429429

430430
client = BrowserStack.createClient({
431431
username: config.username,

lib/local.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ var Log = require('./logger'),
1111
var Tunnel = function Tunnel(key, port, uniqueIdentifier, config, callback) {
1212
var that = {};
1313

14+
localBinary = process.env.BROWSERSTACK_LOCAL_BINARY_PATH || localBinary;
15+
1416
function tunnelLauncher() {
1517
var tunnelOptions = getTunnelOptions(key, uniqueIdentifier);
1618

0 commit comments

Comments
 (0)