Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 19 additions & 2 deletions bin/helpers/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ exports.getPackageVersion = (package_, bsConfig = null) => {
/* Try to find version from module path */
try {
packages[package_] = this.requireModule(`${package_}/package.json`).version;
logger.info(`Getting ${package_} package version from module path = ${packages[package_]}`);
logger.info(`INSIDE getPackageVersion in helper Getting ${package_} package version from module path = ${packages[package_]}`);
packageVersion = packages[package_];
} catch(e) {
exports.debug(`Unable to find package ${package_} at module path with error ${e}`);
Expand All @@ -69,7 +69,7 @@ exports.getPackageVersion = (package_, bsConfig = null) => {
typeof runSettings.npm_dependencies === 'object') {
if (package_ in runSettings.npm_dependencies) {
packages[package_] = runSettings.npm_dependencies[package_];
logger.info(`Getting ${package_} package version from browserstack.json = ${packages[package_]}`);
logger.info(`INSIDE getPackageVersion in helper Getting ${package_} package version from browserstack.json = ${packages[package_]}`);
packageVersion = packages[package_];
}
}
Expand All @@ -95,6 +95,8 @@ exports.getAgentVersion = () => {
}

exports.getGitMetaData = () => {
logger.info("getGitMetaData o11y ");

return new Promise(async (resolve, reject) => {
try {
var info = getRepoInfo();
Expand All @@ -111,12 +113,27 @@ exports.getGitMetaData = () => {
exports.debug(`Exception in populating Git Metadata with error : ${err}`, true, err);
return resolve({});
}

logger.info(`INSIDE getGitMetaData`);

gitLastCommit.getLastCommit(function(err, commit) {
// read commit object properties
logger.info(`INSIDE getLastCommit commit::`);
logger.info(commit);
logger.info(commit["branch"]);
console.log('INSIDE getLastCommit commit::');

console.log(commit);
console.log("branch", commit["branch"]);
});

try {
info["author"] = info["author"] || `${commit["author"]["name"].replace(/[“]+/g, '')} <${commit["author"]["email"].replace(/[“]+/g, '')}>`;
info["authorDate"] = info["authorDate"] || commit["authoredOn"];
info["committer"] = info["committer"] || `${commit["committer"]["name"].replace(/[“]+/g, '')} <${commit["committer"]["email"].replace(/[“]+/g, '')}>`;
info["committerDate"] = info["committerDate"] || commit["committedOn"];
info["commitMessage"] = info["commitMessage"] || commit["subject"];
info["branch"] = info["branch"] || commit["branch"];

const { remote } = await pGitconfig(info.commonGitDir);
const remotes = Object.keys(remote).map(remoteName => ({name: remoteName, url: remote[remoteName]['url']}));
Expand Down
4 changes: 2 additions & 2 deletions bin/testObservability/crashReporter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ getPackageVersion = (package_, bsConfig = null) => {
/* Try to find version from module path */
try {
packages[package_] = this.requireModule(`${package_}/package.json`).version;
logger.info(`Getting ${package_} package version from module path = ${packages[package_]}`);
logger.info(`INSIDE getPackageVersion in O11y crash reporter Getting ${package_} package version from module path = ${packages[package_]}`);
packageVersion = packages[package_];
} catch(e) {
debug(`Unable to find package ${package_} at module path with error ${e}`);
Expand All @@ -68,7 +68,7 @@ getPackageVersion = (package_, bsConfig = null) => {
typeof runSettings.npm_dependencies === 'object') {
if (package_ in runSettings.npm_dependencies) {
packages[package_] = runSettings.npm_dependencies[package_];
logger.info(`Getting ${package_} package version from browserstack.json = ${packages[package_]}`);
logger.info(`INSIDE getPackageVersion in O11y crash reporter Getting ${package_} package version from browserstack.json = ${packages[package_]}`);
packageVersion = packages[package_];
}
}
Expand Down
7 changes: 4 additions & 3 deletions bin/testObservability/helper/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ exports.getPackageVersion = (package_, bsConfig = null) => {
/* Try to find version from module path */
try {
packages[package_] = this.requireModule(`${package_}/package.json`).version;
logger.info(`Getting ${package_} package version from module path = ${packages[package_]}`);
logger.info(`INSIDE getPackageVersion in O11y helper Getting ${package_} package version from module path = ${packages[package_]}`);
packageVersion = packages[package_];
} catch(e) {
exports.debug(`Unable to find package ${package_} at module path with error ${e}`);
Expand All @@ -233,7 +233,7 @@ exports.getPackageVersion = (package_, bsConfig = null) => {
typeof runSettings.npm_dependencies === 'object') {
if (package_ in runSettings.npm_dependencies) {
packages[package_] = runSettings.npm_dependencies[package_];
logger.info(`Getting ${package_} package version from browserstack.json = ${packages[package_]}`);
logger.info(`INSIDE getPackageVersion in O11y helper Getting ${package_} package version from browserstack.json = ${packages[package_]}`);
packageVersion = packages[package_];
}
}
Expand Down Expand Up @@ -345,7 +345,8 @@ const setCrashReportingConfig = (bsConfig, bsConfigPath) => {

exports.launchTestSession = async (user_config, bsConfigPath) => {
setCrashReportingConfig(user_config, bsConfigPath);

logger.info("launchTestSession o11y ");

const obsUserName = user_config["auth"]["username"];
const obsAccessKey = user_config["auth"]["access_key"];

Expand Down
Loading