mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
extend ATC result structure & logs (#2548)
Co-authored-by: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com>
This commit is contained in:
parent
e60bdb94a6
commit
1c140e7cb4
@ -198,7 +198,7 @@ func parseATCResult(body []byte, atcResultFileName string) (err error) {
|
||||
piperutils.PersistReportsAndLinks("abapEnvironmentRunATCCheck", "", reports, nil)
|
||||
for _, s := range parsedXML.Files {
|
||||
for _, t := range s.ATCErrors {
|
||||
log.Entry().Error("Error in file " + s.Key + ": " + t.Key)
|
||||
log.Entry().Infof("%s in file '%s': %s in line %s found by %s", t.Severity, s.Key, t.Message, t.Line, t.Source)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -373,6 +373,9 @@ type File struct {
|
||||
|
||||
//ATCError with message
|
||||
type ATCError struct {
|
||||
Key string `xml:"message,attr"`
|
||||
Value string `xml:",chardata"`
|
||||
Text string `xml:",chardata"`
|
||||
Message string `xml:"message,attr"`
|
||||
Source string `xml:"source,attr"`
|
||||
Line string `xml:"line,attr"`
|
||||
Severity string `xml:"severity,attr"`
|
||||
}
|
||||
|
@ -236,13 +236,13 @@ func TestParseATCResult(t *testing.T) {
|
||||
bodyString := `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<checkstyle>
|
||||
<file name="testFile">
|
||||
<error message="testMessage">
|
||||
<error message="testMessage1" source="sourceTester" line="1" severity="error">
|
||||
</error>
|
||||
<error message="testMessage2">
|
||||
<error message="testMessage2" source="sourceTester" line="2" severity="info">
|
||||
</error>
|
||||
</file>
|
||||
<file name="testFile2">
|
||||
<error message="testMessage3">
|
||||
<error message="testMessage" source="sourceTester" line="1" severity="error">
|
||||
</error>
|
||||
</file>
|
||||
</checkstyle>`
|
||||
|
Loading…
x
Reference in New Issue
Block a user