Skip to content

Commit

Permalink
log jobURL at end of successful job
Browse files Browse the repository at this point in the history
  • Loading branch information
JavonDavis committed Apr 9, 2019
1 parent 360a28b commit 1f9b193
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions __device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
import childProcess from 'child_process';
import wd from 'wd';
import crypto from 'crypto';

/**
* Internal dependencies
Expand Down Expand Up @@ -108,6 +109,18 @@ const setupDriver = async () => {
};

const stopDriver = async ( driver: wd.PromiseChainWebdriver ) => {
if ( ! isLocalEnvironment() ) {
const jobID = driver.sessionID;
const username = process.env.SAUCE_USERNAME;
const accessKey = process.env.SAUCE_ACCESS_KEY;

const hash = crypto.createHmac( 'md5', jobID )
.update( `${ username }:${ accessKey }` )
.digest( 'hex' );
const jobURL = `https://saucelabs.com/jobs/${ jobID }?auth=${ hash }.`;
// eslint-disable-next-line no-console
console.log( `You can view the video of this test run at ${ jobURL }` );
}
if ( driver === undefined ) {
return;
}
Expand Down

0 comments on commit 1f9b193

Please sign in to comment.