diff --git a/dist/index.js b/dist/index.js index 2fb089c6..70d1dcd3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1407,38 +1407,20 @@ exports.MochaJsonParser = MochaJsonParser; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parseStackTraceElement = void 0; -// classloader and module name are optional: -// at //(:) -// https://github.com/eclipse-openj9/openj9/issues/11452#issuecomment-754946992 -const re = /^\s*at (\S+\/\S*\/)?(.*)\((.*):(\d+)\)$/; +// perl: # at t/test1.t line 23. +const re = /\s+at (.*) line (\d+)\.$/; function parseStackTraceElement(stackTraceLine) { const match = stackTraceLine.match(re); if (match !== null) { - const [_, maybeClassLoaderAndModuleNameAndVersion, tracePath, fileName, lineStr] = match; - const { classLoader, moduleNameAndVersion } = parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion); + const [_, filePath, lineStr] = match; return { - classLoader, - moduleNameAndVersion, - tracePath, - fileName, + filePath, lineStr }; } return undefined; } exports.parseStackTraceElement = parseStackTraceElement; -function parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion) { - if (maybeClassLoaderAndModuleNameAndVersion) { - const res = maybeClassLoaderAndModuleNameAndVersion.split('/'); - const classLoader = res[0]; - let moduleNameAndVersion = res[1]; - if (moduleNameAndVersion === '') { - moduleNameAndVersion = undefined; - } - return { classLoader, moduleNameAndVersion }; - } - return { classLoader: undefined, moduleNameAndVersion: undefined }; -} /***/ }), @@ -1482,6 +1464,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PerlJunitParser = void 0; +/* + NOTICE: this dir is copied from parsers/java-junit, No any other changes except class name + We should copy test file too when we develop perl parser based on it. +*/ const path = __importStar(__nccwpck_require__(1017)); const xml2js_1 = __nccwpck_require__(6189); const java_stack_trace_element_parser_1 = __nccwpck_require__(5424); @@ -1615,8 +1601,7 @@ class PerlJunitParser { for (const str of lines) { const stackTraceElement = (0, java_stack_trace_element_parser_1.parseStackTraceElement)(str); if (stackTraceElement) { - const { tracePath, fileName, lineStr } = stackTraceElement; - const filePath = this.getFilePath(tracePath, fileName); + const { filePath, lineStr } = stackTraceElement; if (filePath !== undefined) { const line = parseInt(lineStr); return { filePath, line }; diff --git a/src/parsers/perl-junit/perl-junit-parser.ts b/src/parsers/perl-junit/perl-junit-parser.ts index dbd965c9..34d11fd2 100644 --- a/src/parsers/perl-junit/perl-junit-parser.ts +++ b/src/parsers/perl-junit/perl-junit-parser.ts @@ -155,8 +155,7 @@ export class PerlJunitParser implements TestParser { for (const str of lines) { const stackTraceElement = parseStackTraceElement(str) if (stackTraceElement) { - const {tracePath, fileName, lineStr} = stackTraceElement - const filePath = this.getFilePath(tracePath, fileName) + const {filePath, lineStr} = stackTraceElement if (filePath !== undefined) { const line = parseInt(lineStr) return {filePath, line}