Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 adding cypress dependency if absent in npm_dependencies #467

Merged
merged 7 commits into from
Mar 1, 2023
6 changes: 6 additions & 0 deletions bin/commands/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { getStackTraceUrl } = require('../helpers/sync/syncSpecsLogs');

module.exports = function run(args, rawArgs) {

markBlockStart('preBuild');
// set debug mode (--cli-debug)
utils.setDebugMode(args);

Expand Down Expand Up @@ -185,6 +186,8 @@ module.exports = function run(args, rawArgs) {
logger.debug("Started build creation");
markBlockStart('createBuild');
return build.createBuild(bsConfig, zip).then(function (data) {
markBlockEnd('preBuild');
markBlockStart('buildProcessing');
logger.debug("Completed build creation");
markBlockEnd('createBuild');
markBlockEnd('total');
Expand Down Expand Up @@ -216,6 +219,8 @@ module.exports = function run(args, rawArgs) {
if (args.sync) {
logger.debug("Started polling build status from BrowserStack");
syncRunner.pollBuildStatus(bsConfig, data, rawArgs, buildReportData).then(async (exitCode) => {
markBlockEnd('buildProcessing');
markBlockStart('postBuild');
logger.debug("Completed polling of build status");

// stop the Local instance
Expand All @@ -234,6 +239,7 @@ module.exports = function run(args, rawArgs) {
// Generate custom report!
reportGenerator(bsConfig, data.build_id, args, rawArgs, buildReportData, function(){
utils.sendUsageReport(bsConfig, args, `${message}\n${dashboardLink}`, Constants.messageTypes.SUCCESS, null, buildReportData, rawArgs);
markBlockEnd('postBuild');
utils.handleSyncExit(exitCode, data.dashboard_url);
});
} else {
Expand Down
12 changes: 12 additions & 0 deletions bin/helpers/checkUploaded.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ const checkUploadedMd5 = (bsConfig, args, instrumentBlocks) => {
zipUrlPresent: false,
packageUrlPresent: false,
};
const runSettings = bsConfig.run_settings;
if (typeof runSettings.npm_dependencies === 'object') {
if (!("cypress" in runSettings.npm_dependencies)) {
logger.warn("Missing cypress not found in npm_dependencies");
if ("cypress_version" in runSettings && !runSettings.cypress_version.toString().match(Constants.LATEST_VERSION_SYNTAX_REGEX)) {
runSettings.npm_dependencies.cypress = runSettings.cypress_version;
} else {
runSettings.npm_dependencies.cypress = "latest";
}
logger.warn(`Adding cypress version ${runSettings.npm_dependencies.cypress} in npm_dependencies`);
}
}
if (args["force-upload"]) {
logger.debug("force-upload set to true. Uploading tests and npm packages.");
return resolve(obj);
Expand Down