Skip to content

Commit bae758a

Browse files
mattkubejdignifiedquire
authored andcommittedAug 22, 2017
feat(config): add proxy option
1 parent e792677 commit bae758a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed
 

‎README.md

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ Default: `process.env.SAUCE_ACCESS_KEY`
9494

9595
Your Sauce Labs access key which you will see on your [account page](https://saucelabs.com/account).
9696

97+
### proxy
98+
Type: `String`
99+
100+
Proxy for connecting to Sauce REST API, which is used to communicate job updates of pass/fail.
101+
97102
### startConnect
98103
Type: `Boolean`
99104
Default: `true`

‎lib/sauce_launcher.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function processConfig (helper, config, args) {
1010

1111
var username = args.username || config.username || process.env.SAUCE_USERNAME
1212
var accessKey = args.accessKey || config.accessKey || process.env.SAUCE_ACCESS_KEY
13+
var proxy = args.proxy || config.proxy
1314
var startConnect = config.startConnect !== false
1415
var tunnelIdentifier = args.tunnelIdentifier || config.tunnelIdentifier
1516

@@ -76,6 +77,7 @@ function processConfig (helper, config, args) {
7677
browserName: browserName,
7778
username: username,
7879
accessKey: accessKey,
80+
proxy: proxy,
7981
startConnect: startConnect
8082
}
8183
}
@@ -99,6 +101,7 @@ var SauceLauncher = function (
99101
var browserName = pConfig.browserName
100102
var username = pConfig.username
101103
var accessKey = pConfig.accessKey
104+
var proxy = pConfig.proxy
102105
var startConnect = pConfig.startConnect
103106

104107
var pendingCancellations = 0
@@ -155,7 +158,8 @@ var SauceLauncher = function (
155158
credentials: {
156159
username: username,
157160
password: accessKey
158-
}
161+
},
162+
proxy: proxy
159163
}
160164

161165
sessionIsReady = true

‎lib/sauce_reporter.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ var SauceReporter = function (logger, /* sauce:jobMapping */ jobMapping) {
2727
if (browserId in jobMapping) {
2828
var jobDetails = jobMapping[browserId]
2929

30-
var sauceApi = new SauceLabs(jobDetails.credentials)
30+
var sauceApiOptions = jobDetails.credentials
31+
if (jobDetails.proxy) {
32+
sauceApiOptions.proxy = jobDetails.proxy
33+
}
34+
35+
var sauceApi = new SauceLabs(sauceApiOptions)
3136

3237
// We record pass/fail status, as well as the full results in "custom-data".
3338
var payload = {

0 commit comments

Comments
 (0)
Please sign in to comment.