-
Notifications
You must be signed in to change notification settings - Fork 495
Fix #962 - use the title for the jUnit test case name #1035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,11 +47,18 @@ func (r JUnit) Output(w io.Writer, results <-chan []resource.TestResult, | |||||
| endTime = testResult.EndTime | ||||||
| } | ||||||
| duration := strconv.FormatFloat(testResult.Duration.Seconds(), 'f', 3, 64) | ||||||
| summary[testCount] = "<testcase name=\"" + | ||||||
| testResult.ResourceType + " " + | ||||||
| escapeString(testResult.ResourceId) + " " + | ||||||
| testResult.Property + "\" " + | ||||||
| "time=\"" + duration + "\">\n" | ||||||
| testcaseName := fmt.Sprintf("%s %s %s", | ||||||
| testResult.ResourceType, | ||||||
| escapeString(testResult.ResourceId), | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could instead just escape once when building
Suggested change
|
||||||
| testResult.Property); | ||||||
| if (testResult.Title != "") { | ||||||
| testcaseName = escapeString(testResult.Title); | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
| summary[testCount] = fmt.Sprintf("<testcase name=\"%s\" time=\"%s\">\n", | ||||||
| testcaseName, | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| duration, | ||||||
| ); | ||||||
|
|
||||||
| if testResult.Result == resource.FAIL { | ||||||
| summary[testCount] += "<system-err>" + | ||||||
| escapeString(humanizeResult(testResult, true, includeRaw)) + | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you're mixing spaces and tabs, and have a number of unnecessary semicolons. Could you run
go fmtover the file?