@ciscospark/bin-sauce-connect
Advanced tools
Comparing version 0.7.0-alpha.f22f099e to 0.7.0
{ | ||
"name": "@ciscospark/bin-sauce-connect", | ||
"version": "0.7.0-alpha.f22f099e", | ||
"version": "0.7.0", | ||
"description": "", | ||
"license": "MIT", | ||
"bin": { | ||
"sauce-connect": "./bin/sauce-connect" | ||
}, | ||
"repository": "https://github.com/ciscospark/spark-js-sdk/tree/master/packages/bin-sauce-connect", | ||
"dependencies": { | ||
@@ -18,2 +20,3 @@ "babel-plugin-lodash": "2.1.0", | ||
"denodeify": "^1.2.1", | ||
"dotenv": "^2.0.0", | ||
"lodash": "^4.5.1", | ||
@@ -23,6 +26,9 @@ "mkdirp": "^0.5.1" | ||
"devDependencies": { | ||
"babel-eslint": "^6.0.0-beta.5", | ||
"eslint": "2.2.0", | ||
"eslint-plugin-mocha-only": "0.0.3" | ||
"babel-eslint": "^6.1.2", | ||
"eslint": "^3.5.0", | ||
"eslint-plugin-mocha": "^4.5.1" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
} | ||
} |
import path from 'path'; | ||
export const dotSauce = path.join(__dirname, `..`, `..`, `.sauce`); | ||
export const dotSauce = path.join(__dirname, `..`, `..`, `..`, `..`, `.sauce${process.env.PACKAGE ? `/${process.env.PACKAGE}` : ``}`); | ||
export const logFile = path.join(dotSauce, `sauce_connect.log`); | ||
export const pidFile = path.join(dotSauce, `sc.pid`); | ||
export const readyFile = path.join(dotSauce, `sc.ready`); |
@@ -7,6 +7,7 @@ import 'babel-polyfill'; | ||
import spawn from './lib/spawn'; | ||
import rm from './lib/rm'; | ||
const mkdirp = denodeify(_mkdirp); | ||
const SAUCE_CONNECT_VERSION = `4.3.11`; | ||
const SAUCE_CONNECT_VERSION = `4.3.16`; | ||
@@ -63,3 +64,6 @@ (async function run() { | ||
// eslint-disable-next-line prefer-const | ||
let interval; | ||
// cancel the connect process if the ready file hasn't been detected within | ||
// 60 seconds | ||
const timer = setTimeout(async function failAfter() { | ||
@@ -75,2 +79,3 @@ clearInterval(interval); | ||
// Check for the ready file once per second forever until it exists | ||
interval = setInterval(async function checkConnected() { | ||
@@ -93,3 +98,3 @@ if (await exists(readyFile)) { | ||
`-vv`, | ||
`-l`, `sauce_connect.log`, | ||
`-l`, `${logFile}`, | ||
`--pidfile`, pidFile, | ||
@@ -104,2 +109,30 @@ `--readyfile`, readyFile, | ||
/** | ||
* Prevents the next connection attempt until the pid file from the previous | ||
* attempt disappears (or the tiemout expires and we remove it forcibly) | ||
* @returns {Promise} | ||
*/ | ||
function blockUntilClosed() { | ||
return new Promise((resolve) => { | ||
// eslint-disable-next-line prefer-const | ||
let interval; | ||
const timer = setTimeout(async function removeAfter() { | ||
clearInterval(interval); | ||
if (await exists(pidFile)) { | ||
console.log(`pid file not removed; forcibly removing`); | ||
await rm(pidFile); | ||
resolve(); | ||
} | ||
}, 60 * 1000); | ||
interval = setInterval(async function check() { | ||
if (!await exists(pidFile)) { | ||
clearTimeout(timer); | ||
clearInterval(interval); | ||
resolve(); | ||
} | ||
}, 1000); | ||
}); | ||
} | ||
/** | ||
* Connect to Sauce Labs with up to three attempts | ||
@@ -116,2 +149,3 @@ * @private | ||
try { | ||
await blockUntilClosed(); | ||
await connect(); | ||
@@ -122,2 +156,3 @@ } | ||
try { | ||
await blockUntilClosed(); | ||
await connect(); | ||
@@ -124,0 +159,0 @@ } |
@@ -15,2 +15,3 @@ import 'babel-polyfill'; | ||
await new Promise((resolve, reject) => { | ||
// eslint-disable-next-line prefer-const | ||
let interval; | ||
@@ -17,0 +18,0 @@ const timeout = setTimeout(() => { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
9079
11
0
274
1
4
12
1
8
+ Addeddotenv@^2.0.0
+ Addeddotenv@2.0.0(transitive)