Skip to content

Commit bfdfd52

Browse files
committed
Merge branch 'master' of https://github.com/browserstack/browserstack-cypress-cli into build_artifacts_logging
2 parents 6a6bb55 + a2cbd75 commit bfdfd52

File tree

8 files changed

+54
-5
lines changed

8 files changed

+54
-5
lines changed

Diff for: bin/commands/runs.js

+5
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)) {

Diff for: bin/helpers/archiver.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,30 @@ const archiveSpecs = (runSettings, filePath, excludeFiles, md5data) => {
7272
});
7373
}
7474

75+
// Split mac and win configs
76+
let macPackageJSON = {};
77+
let winPackageJSON = {};
78+
Object.assign(macPackageJSON, packageJSON);
79+
Object.assign(winPackageJSON, packageJSON);
80+
81+
if (typeof runSettings.npm_dependencies === 'object') {
82+
let macNpmDependencies = Object.assign({}, runSettings.npm_dependencies, runSettings.mac_npm_dependencies || {});
83+
let winNpmDependencies = Object.assign({}, runSettings.npm_dependencies, runSettings.win_npm_dependencies || {});
84+
85+
Object.assign(macPackageJSON, {
86+
devDependencies: macNpmDependencies,
87+
});
88+
89+
Object.assign(winPackageJSON, {
90+
devDependencies: winNpmDependencies,
91+
});
92+
}
93+
7594
if (Object.keys(packageJSON).length > 0) {
76-
let packageJSONString = JSON.stringify(packageJSON, null, 4);
77-
archive.append(packageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-package.json`});
95+
const macPackageJSONString = JSON.stringify(macPackageJSON, null, 4);
96+
const winPackageJSONString = JSON.stringify(winPackageJSON, null, 4);
97+
archive.append(macPackageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-mac-package.json`});
98+
archive.append(winPackageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-win-package.json`});
7899
}
79100

80101
//Create copy of package.json

Diff for: bin/helpers/checkUploaded.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
const request = require('request');
3+
const { combineMacWinNpmDependencies } = require('./helper');
34

45
const crypto = require('crypto'),
56
Constants = require('./constants'),
@@ -59,7 +60,7 @@ const checkPackageMd5 = (runSettings) => {
5960

6061
if (typeof runSettings.npm_dependencies === 'object') {
6162
Object.assign(packageJSON, {
62-
devDependencies: utils.sortJsonKeys(runSettings.npm_dependencies),
63+
devDependencies: utils.sortJsonKeys(combineMacWinNpmDependencies(runSettings)),
6364
});
6465
}
6566

Diff for: bin/helpers/constants.js

+5
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:
@@ -343,7 +344,11 @@ const filesToIgnoreWhileUploading = [
343344
"package.json",
344345
"**/package.json",
345346
"browserstack-package.json",
347+
"browserstack-mac-package.json",
348+
"browserstack-win-package.json",
346349
"**/browserstack-package.json",
350+
"**/browserstack-mac-package.json",
351+
"**/browserstack-win-package.json",
347352
"tests.zip",
348353
"**/tests.zip",
349354
"cypress.json",

Diff for: bin/helpers/helper.js

+4
Original file line numberDiff line numberDiff line change
@@ -441,3 +441,7 @@ exports.truncateString = (field, truncateSizeInBytes) => {
441441

442442
return field;
443443
};
444+
445+
exports.combineMacWinNpmDependencies = (runSettings) => {
446+
return Object.assign({}, runSettings.npm_dependencies, runSettings.win_npm_dependencies || {}, runSettings.mac_npm_dependencies || {})
447+
};

Diff for: bin/helpers/packageInstaller.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
cliUtils = require("./utils"),
1313
util = require('util');
1414

15+
const { combineMacWinNpmDependencies } = require("./helper");
16+
1517
let nodeProcess;
1618

1719
const setupPackageFolder = (runSettings, directoryPath) => {
@@ -29,9 +31,10 @@ const setupPackageFolder = (runSettings, directoryPath) => {
2931
Object.assign(packageJSON, runSettings.package_config_options);
3032
}
3133

34+
// Combine win and mac specific dependencies if present
3235
if (typeof runSettings.npm_dependencies === 'object') {
3336
Object.assign(packageJSON, {
34-
devDependencies: runSettings.npm_dependencies,
37+
devDependencies: combineMacWinNpmDependencies(runSettings),
3538
});
3639
}
3740

Diff for: bin/helpers/utils.js

+10
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ exports.setDefaults = (bsConfig, args) => {
222222
bsConfig.run_settings.npm_dependencies = {}
223223
}
224224

225+
// setting win_npm_dependencies to {} if not present
226+
if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.win_npm_dependencies)) {
227+
bsConfig.run_settings.win_npm_dependencies = {}
228+
}
229+
230+
// setting mac_npm_dependencies to {} if not present
231+
if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.mac_npm_dependencies)) {
232+
bsConfig.run_settings.mac_npm_dependencies = {}
233+
}
234+
225235
// setting connection_settings to {} if not present
226236
if (this.isUndefined(bsConfig.connection_settings)) {
227237
bsConfig.connection_settings = {};

Diff for: package.json

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

0 commit comments

Comments
 (0)