-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add generic test coverage report format for SonarQube #1612
Conversation
018e2d4
to
9cb94d8
Compare
Pending to load assets for input packages
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.
This file has been renamed to be coveragereport.go
and part of its logic related to the Cobertura format has been moved to its own file coberturacoverage.go
@@ -153,6 +153,8 @@ func loadElasticsearchAssets(pkgRootPath string) ([]Asset, error) { | |||
} | |||
} | |||
|
|||
// TODO add assets for input packages |
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.
Created issue for this: #1623
type CoberturaMethod struct { | ||
Name string `xml:"name,attr"` | ||
Signature string `xml:"signature,attr"` | ||
LineRate float32 `xml:"line-rate,attr"` | ||
BranchRate float32 `xml:"branch-rate,attr"` | ||
Complexity float32 `xml:"complexity,attr"` | ||
Lines []*CoberturaLine `xml:"lines>line"` | ||
} |
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.
Removed Hits
field from this struct since it is not present in the DTD
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.
Do you know if this was used by the jenkins plugin?
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.
I just checked the Jenkins plugin code , looking at the code it does not look like it was used. And their tests do not include that field neither
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.
👍
type CoberturaMethod struct { | ||
Name string `xml:"name,attr"` | ||
Signature string `xml:"signature,attr"` | ||
LineRate float32 `xml:"line-rate,attr"` | ||
BranchRate float32 `xml:"branch-rate,attr"` | ||
Complexity float32 `xml:"complexity,attr"` | ||
Lines []*CoberturaLine `xml:"lines>line"` | ||
} |
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.
Do you know if this was used by the jenkins plugin?
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.
👍
💚 Build Succeeded
History
cc @mrodm |
Relates #1595
--coverage-format
flagPR to test these changes in the integrations repository: elastic/integrations#8464
Example of commands:
IMPORTANT: Introduced a workaround to be able to show coverage for asset, static, system and pipeline (if no ingest pipeline is defined) tests in SonarQube
Fixes performed in Cobertura format:
filename
attribute in class elementhits
key from CoberturaMethod (not present in the DTD).Before:
After using Cobertura:
After using Generic test format: