Skip to content

Commit 68e7c6a

Browse files
committed
removed comments
1 parent fb27ccf commit 68e7c6a

File tree

2 files changed

+0
-186
lines changed

2 files changed

+0
-186
lines changed

bin/commands/runs.js

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,6 @@ const archiver = require("../helpers/archiver"),
2323
packageDiff = require('../helpers/package-diff');
2424
const { getStackTraceUrl } = require('../helpers/sync/syncSpecsLogs');
2525

26-
// const {
27-
// launchTestSession,
28-
// setEventListeners,
29-
// setTestObservabilityFlags,
30-
// runCypressTestsLocally,
31-
// printBuildLink
32-
// } = require('../testObservability/helper/helper');
33-
34-
35-
// const {
36-
// createAccessibilityTestRun,
37-
// setAccessibilityEventListeners,
38-
// checkAccessibilityPlatform,
39-
// supportFileCleanup
40-
// } = require('../accessibility-automation/helper');
41-
// const { isTurboScaleSession, getTurboScaleGridDetails, patchCypressConfigFileContent, atsFileCleanup } = require('../helpers/atsHelper');
42-
4326
module.exports = function run(args, rawArgs) {
4427

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

69-
/*
70-
Set testObservability & browserstackAutomation flags
71-
*/
72-
// const [isTestObservabilitySession, isBrowserstackInfra] = setTestObservabilityFlags(bsConfig);
73-
// const checkAccessibility = checkAccessibilityPlatform(bsConfig);
74-
// const isAccessibilitySession = bsConfig.run_settings.accessibility || checkAccessibility;
7552
const turboScaleSession = false;
7653
// Constants.turboScaleObj.enabled = turboScaleSession;
7754

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

93-
// if(isBrowserstackInfra) {
94-
// // set cypress test suite type
95-
// utils.setCypressTestSuiteType(bsConfig);
96-
97-
// // set cypress geo location
98-
// utils.setGeolocation(bsConfig, args);
99-
100-
// // set timezone
101-
// utils.setTimezone(bsConfig, args);
102-
103-
// // set spec timeout
104-
// utils.setSpecTimeout(bsConfig, args);
105-
// }
10670

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

11377
// set build tag caps
11478
utils.setBuildTags(bsConfig, args);
115-
116-
/*
117-
Send build start to Observability
118-
*/
119-
// if(isTestObservabilitySession) {
120-
// await launchTestSession(bsConfig, bsConfigPath);
121-
// utils.setO11yProcessHooks(null, bsConfig, args, null, buildReportData);
122-
// }
12379

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

127-
// if(isBrowserstackInfra) {
128-
// //accept the local from env variable if provided
129-
// utils.setLocal(bsConfig, args);
130-
131-
// //set network logs
132-
// utils.setNetworkLogs(bsConfig);
133-
134-
// // set Local Mode (on-demand/ always-on)
135-
// utils.setLocalMode(bsConfig, args);
136-
137-
// //accept the local identifier from env variable if provided
138-
// utils.setLocalIdentifier(bsConfig, args);
139-
140-
// // set Local Config File
141-
// utils.setLocalConfigFile(bsConfig, args);
142-
143-
// // run test in headed mode
144-
// utils.setHeaded(bsConfig, args);
145-
146-
// // set the no-wrap
147-
// utils.setNoWrap(bsConfig, args);
148-
149-
// // add cypress dependency if missing
150-
// utils.setCypressNpmDependency(bsConfig);
151-
152-
// if (isAccessibilitySession && isBrowserstackInfra) {
153-
// await createAccessibilityTestRun(bsConfig);
154-
// }
155-
156-
// if (turboScaleSession) {
157-
// // Local is only required in case user is running on trial grid and wants to access private website.
158-
// // Even then, it will be spawned separately via browserstack-cli ats connect-grid command and not via browserstack-cypress-cli
159-
// // Hence whenever running on ATS, need to make local as false
160-
// bsConfig.connection_settings.local = false;
161-
162-
// const gridDetails = await getTurboScaleGridDetails(bsConfig, args, rawArgs);
163-
164-
// if (gridDetails && Object.keys(gridDetails).length > 0) {
165-
// Constants.turboScaleObj.gridDetails = gridDetails;
166-
// Constants.turboScaleObj.gridUrl = gridDetails.cypressUrl;
167-
// Constants.turboScaleObj.uploadUrl = gridDetails.cypressUrl + '/upload';
168-
// Constants.turboScaleObj.buildUrl = gridDetails.cypressUrl + '/build';
169-
170-
// logger.debug(`Automate TurboScale Grid URL set to ${gridDetails.url}`);
171-
172-
// patchCypressConfigFileContent(bsConfig);
173-
// } else {
174-
// process.exitCode = Constants.ERROR_EXIT_CODE;
175-
// return;
176-
// }
177-
// }
178-
// }
179-
18083
const { packagesInstalled } = await packageInstaller.packageSetupAndInstaller(bsConfig, config.packageDirName, {markBlockStart, markBlockEnd});
18184

182-
// if(isBrowserstackInfra) {
183-
// // set node version
184-
// utils.setNodeVersion(bsConfig, args);
185-
186-
// //set browsers
187-
// await utils.setBrowsers(bsConfig, args);
188-
189-
// //set config (--config)
190-
// utils.setConfig(bsConfig, args);
191-
192-
// // set sync/async mode (--async/--sync)
193-
// utils.setCLIMode(bsConfig, args);
194-
195-
// // set other cypress configs e.g. reporter and reporter-options
196-
// utils.setOtherConfigs(bsConfig, args);
197-
// }
198-
19985
markBlockEnd('setConfig');
20086
logger.debug("Completed setting the configs");
20187

202-
// if(!isBrowserstackInfra) {
203-
// return runCypressTestsLocally(bsConfig, args, rawArgs);
204-
// }
205-
20688
// Validate browserstack.json values and parallels specified via arguments
20789
markBlockStart('validateConfig');
20890
logger.debug("Started configs validation");
20991
return capabilityHelper.validate(bsConfig, args).then(function (cypressConfigFile) {
210-
// if(process.env.BROWSERSTACK_TEST_ACCESSIBILITY) {
211-
// setAccessibilityEventListeners(bsConfig);
212-
// }
213-
// if(process.env.BS_TESTOPS_BUILD_COMPLETED) {
214-
// setEventListeners(bsConfig);
215-
// }
21692
markBlockEnd('validateConfig');
21793
logger.debug("Completed configs validation");
21894
markBlockStart('preArchiveSteps');
@@ -290,14 +166,6 @@ module.exports = function run(args, rawArgs) {
290166
markBlockEnd('zip.zipUpload');
291167
markBlockEnd('zip');
292168

293-
// if (process.env.BROWSERSTACK_TEST_ACCESSIBILITY === 'true') {
294-
// supportFileCleanup();
295-
// }
296-
297-
// if (turboScaleSession) {
298-
// atsFileCleanup(bsConfig);
299-
// }
300-
301169
// Set config args for enforce_settings
302170
if ( !utils.isUndefinedOrFalse(bsConfig.run_settings.enforce_settings) ) {
303171
markBlockStart('setEnforceSettingsConfig');
@@ -322,9 +190,6 @@ module.exports = function run(args, rawArgs) {
322190
markBlockEnd('createBuild');
323191
markBlockEnd('total');
324192
utils.setProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData);
325-
// if(isTestObservabilitySession) {
326-
// utils.setO11yProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData);
327-
// }
328193
let message = `${data.message}! ${Constants.userMessages.BUILD_CREATED} with build id: ${data.build_id}`;
329194
let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${data.dashboard_url}`;
330195
buildReportData = { 'build_id': data.build_id, 'parallels': userSpecifiedParallels, ...buildReportData }
@@ -399,7 +264,6 @@ module.exports = function run(args, rawArgs) {
399264
logger.info(dashboardLink);
400265
if(!args.sync) {
401266
logger.info(Constants.userMessages.EXIT_SYNC_CLI_MESSAGE.replace("<build-id>",data.build_id));
402-
// printBuildLink(false);
403267
}
404268
let dataToSend = {
405269
time_components: getTimeComponents(),

bin/helpers/utils.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ const usageReporting = require("./usageReporting"),
2222
config = require("../helpers/config"),
2323
pkg = require('../../package.json'),
2424
transports = require('./logger').transports
25-
// o11yHelpers = require('../testObservability/helper/helper'),
26-
// { OBSERVABILITY_ENV_VARS, TEST_OBSERVABILITY_REPORTER } = require('../testObservability/helper/constants');
2725

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

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

489483
let bsConfigSpecs = bsConfig.run_settings.specs;
490484

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

580-
// try {
581-
// OBSERVABILITY_ENV_VARS.forEach(key => {
582-
// envKeys[key] = process.env[key];
583-
// });
584-
585-
// let gitConfigPath = o11yHelpers.findGitConfig(process.cwd());
586-
// if(!o11yHelpers.isBrowserstackInfra()) process.env.OBSERVABILITY_GIT_CONFIG_PATH_LOCAL = gitConfigPath;
587-
// if(gitConfigPath) {
588-
// const relativePathFromGitConfig = path.relative(gitConfigPath, process.cwd());
589-
// envKeys["OBSERVABILITY_GIT_CONFIG_PATH"] = relativePathFromGitConfig ? relativePathFromGitConfig : 'DEFAULT';
590-
// }
591-
// } catch(e){}
592-
593574
if (Object.keys(envKeys).length === 0) {
594575
bsConfig.run_settings.system_env_vars = null;
595576
} else {
@@ -1211,11 +1192,6 @@ exports.handleSyncExit = (exitCode, dashboard_url) => {
12111192
syncCliLogger.info(Constants.userMessages.BUILD_REPORT_MESSAGE);
12121193
syncCliLogger.info(dashboard_url);
12131194
}
1214-
// if(o11yHelpers.isTestObservabilitySession()) {
1215-
// o11yHelpers.printBuildLink(true, exitCode);
1216-
// } else {
1217-
// process.exit(exitCode);
1218-
// }
12191195
process.exit(exitCode);
12201196
}
12211197

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

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

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

1647-
// exports.setO11yProcessHooks = (() => {
1648-
// let bindData = {};
1649-
// let handlerAdded = false;
1650-
// return (buildId, bsConfig, bsLocal, args, buildReportData) => {
1651-
// bindData.buildId = buildId;
1652-
// bindData.bsConfig = bsConfig;
1653-
// bindData.bsLocal = bsLocal;
1654-
// bindData.args = args;
1655-
// bindData.buildReportData = buildReportData;
1656-
// if (handlerAdded) return;
1657-
// handlerAdded = true;
1658-
// process.on('beforeExit', processO11yExitHandler.bind(this, bindData));
1659-
// }
1660-
// })()
1661-
16621619
async function processExitHandler(exitData){
16631620
logger.warn(Constants.userMessages.PROCESS_KILL_MESSAGE);
16641621
await this.stopBrowserStackBuild(exitData.bsConfig, exitData.args, exitData.buildId, null, exitData.buildReportData);
@@ -1667,13 +1624,6 @@ async function processExitHandler(exitData){
16671624
process.exit(0);
16681625
}
16691626

1670-
// async function processO11yExitHandler(exitData){
1671-
// if (exitData.buildId) {
1672-
// await o11yHelpers.printBuildLink(false);
1673-
// } else {
1674-
// await o11yHelpers.printBuildLink(true);
1675-
// }
1676-
// }
16771627

16781628
exports.fetchZipSize = (fileName) => {
16791629
try {

0 commit comments

Comments
 (0)