mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Fix JUnit message / type fields.
This commit is contained in:
parent
482d7087e0
commit
521e122f40
5 changed files with 18 additions and 6 deletions
|
|
@ -10,4 +10,5 @@ AcmeLibTests.AcmeLibTests
|
||||||
✅ test_always_pass
|
✅ test_always_pass
|
||||||
✅ test_always_skip
|
✅ test_always_skip
|
||||||
❌ test_always_fail
|
❌ test_always_fail
|
||||||
|
failed
|
||||||
```
|
```
|
||||||
|
|
@ -41,7 +41,7 @@ at java.lang.Thread.run(Thread.java:748)
|
||||||
|
|
||||||
",
|
",
|
||||||
"line": 29,
|
"line": 29,
|
||||||
"message": undefined,
|
"message": "java.lang.AssertionError: expected [1.2.1] but found [1.2.0]",
|
||||||
"path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java",
|
"path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java",
|
||||||
},
|
},
|
||||||
"name": "testVersionStrings",
|
"name": "testVersionStrings",
|
||||||
|
|
@ -100,7 +100,7 @@ at java.lang.Thread.run(Thread.java:748)
|
||||||
|
|
||||||
",
|
",
|
||||||
"line": 29,
|
"line": 29,
|
||||||
"message": undefined,
|
"message": "java.lang.AssertionError: expected [1.2.1] but found [1.2.0]",
|
||||||
"path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java",
|
"path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java",
|
||||||
},
|
},
|
||||||
"name": "testVersionStrings",
|
"name": "testVersionStrings",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ TestRunResult {
|
||||||
"error": {
|
"error": {
|
||||||
"details": undefined,
|
"details": undefined,
|
||||||
"line": undefined,
|
"line": undefined,
|
||||||
"message": undefined,
|
"message": "failed",
|
||||||
"path": undefined,
|
"path": undefined,
|
||||||
},
|
},
|
||||||
"name": "test_always_fail",
|
"name": "test_always_fail",
|
||||||
|
|
|
||||||
|
|
@ -137,11 +137,20 @@ export class JavaJunitParser implements TestParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let message
|
||||||
|
if(typeof failure === 'object') {
|
||||||
|
message = failure.$.message
|
||||||
|
if(failure.$?.type) {
|
||||||
|
message = failure.$.type + ": "+ message
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
path: filePath,
|
path: filePath,
|
||||||
line,
|
line,
|
||||||
details,
|
details,
|
||||||
message: typeof failure === 'object' ? failure.message : undefined
|
message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ export interface TestCase {
|
||||||
|
|
||||||
export interface Failure {
|
export interface Failure {
|
||||||
_: string
|
_: string
|
||||||
type: string
|
$: {
|
||||||
|
type?: string
|
||||||
message: string
|
message: string
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue