Skip to content

Commit 2c25a73

Browse files
always stay on SC v4.6.4 if not specified otherwise
1 parent b581360 commit 2c25a73

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import os from 'os'
33

44
import { version } from '../package.json'
55

6-
export const DEFAULT_SAUCE_CONNECT_VERSION = '4.6.5'
6+
export const DEFAULT_SAUCE_CONNECT_VERSION = '4.6.4'
77
export const SAUCE_CONNECT_BASE = 'https://saucelabs.com/downloads'
88
export const SAUCE_CONNECT_VERSIONS_ENDPOINT = 'https://saucelabs.com/versions.json'
99
export const SAUCE_CONNECT_DISTS = [

src/index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
PROTOCOL_MAP, DEFAULT_OPTIONS, SYMBOL_INSPECT, SYMBOL_TOSTRING,
1717
SYMBOL_ITERATOR, TO_STRING_TAG, SAUCE_CONNECT_DISTS,
1818
SC_PARAMS_TO_STRIP, SC_READY_MESSAGE, SC_CLOSE_MESSAGE,
19-
SC_CLOSE_TIMEOUT, DEFAULT_SAUCE_CONNECT_VERSION, SC_FAILURE_MESSAGE, SAUCE_CONNECT_VERSIONS_ENDPOINT
19+
SC_CLOSE_TIMEOUT, DEFAULT_SAUCE_CONNECT_VERSION, SC_FAILURE_MESSAGE
2020
} from './constants'
2121

2222
export default class SauceLabs {
@@ -297,14 +297,11 @@ export default class SauceLabs {
297297
}
298298

299299
async _getLatestSauceConnectVersion () {
300-
try {
301-
const {body} = await this._api.get(SAUCE_CONNECT_VERSIONS_ENDPOINT, {responseType: 'json'})
302-
const responseJson = body.data
303-
return responseJson['Sauce Connect']['version']
304-
} catch (err) {
305-
// fallback
306-
return DEFAULT_SAUCE_CONNECT_VERSION
307-
}
300+
/**
301+
* for v4 of this package we enforce the default SC version 4.6.4
302+
* which is the last version with Linux 32 bit support
303+
*/
304+
return DEFAULT_SAUCE_CONNECT_VERSION
308305
}
309306

310307
async _downloadJobAsset (jobId, assetName, { filepath } = {}) {

tests/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ describe('startSauceConnect', () => {
390390
.toBe(true)
391391
})
392392

393-
it('should start sauce connect with latest version if no version is specified in the args', async () => {
393+
it('should start sauce connect with v4.6.4 version if no version is specified in the args', async () => {
394394
const logs = []
395395
const api = new SauceLabs({ user: 'foo', key: 'bar', headless: true })
396396
got.mockReturnValue(Promise.resolve({
@@ -406,7 +406,7 @@ describe('startSauceConnect', () => {
406406
'proxy-tunnel': 'abc',
407407
logger: (log) => logs.push(log)
408408
})
409-
expect(instances[0].dest.mock.calls[0][0].endsWith('.sc-v1.2.4'))
409+
expect(instances[0].dest.mock.calls[0][0].endsWith('.sc-v4.6.4'))
410410
.toBe(true)
411411
})
412412

0 commit comments

Comments
 (0)