Skip to content

Commit aa2e3c5

Browse files
Merge branch 'master' into APS-12458-make-video-cap-consistent-across-config-and-dashboard
2 parents d874319 + f1b31b6 commit aa2e3c5

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

bin/commands/runs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ module.exports = function run(args, rawArgs) {
326326
}
327327
let message = `${data.message}! ${Constants.userMessages.BUILD_CREATED} with build id: ${data.build_id}`;
328328
let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${data.dashboard_url}`;
329+
if (turboScaleSession) {
330+
dashboardLink = `${Constants.userMessages.VISIT_ATS_DASHBOARD} ${data.dashboard_url}`;
331+
}
329332
buildReportData = { 'build_id': data.build_id, 'parallels': userSpecifiedParallels, ...buildReportData }
330333
utils.exportResults(data.build_id, `${config.dashboardUrl}${data.build_id}`);
331334
if ((utils.isUndefined(bsConfig.run_settings.parallels) && utils.isUndefined(args.parallels)) || (!utils.isUndefined(bsConfig.run_settings.parallels) && bsConfig.run_settings.parallels == Constants.cliMessages.RUN.DEFAULT_PARALLEL_MESSAGE)) {
@@ -388,6 +391,8 @@ module.exports = function run(args, rawArgs) {
388391
logger.info(Constants.userMessages.BUILD_FAILED_ERROR)
389392
process.exitCode = Constants.BUILD_FAILED_EXIT_CODE;
390393
});
394+
} else {
395+
utils.handleSyncExit(exitCode, data.dashboard_url);
391396
}
392397
});
393398
} else if (utils.nonEmptyArray(bsConfig.run_settings.downloads && !turboScaleSession)) {

bin/helpers/buildArtifacts.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ const parseAndDownloadArtifacts = async (buildId, data, bsConfig, args, rawArgs,
3535
utils.sendUsageReport(bsConfig, args, warningMessage, Constants.messageTypes.ERROR, 'build_artifacts_not_found', buildReportData, rawArgs);
3636
} else {
3737
BUILD_ARTIFACTS_FAIL_COUNT += 1;
38+
const errorMsg = `Error downloading build artifacts for ${sessionId} with error: ${error}`;
39+
logger.debug(errorMsg);
40+
utils.sendUsageReport(bsConfig, args, errorMsg, Constants.messageTypes.ERROR, 'build_artifacts_parse_error', buildReportData, rawArgs);
3841
}
3942
// delete malformed zip if present
4043
let tmpFilePath = path.join(filePath, fileName);
@@ -102,14 +105,16 @@ const downloadAndUnzip = async (filePath, fileName, url) => {
102105
let tmpFilePath = path.join(filePath, fileName);
103106
const writer = fs.createWriteStream(tmpFilePath);
104107

108+
logger.debug(`Downloading build artifact for: ${filePath}`)
105109
return new Promise(async (resolve, reject) => {
106110
request.get(url).on('response', function(response) {
107111

108112
if(response.statusCode != 200) {
109113
if (response.statusCode === 404) {
110114
reject(Constants.userMessages.DOWNLOAD_BUILD_ARTIFACTS_NOT_FOUND);
111115
}
112-
reject();
116+
const errorMsg = `Non 200 status code, got status code: ${response.statusCode}`;
117+
reject(errorMsg);
113118
} else {
114119
//ensure that the user can call `then()` only when the file has
115120
//been downloaded entirely.

bin/helpers/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const userMessages = {
5757
FAILED_MD5_CHECK:
5858
"Something went wrong - you can retry running browserstack-cypress with ‘--force-upload’ parameter, or contact BrowserStack Support.",
5959
VISIT_DASHBOARD: "Visit the Automate dashboard for real-time test reporting:",
60+
VISIT_ATS_DASHBOARD: "Visit the Automate TurboScale dashboard for real-time test reporting:",
6061
CONFLICTING_INIT_ARGUMENTS:
6162
"Conflicting arguments given. You can use --path only with a file name, and not with a file path.",
6263
NO_PARALLELS:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "browserstack-cypress-cli",
3-
"version": "1.31.7",
3+
"version": "1.31.9",
44
"description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)