Skip to content

Commit 8ca4324

Browse files
committed
send specs details and don't call build artifacts
1 parent 0ca8b1a commit 8ca4324

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

bin/commands/runs.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module.exports = function run(args, rawArgs) {
8080
// accept the access key from command line or env variable if provided
8181
utils.setAccessKey(bsConfig, args);
8282

83-
let buildReportData = !isBrowserstackInfra ? null : await getInitialDetails(bsConfig, args, rawArgs);
83+
let buildReportData = (turboScaleSession || !isBrowserstackInfra) ? null : await getInitialDetails(bsConfig, args, rawArgs);
8484

8585
// accept the build name from command line if provided
8686
utils.setBuildName(bsConfig, args);
@@ -158,11 +158,6 @@ module.exports = function run(args, rawArgs) {
158158

159159
if (gridDetails && Object.keys(gridDetails).length > 0) {
160160
Constants.turboScaleObj.gridDetails = gridDetails;
161-
162-
if (gridDetails.isTrialGrid) {
163-
logger.info('Will be running the build on Trial Grid. Ensure you are using connect-grid command if using a private website');
164-
}
165-
166161
Constants.turboScaleObj.gridUrl = gridDetails.cypressUrl;
167162
Constants.turboScaleObj.uploadUrl = gridDetails.cypressUrl + '/upload';
168163
Constants.turboScaleObj.buildUrl = gridDetails.cypressUrl + '/build';
@@ -212,7 +207,7 @@ module.exports = function run(args, rawArgs) {
212207

213208
//get the number of spec files
214209
markBlockStart('getNumberOfSpecFiles');
215-
let specFiles = utils.getNumberOfSpecFiles(bsConfig, args, cypressConfigFile);
210+
let specFiles = utils.getNumberOfSpecFiles(bsConfig, args, cypressConfigFile, turboScaleSession);
216211
markBlockEnd('getNumberOfSpecFiles');
217212

218213
bsConfig['run_settings']['video_config'] = utils.getVideoConfig(cypressConfigFile);
@@ -325,13 +320,13 @@ module.exports = function run(args, rawArgs) {
325320
logger.debug("Completed polling of build status");
326321

327322
// stop the Local instance
328-
await utils.stopLocalBinary(bsConfig, bs_local, args, rawArgs, buildReportData);
323+
if (!turboScaleSession) await utils.stopLocalBinary(bsConfig, bs_local, args, rawArgs, buildReportData);
329324

330325
// waiting for 5 secs for upload to complete (as a safety measure)
331326
await new Promise(resolve => setTimeout(resolve, 5000));
332327

333328
// download build artifacts
334-
if (exitCode != Constants.BUILD_FAILED_EXIT_CODE) {
329+
if (exitCode != Constants.BUILD_FAILED_EXIT_CODE && !turboScaleSession) {
335330
if (utils.nonEmptyArray(bsConfig.run_settings.downloads)) {
336331
logger.debug("Downloading build artifacts");
337332
await downloadBuildArtifacts(bsConfig, data.build_id, args, rawArgs, buildReportData);
@@ -343,7 +338,7 @@ module.exports = function run(args, rawArgs) {
343338
markBlockEnd('postBuild');
344339
utils.handleSyncExit(exitCode, data.dashboard_url);
345340
});
346-
} else {
341+
} else if(!turboScaleSession){
347342
let stacktraceUrl = getStackTraceUrl();
348343
downloadBuildStacktrace(stacktraceUrl).then((message) => {
349344
utils.sendUsageReport(bsConfig, args, message, Constants.messageTypes.SUCCESS, null, buildReportData, rawArgs);
@@ -359,7 +354,7 @@ module.exports = function run(args, rawArgs) {
359354
});
360355
}
361356
});
362-
} else if (utils.nonEmptyArray(bsConfig.run_settings.downloads)) {
357+
} else if (utils.nonEmptyArray(bsConfig.run_settings.downloads && !turboScaleSession)) {
363358
logger.info(Constants.userMessages.ASYNC_DOWNLOADS.replace('<build-id>', data.build_id));
364359
}
365360

bin/helpers/utils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ exports.getFilesToIgnore = (runSettings, excludeFiles, logging = true) => {
10731073
return ignoreFiles;
10741074
}
10751075

1076-
exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig) => {
1076+
exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig, turboScaleSession=false) => {
10771077
let defaultSpecFolder
10781078
let testFolderPath
10791079
let globCypressConfigSpecPatterns = []
@@ -1147,6 +1147,13 @@ exports.getNumberOfSpecFiles = (bsConfig, args, cypressConfig) => {
11471147
}
11481148

11491149
logger.debug(`${files ? files.length : 0} spec files found`);
1150+
1151+
if (turboScaleSession) {
1152+
// remove unwanted path prefix for turboscale
1153+
files = files.map((x) => { return path.join(testFolderPath, x.split(testFolderPath)[1]) })
1154+
// setting specs for turboScale as we don't have patched API for turboscale so we will rely on info from CLI
1155+
bsConfig.run_settings.specs = files;
1156+
}
11501157
return files;
11511158
};
11521159

0 commit comments

Comments
 (0)