Skip to content

Commit 50a8bf0

Browse files
committed
Add support for build stop and build info commands
1 parent fc85559 commit 50a8bf0

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

bin/commands/info.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ module.exports = function info(args, rawArgs) {
3838
'User-Agent': utils.getUserAgent(),
3939
},
4040
};
41+
42+
if (Constants.turboScaleObj.enabled) {
43+
options.url = `${config.turboScaleBuildsUrl}/${buildId}`;
44+
}
45+
4146
request.get(options, function (err, resp, body) {
4247
let message = null;
4348
let messageType = null;

bin/commands/stop.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ module.exports = function stop(args, rawArgs) {
1919
// accept the access key from command line if provided
2020
utils.setAccessKey(bsConfig, args);
2121

22-
let buildReportData = await getInitialDetails(bsConfig, args, rawArgs);
23-
2422
utils.setUsageReportingFlag(bsConfig, args.disableUsageReporting);
2523

2624
// set cypress config filename
2725
utils.setCypressConfigFilename(bsConfig, args);
2826

2927
let buildId = args._[1];
28+
let buildReportData = null;
3029

31-
await utils.stopBrowserStackBuild(bsConfig, args, buildId, rawArgs, buildReportData);
30+
if (!Constants.turboScaleObj.enabled) {
31+
buildReportData = await getInitialDetails(bsConfig, args, rawArgs);
32+
}
3233

34+
await utils.stopBrowserStackBuild(bsConfig, args, buildId, rawArgs, buildReportData);
3335
}).catch(function (err) {
3436
logger.error(err);
3537
utils.setUsageReportingFlag(null, args.disableUsageReporting);

bin/helpers/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,11 @@ exports.stopBrowserStackBuild = async (bsConfig, args, buildId, rawArgs, buildRe
13881388
'User-Agent': that.getUserAgent(),
13891389
},
13901390
};
1391+
1392+
if (Constants.turboScaleObj.enabled) {
1393+
options.url = `${config.turboScaleBuildsUrl}/${buildId}/stop`;
1394+
}
1395+
13911396
let message = null;
13921397
let messageType = null;
13931398
let errorCode = null;

0 commit comments

Comments
 (0)