Skip to content

Commit bb179a1

Browse files
committed
changes
1 parent c0732de commit bb179a1

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

bin/commands/generateReport.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const logger = require("../helpers/logger").winstonLogger,
55
utils = require("../helpers/utils"),
66
reporterHTML = require('../helpers/reporterHTML'),
77
getInitialDetails = require('../helpers/getInitialDetails').getInitialDetails;
8-
9-
8+
const { isTurboScaleSession } = require('../helpers/atsHelper');
9+
1010
module.exports = function generateReport(args, rawArgs) {
1111
let bsConfigPath = utils.getConfigPath(args.cf);
1212
let reportGenerator = reporterHTML.reportGenerator;
1313

14-
return utils.validateBstackJson(bsConfigPath).then(function (bsConfig) {
14+
return utils.validateBstackJson(bsConfigPath).then(async function (bsConfig) {
1515
// setting setDefaults to {} if not present and set via env variables or via args.
1616
utils.setDefaults(bsConfig, args);
1717

@@ -21,9 +21,9 @@ module.exports = function generateReport(args, rawArgs) {
2121
// accept the access key from command line if provided
2222
utils.setAccessKey(bsConfig, args);
2323

24-
getInitialDetails(bsConfig, args, rawArgs).then((buildReportData) => {
25-
26-
utils.setUsageReportingFlag(bsConfig, args.disableUsageReporting);
24+
try {
25+
let buildReportData = isTurboScaleSession(bsConfig) ? null : await getInitialDetails(bsConfig, args, rawArgs);
26+
utils.setUsageReportingFlag(bsConfig, args.disableUsageReporting);
2727

2828
// set cypress config filename
2929
utils.setCypressConfigFilename(bsConfig, args);
@@ -34,9 +34,9 @@ module.exports = function generateReport(args, rawArgs) {
3434

3535
reportGenerator(bsConfig, buildId, args, rawArgs, buildReportData);
3636
utils.sendUsageReport(bsConfig, args, 'generate-report called', messageType, errorCode, buildReportData, rawArgs);
37-
}).catch((err) => {
37+
} catch(err) {
3838
logger.warn(err);
39-
});
39+
};
4040
}).catch(function (err) {
4141
logger.error(err);
4242
utils.setUsageReportingFlag(null, args.disableUsageReporting);

bin/helpers/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ config.configJsonFileName = 'tmpCypressConfig.json';
2929

3030
// turboScale
3131
config.turboScaleMd5Sum = `${config.turboScaleUrl}/md5sumcheck`;
32-
config.turboScaleBuildsUrl = `${config.turboScaleAPIUrl}/builds`;
32+
config.turboScaleBuildsUrl = `${config.turboScaleUrl}/builds`;
3333

3434
module.exports = config;

bin/helpers/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"dashboardUrl": "https://automate.browserstack.com/dashboard/v2/builds/",
55
"usageReportingUrl": "https://eds.browserstack.com:443/send_event_cy_internal",
66
"localTestingListUrl": "https://www.browserstack.com/local/v1/list",
7-
"turboScaleUrl": "https://grid.browserstack.com/packages/cypress",
8-
"turboScaleAPIUrl": "https://api.browserstack.com/automate-turboscale/v1"
7+
"turboScaleUrl": "http://grid-api-devhst.bsstag.com/packages/cypress",
8+
"turboScaleAPIUrl": "http://grid-api-devhst.bsstag.com/automate-turboscale/v1"
99
}

bin/helpers/reporterHTML.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const fs = require('fs'),
66
Constants = require('./constants'),
77
config = require("./config"),
88
decompress = require('decompress');
9+
const { isTurboScaleSession } = require('../helpers/atsHelper');
910

1011
let reportGenerator = (bsConfig, buildId, args, rawArgs, buildReportData, cb) => {
1112
let options = {
@@ -19,7 +20,7 @@ let reportGenerator = (bsConfig, buildId, args, rawArgs, buildReportData, cb) =>
1920
},
2021
};
2122

22-
if (Constants.turboScaleObj.enabled) {
23+
if (isTurboScaleSession(bsConfig)) {
2324
options.url = `${config.turboScaleBuildsUrl}/${buildId}/custom_report`;
2425
}
2526

0 commit comments

Comments
 (0)