diff --git a/bin/testObservability/helper/helper.js b/bin/testObservability/helper/helper.js index 1fd1353f..22906dde 100644 --- a/bin/testObservability/helper/helper.js +++ b/bin/testObservability/helper/helper.js @@ -163,16 +163,11 @@ exports.getTestEnv = () => { } exports.getFileSeparatorData = () => { - const fileSeparatorRegex = /^win/.test(process.platform) ? "\\\\" : "/"; - const fileSeparator = /^win/.test(process.platform) ? "\\" : "/"; - return { - fileSeparator, - fileSeparatorRegex - }; + return /^win/.test(process.platform) ? "\\" : "/"; } exports.findGitConfig = (filePath) => { - const { fileSeparator, fileSeparatorRegex } = exports.getFileSeparatorData(); + const fileSeparator = exports.getFileSeparatorData(); if(filePath == null || filePath == '' || filePath == fileSeparator) { return null; } @@ -180,7 +175,7 @@ exports.findGitConfig = (filePath) => { fs.statSync(filePath + fileSeparator + '.git' + fileSeparator + 'config'); return filePath; } catch(e) { - let parentFilePath = filePath.split(fileSeparatorRegex); + let parentFilePath = filePath.split(fileSeparator); parentFilePath.pop(); return exports.findGitConfig(parentFilePath.join(fileSeparator)); } @@ -1003,7 +998,7 @@ exports.runCypressTestsLocally = (bsConfig, args, rawArgs) => { const cypressProcess = spawn( 'npx', ['cypress', 'run', ...getReRunSpecs(rawArgs.slice(1)), ...getLocalSessionReporter()], - { stdio: 'inherit', cwd: process.cwd(), env: process.env } + { stdio: 'inherit', cwd: process.cwd(), env: process.env, shell: true } ); cypressProcess.on('close', async (code) => { logger.info(`Cypress process exited with code ${code}`); diff --git a/bin/testObservability/reporter/index.js b/bin/testObservability/reporter/index.js index c3e54b79..7c194b14 100644 --- a/bin/testObservability/reporter/index.js +++ b/bin/testObservability/reporter/index.js @@ -284,7 +284,7 @@ class MyReporter { if(!isBrowserstackInfra()) gitConfigPath = process.env.OBSERVABILITY_GIT_CONFIG_PATH_LOCAL ? process.env.OBSERVABILITY_GIT_CONFIG_PATH_LOCAL.toString() : null; const prefixedTestPath = rootParentFile ? this._paths.prefixTestPath(rootParentFile) : 'File path could not be found'; - const { fileSeparator, fileSeparatorRegex } = getFileSeparatorData(); + const fileSeparator = getFileSeparatorData(); let testData = { 'framework': 'Cypress',