mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
feat: consider tracked files to get absolute paths
This commit is contained in:
parent
0d3dd791da
commit
33125699e3
3 changed files with 23 additions and 4 deletions
|
|
@ -103,7 +103,7 @@ export class PytestJunitParser implements TestParser {
|
|||
|
||||
if (path && Number.isFinite(line)) {
|
||||
return {
|
||||
path: this.getRelativePath(path),
|
||||
path: this.getAbsolutePath(path),
|
||||
line,
|
||||
message: lines[1]
|
||||
}
|
||||
|
|
@ -121,6 +121,16 @@ export class PytestJunitParser implements TestParser {
|
|||
return path
|
||||
}
|
||||
|
||||
private getAbsolutePath(path: string): string {
|
||||
const relativePath = this.getRelativePath(path)
|
||||
for (const file of this.options.trackedFiles) {
|
||||
if (file.endsWith(relativePath)) {
|
||||
return file
|
||||
}
|
||||
}
|
||||
return relativePath
|
||||
}
|
||||
|
||||
private getWorkDir(path: string): string | undefined {
|
||||
return (
|
||||
this.options.workDir ??
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue