browserstack-cypress-cli 1.25.2 → 1.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -192,32 +192,41 @@ const getGitMetaData = () => {
192
192
  if(!info.author && exports.findGitConfig(process.cwd())) {
193
193
  /* commit objects are packed */
194
194
  gitLastCommit.getLastCommit(async (err, commit) => {
195
- info["author"] = info["author"] || `${commit["author"]["name"].replace(/[“]+/g, '')} <${commit["author"]["email"].replace(/[“]+/g, '')}>`;
196
- info["authorDate"] = info["authorDate"] || commit["authoredOn"];
197
- info["committer"] = info["committer"] || `${commit["committer"]["name"].replace(/[“]+/g, '')} <${commit["committer"]["email"].replace(/[“]+/g, '')}>`;
198
- info["committerDate"] = info["committerDate"] || commit["committedOn"]
199
- info["commitMessage"] = info["commitMessage"] || commit["subject"];
200
-
201
- const { remote } = await pGitconfig(info.commonGitDir);
202
- const remotes = Object.keys(remote).map(remoteName => ({name: remoteName, url: remote[remoteName]['url']}));
203
- resolve({
204
- "name": "git",
205
- "sha": info["sha"],
206
- "short_sha": info["abbreviatedSha"],
207
- "branch": info["branch"],
208
- "tag": info["tag"],
209
- "committer": info["committer"],
210
- "committer_date": info["committerDate"],
211
- "author": info["author"],
212
- "author_date": info["authorDate"],
213
- "commit_message": info["commitMessage"],
214
- "root": info["root"],
215
- "common_git_dir": info["commonGitDir"],
216
- "worktree_git_dir": info["worktreeGitDir"],
217
- "last_tag": info["lastTag"],
218
- "commits_since_last_tag": info["commitsSinceLastTag"],
219
- "remotes": remotes
220
- });
195
+ if(err) {
196
+ exports.debug(`Exception in populating Git Metadata with error : ${err}`, true, err);
197
+ return resolve({});
198
+ }
199
+ try {
200
+ info["author"] = info["author"] || `${commit["author"]["name"].replace(/[“]+/g, '')} <${commit["author"]["email"].replace(/[“]+/g, '')}>`;
201
+ info["authorDate"] = info["authorDate"] || commit["authoredOn"];
202
+ info["committer"] = info["committer"] || `${commit["committer"]["name"].replace(/[“]+/g, '')} <${commit["committer"]["email"].replace(/[“]+/g, '')}>`;
203
+ info["committerDate"] = info["committerDate"] || commit["committedOn"];
204
+ info["commitMessage"] = info["commitMessage"] || commit["subject"];
205
+
206
+ const { remote } = await pGitconfig(info.commonGitDir);
207
+ const remotes = Object.keys(remote).map(remoteName => ({name: remoteName, url: remote[remoteName]['url']}));
208
+ resolve({
209
+ "name": "git",
210
+ "sha": info["sha"],
211
+ "short_sha": info["abbreviatedSha"],
212
+ "branch": info["branch"],
213
+ "tag": info["tag"],
214
+ "committer": info["committer"],
215
+ "committer_date": info["committerDate"],
216
+ "author": info["author"],
217
+ "author_date": info["authorDate"],
218
+ "commit_message": info["commitMessage"],
219
+ "root": info["root"],
220
+ "common_git_dir": info["commonGitDir"],
221
+ "worktree_git_dir": info["worktreeGitDir"],
222
+ "last_tag": info["lastTag"],
223
+ "commits_since_last_tag": info["commitsSinceLastTag"],
224
+ "remotes": remotes
225
+ });
226
+ } catch(e) {
227
+ exports.debug(`Exception in populating Git Metadata with error : ${e}`, true, e);
228
+ return resolve({});
229
+ }
221
230
  }, {dst: exports.findGitConfig(process.cwd())});
222
231
  } else {
223
232
  const { remote } = await pGitconfig(info.commonGitDir);
@@ -470,7 +479,6 @@ const getBuildDetails = (bsConfig) => {
470
479
  const setBrowserstackCypressCliDependency = (bsConfig) => {
471
480
  const runSettings = bsConfig.run_settings;
472
481
  if (runSettings.npm_dependencies !== undefined &&
473
- Object.keys(runSettings.npm_dependencies).length !== 0 &&
474
482
  typeof runSettings.npm_dependencies === 'object') {
475
483
  if (!("browserstack-cypress-cli" in runSettings.npm_dependencies)) {
476
484
  logger.warn("Missing browserstack-cypress-cli not found in npm_dependencies");
@@ -583,7 +591,7 @@ exports.launchTestSession = async (user_config, bsConfigPath) => {
583
591
  exports.debug('Build creation successfull!');
584
592
  process.env.BS_TESTOPS_BUILD_COMPLETED = true;
585
593
  setEnvironmentVariablesForRemoteReporter(response.data.jwt, response.data.build_hashed_id, response.data.allow_screenshots, data.observability_version.sdkVersion);
586
- setEventListeners();
594
+ // setEventListeners();
587
595
  if(this.isBrowserstackInfra()) setBrowserstackCypressCliDependency(user_config);
588
596
  } catch(error) {
589
597
  if(!error.errorType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserstack-cypress-cli",
3
- "version": "1.25.2",
3
+ "version": "1.25.3",
4
4
  "description": "BrowserStack Cypress CLI for Cypress integration with BrowserStack's remote devices.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/log/usage.log DELETED
@@ -1 +0,0 @@
1
- {"level":"info","message":"Sending {\"event_type\":\"cypress_cli_stats\",\"data\":{\"bstack_json\":\"null\",\"run_settings\":\"\",\"os\":\"darwin\",\"os_version\":\"21.6.0\",\"bstack_json_found_in_pwd\":false,\"cypress_config_file_found_in_pwd\":null,\"cli_version\":\"1.24.4\",\"cli_path\":\"/Users/archish/.nvm/versions/node/v16.16.0/lib/node_modules\",\"npm_version\":\"8.11.0\",\"local_cypress_version\":null,\"ci_environment\":null,\"event_timestamp\":\"7/27/2023, 4:39:59 PM\",\"data\":null,\"raw_args\":\"[\\\"run\\\",\\\"--async\\\"]\",\"cli_args\":\"{\\\"_\\\":[\\\"run\\\"],\\\"async\\\":true,\\\"cf\\\":\\\"browserstack.json\\\",\\\"config-file\\\":\\\"browserstack.json\\\",\\\"configFile\\\":\\\"browserstack.json\\\",\\\"cli-debug\\\":false,\\\"cliDebug\\\":false,\\\"ccf\\\":\\\"./cypress.json\\\",\\\"cypress-config-file\\\":\\\"./cypress.json\\\",\\\"cypressConfigFile\\\":\\\"./cypress.json\\\",\\\"disable-npm-warning\\\":false,\\\"disableNpmWarning\\\":false,\\\"sync\\\":true,\\\"force-upload\\\":false,\\\"forceUpload\\\":false,\\\"headed\\\":false,\\\"no-wrap\\\":false,\\\"noWrap\\\":false,\\\"$0\\\":\\\"browserstack-cypress\\\"}\",\"message_type\":\"error\",\"error_code\":\"bstack_json_invalid_unknown\"}} to https://eds.browserstack.com:443/send_event_cy_internal","timestamp":"2023-07-27T11:09:59.626Z"}