From c92ee5a3c0dfd9e851db18032408c224ca4d3f67 Mon Sep 17 00:00:00 2001 From: Karan Nagpal Date: Wed, 18 Sep 2024 20:12:11 +0530 Subject: [PATCH] Fix: ats cypress exit code --- bin/commands/runs.js | 5 +++++ bin/helpers/constants.js | 1 + 2 files changed, 6 insertions(+) diff --git a/bin/commands/runs.js b/bin/commands/runs.js index 960e8bfd..57a6d0f9 100644 --- a/bin/commands/runs.js +++ b/bin/commands/runs.js @@ -326,6 +326,9 @@ module.exports = function run(args, rawArgs) { } let message = `${data.message}! ${Constants.userMessages.BUILD_CREATED} with build id: ${data.build_id}`; let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${data.dashboard_url}`; + if (turboScaleSession) { + dashboardLink = `${Constants.userMessages.VISIT_ATS_DASHBOARD} ${data.dashboard_url}`; + } buildReportData = { 'build_id': data.build_id, 'parallels': userSpecifiedParallels, ...buildReportData } utils.exportResults(data.build_id, `${config.dashboardUrl}${data.build_id}`); 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) { logger.info(Constants.userMessages.BUILD_FAILED_ERROR) process.exitCode = Constants.BUILD_FAILED_EXIT_CODE; }); + } else { + utils.handleSyncExit(exitCode, data.dashboard_url); } }); } else if (utils.nonEmptyArray(bsConfig.run_settings.downloads && !turboScaleSession)) { diff --git a/bin/helpers/constants.js b/bin/helpers/constants.js index c4b78d0f..2b0e83bf 100644 --- a/bin/helpers/constants.js +++ b/bin/helpers/constants.js @@ -57,6 +57,7 @@ const userMessages = { FAILED_MD5_CHECK: "Something went wrong - you can retry running browserstack-cypress with ‘--force-upload’ parameter, or contact BrowserStack Support.", VISIT_DASHBOARD: "Visit the Automate dashboard for real-time test reporting:", + VISIT_ATS_DASHBOARD: "Visit the Automate TurboScale dashboard for real-time test reporting:", CONFLICTING_INIT_ARGUMENTS: "Conflicting arguments given. You can use --path only with a file name, and not with a file path.", NO_PARALLELS: