Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
eaa0ebb
:sparkle: migration from request library to axios
Archish27 Jun 8, 2023
75468d8
:bug: fix for status code
Archish27 Jun 8, 2023
7313f92
:bug: fix for checking uploading specs
Archish27 Jun 8, 2023
b238df2
:art: for progress bar percentage
Archish27 Jun 8, 2023
4189e14
:bug: fix for zip upload
Archish27 Jun 9, 2023
1c29d31
:bug: fix for sending usage reporting
Archish27 Jun 12, 2023
de1f986
:bug: fix for getting initial details api
Archish27 Jun 12, 2023
0a082f1
:art: trimming the error message
Archish27 Jun 14, 2023
3b358a4
:art: trimming the error message
Archish27 Jun 14, 2023
c6c2eb0
:art: should show error message when build stopped
Archish27 Jun 14, 2023
f5a3b0c
:art: should show error message when build stopped
Archish27 Jun 14, 2023
e278e43
:art: should show error message when build stopped
Archish27 Jun 14, 2023
6a217b6
:bug: fix for build artifacts
Archish27 Jun 14, 2023
8e005f8
:bug: fix for build artifacts
Archish27 Jun 14, 2023
74e7992
:bug: fix for build artifacts
Archish27 Jun 14, 2023
9ba3f3b
Merge branch 'master' of https://github.com/browserstack/browserstack…
asambstack Jun 9, 2024
dc57a81
chore: fix build creation API
asambstack Jun 9, 2024
c2316ad
removed speedboats
dvspvk Jun 21, 2024
fb27ccf
turboscale=false
dvspvk Jun 24, 2024
68e7c6a
removed comments
dvspvk Jun 24, 2024
b2a638b
added browserstackinfra
dvspvk Jun 24, 2024
97380a5
updated package.json
dvspvk Jun 24, 2024
f53d2ee
Merge master
hari-haran-ss Oct 29, 2024
3367c62
Remove speedboats
hari-haran-ss Oct 29, 2024
a608608
Remove o11y crashreporter
hari-haran-ss Oct 29, 2024
0e4a1d3
fix: build artifacts shouldn't throw error when 404, graceful handling
asambstack Nov 14, 2024
31f44db
chore: remove unwanted comments
asambstack Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed comments
  • Loading branch information
dvspvk committed Jun 24, 2024
commit 68e7c6af19e67efbe6f2bd52baa2ae6aa63138df
136 changes: 0 additions & 136 deletions bin/commands/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ const archiver = require("../helpers/archiver"),
packageDiff = require('../helpers/package-diff');
const { getStackTraceUrl } = require('../helpers/sync/syncSpecsLogs');

// const {
// launchTestSession,
// setEventListeners,
// setTestObservabilityFlags,
// runCypressTestsLocally,
// printBuildLink
// } = require('../testObservability/helper/helper');


// const {
// createAccessibilityTestRun,
// setAccessibilityEventListeners,
// checkAccessibilityPlatform,
// supportFileCleanup
// } = require('../accessibility-automation/helper');
// const { isTurboScaleSession, getTurboScaleGridDetails, patchCypressConfigFileContent, atsFileCleanup } = require('../helpers/atsHelper');

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

markBlockStart('preBuild');
Expand All @@ -66,12 +49,6 @@ module.exports = function run(args, rawArgs) {
// set cypress config filename
utils.setCypressConfigFilename(bsConfig, args);

/*
Set testObservability & browserstackAutomation flags
*/
// const [isTestObservabilitySession, isBrowserstackInfra] = setTestObservabilityFlags(bsConfig);
// const checkAccessibility = checkAccessibilityPlatform(bsConfig);
// const isAccessibilitySession = bsConfig.run_settings.accessibility || checkAccessibility;
const turboScaleSession = false;
// Constants.turboScaleObj.enabled = turboScaleSession;

Expand All @@ -90,19 +67,6 @@ module.exports = function run(args, rawArgs) {
// accept the build name from command line if provided
utils.setBuildName(bsConfig, args);

// if(isBrowserstackInfra) {
// // set cypress test suite type
// utils.setCypressTestSuiteType(bsConfig);

// // set cypress geo location
// utils.setGeolocation(bsConfig, args);

// // set timezone
// utils.setTimezone(bsConfig, args);

// // set spec timeout
// utils.setSpecTimeout(bsConfig, args);
// }

// accept the specs list from command line if provided
utils.setUserSpecs(bsConfig, args);
Expand All @@ -112,107 +76,19 @@ module.exports = function run(args, rawArgs) {

// set build tag caps
utils.setBuildTags(bsConfig, args);

/*
Send build start to Observability
*/
// if(isTestObservabilitySession) {
// await launchTestSession(bsConfig, bsConfigPath);
// utils.setO11yProcessHooks(null, bsConfig, args, null, buildReportData);
// }

// accept the system env list from bsconf and set it
utils.setSystemEnvs(bsConfig);

// if(isBrowserstackInfra) {
// //accept the local from env variable if provided
// utils.setLocal(bsConfig, args);

// //set network logs
// utils.setNetworkLogs(bsConfig);

// // set Local Mode (on-demand/ always-on)
// utils.setLocalMode(bsConfig, args);

// //accept the local identifier from env variable if provided
// utils.setLocalIdentifier(bsConfig, args);

// // set Local Config File
// utils.setLocalConfigFile(bsConfig, args);

// // run test in headed mode
// utils.setHeaded(bsConfig, args);

// // set the no-wrap
// utils.setNoWrap(bsConfig, args);

// // add cypress dependency if missing
// utils.setCypressNpmDependency(bsConfig);

// if (isAccessibilitySession && isBrowserstackInfra) {
// await createAccessibilityTestRun(bsConfig);
// }

// if (turboScaleSession) {
// // Local is only required in case user is running on trial grid and wants to access private website.
// // Even then, it will be spawned separately via browserstack-cli ats connect-grid command and not via browserstack-cypress-cli
// // Hence whenever running on ATS, need to make local as false
// bsConfig.connection_settings.local = false;

// const gridDetails = await getTurboScaleGridDetails(bsConfig, args, rawArgs);

// if (gridDetails && Object.keys(gridDetails).length > 0) {
// Constants.turboScaleObj.gridDetails = gridDetails;
// Constants.turboScaleObj.gridUrl = gridDetails.cypressUrl;
// Constants.turboScaleObj.uploadUrl = gridDetails.cypressUrl + '/upload';
// Constants.turboScaleObj.buildUrl = gridDetails.cypressUrl + '/build';

// logger.debug(`Automate TurboScale Grid URL set to ${gridDetails.url}`);

// patchCypressConfigFileContent(bsConfig);
// } else {
// process.exitCode = Constants.ERROR_EXIT_CODE;
// return;
// }
// }
// }

const { packagesInstalled } = await packageInstaller.packageSetupAndInstaller(bsConfig, config.packageDirName, {markBlockStart, markBlockEnd});

// if(isBrowserstackInfra) {
// // set node version
// utils.setNodeVersion(bsConfig, args);

// //set browsers
// await utils.setBrowsers(bsConfig, args);

// //set config (--config)
// utils.setConfig(bsConfig, args);

// // set sync/async mode (--async/--sync)
// utils.setCLIMode(bsConfig, args);

// // set other cypress configs e.g. reporter and reporter-options
// utils.setOtherConfigs(bsConfig, args);
// }

markBlockEnd('setConfig');
logger.debug("Completed setting the configs");

// if(!isBrowserstackInfra) {
// return runCypressTestsLocally(bsConfig, args, rawArgs);
// }

// Validate browserstack.json values and parallels specified via arguments
markBlockStart('validateConfig');
logger.debug("Started configs validation");
return capabilityHelper.validate(bsConfig, args).then(function (cypressConfigFile) {
// if(process.env.BROWSERSTACK_TEST_ACCESSIBILITY) {
// setAccessibilityEventListeners(bsConfig);
// }
// if(process.env.BS_TESTOPS_BUILD_COMPLETED) {
// setEventListeners(bsConfig);
// }
markBlockEnd('validateConfig');
logger.debug("Completed configs validation");
markBlockStart('preArchiveSteps');
Expand Down Expand Up @@ -290,14 +166,6 @@ module.exports = function run(args, rawArgs) {
markBlockEnd('zip.zipUpload');
markBlockEnd('zip');

// if (process.env.BROWSERSTACK_TEST_ACCESSIBILITY === 'true') {
// supportFileCleanup();
// }

// if (turboScaleSession) {
// atsFileCleanup(bsConfig);
// }

// Set config args for enforce_settings
if ( !utils.isUndefinedOrFalse(bsConfig.run_settings.enforce_settings) ) {
markBlockStart('setEnforceSettingsConfig');
Expand All @@ -322,9 +190,6 @@ module.exports = function run(args, rawArgs) {
markBlockEnd('createBuild');
markBlockEnd('total');
utils.setProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData);
// if(isTestObservabilitySession) {
// utils.setO11yProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData);
// }
let message = `${data.message}! ${Constants.userMessages.BUILD_CREATED} with build id: ${data.build_id}`;
let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${data.dashboard_url}`;
buildReportData = { 'build_id': data.build_id, 'parallels': userSpecifiedParallels, ...buildReportData }
Expand Down Expand Up @@ -399,7 +264,6 @@ module.exports = function run(args, rawArgs) {
logger.info(dashboardLink);
if(!args.sync) {
logger.info(Constants.userMessages.EXIT_SYNC_CLI_MESSAGE.replace("<build-id>",data.build_id));
// printBuildLink(false);
}
let dataToSend = {
time_components: getTimeComponents(),
Expand Down
50 changes: 0 additions & 50 deletions bin/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const usageReporting = require("./usageReporting"),
config = require("../helpers/config"),
pkg = require('../../package.json'),
transports = require('./logger').transports
// o11yHelpers = require('../testObservability/helper/helper'),
// { OBSERVABILITY_ENV_VARS, TEST_OBSERVABILITY_REPORTER } = require('../testObservability/helper/constants');

const { default: axios } = require("axios");

Expand Down Expand Up @@ -481,10 +479,6 @@ exports.setNodeVersion = (bsConfig, args) => {
// specs can be passed via command line args as a string
// command line args takes precedence over config
exports.setUserSpecs = (bsConfig, args) => {
// if(o11yHelpers.isBrowserstackInfra() && o11yHelpers.isTestObservabilitySession() && o11yHelpers.shouldReRunObservabilityTests()) {
// bsConfig.run_settings.specs = process.env.BROWSERSTACK_RERUN_TESTS;
// return;
// }

let bsConfigSpecs = bsConfig.run_settings.specs;

Expand Down Expand Up @@ -577,19 +571,6 @@ exports.setSystemEnvs = (bsConfig) => {
logger.error(`Error in adding accessibility configs ${error}`)
}

// try {
// OBSERVABILITY_ENV_VARS.forEach(key => {
// envKeys[key] = process.env[key];
// });

// let gitConfigPath = o11yHelpers.findGitConfig(process.cwd());
// if(!o11yHelpers.isBrowserstackInfra()) process.env.OBSERVABILITY_GIT_CONFIG_PATH_LOCAL = gitConfigPath;
// if(gitConfigPath) {
// const relativePathFromGitConfig = path.relative(gitConfigPath, process.cwd());
// envKeys["OBSERVABILITY_GIT_CONFIG_PATH"] = relativePathFromGitConfig ? relativePathFromGitConfig : 'DEFAULT';
// }
// } catch(e){}

if (Object.keys(envKeys).length === 0) {
bsConfig.run_settings.system_env_vars = null;
} else {
Expand Down Expand Up @@ -1211,11 +1192,6 @@ exports.handleSyncExit = (exitCode, dashboard_url) => {
syncCliLogger.info(Constants.userMessages.BUILD_REPORT_MESSAGE);
syncCliLogger.info(dashboard_url);
}
// if(o11yHelpers.isTestObservabilitySession()) {
// o11yHelpers.printBuildLink(true, exitCode);
// } else {
// process.exit(exitCode);
// }
process.exit(exitCode);
}

Expand Down Expand Up @@ -1475,10 +1451,6 @@ exports.splitStringByCharButIgnoreIfWithinARange = (str, splitChar, leftLimiter,

// blindly send other passed configs with run_settings and handle at backend
exports.setOtherConfigs = (bsConfig, args) => {
// if(o11yHelpers.isTestObservabilitySession() && process.env.BS_TESTOPS_JWT) {
// bsConfig["run_settings"]["reporter"] = TEST_OBSERVABILITY_REPORTER;
// return;
// }

/* Non Observability use-case */
if (!this.isUndefined(args.reporter)) {
Expand Down Expand Up @@ -1644,21 +1616,6 @@ exports.setProcessHooks = (buildId, bsConfig, bsLocal, args, buildReportData) =>
process.on('uncaughtException', processExitHandler.bind(this, bindData));
}

// exports.setO11yProcessHooks = (() => {
// let bindData = {};
// let handlerAdded = false;
// return (buildId, bsConfig, bsLocal, args, buildReportData) => {
// bindData.buildId = buildId;
// bindData.bsConfig = bsConfig;
// bindData.bsLocal = bsLocal;
// bindData.args = args;
// bindData.buildReportData = buildReportData;
// if (handlerAdded) return;
// handlerAdded = true;
// process.on('beforeExit', processO11yExitHandler.bind(this, bindData));
// }
// })()

async function processExitHandler(exitData){
logger.warn(Constants.userMessages.PROCESS_KILL_MESSAGE);
await this.stopBrowserStackBuild(exitData.bsConfig, exitData.args, exitData.buildId, null, exitData.buildReportData);
Expand All @@ -1667,13 +1624,6 @@ async function processExitHandler(exitData){
process.exit(0);
}

// async function processO11yExitHandler(exitData){
// if (exitData.buildId) {
// await o11yHelpers.printBuildLink(false);
// } else {
// await o11yHelpers.printBuildLink(true);
// }
// }

exports.fetchZipSize = (fileName) => {
try {
Expand Down