pkg/test/webhook-apicoverage/view
dushyanthsc b6f14473ea test/webhook-apicoverage: Add support to produce junit xml results (#651)
This change adds support to webhook apicoverage to produce coverage
results in junit xml format. The change only produces coverage
percentages. This can be used to push the results to end points like
test-grid.

The change also moves all the template files as go-strings as finding
relative paths to these files becomes tricky based on the deployment
environment.
2019-09-11 11:02:30 -07:00
..
README.md test/webhook-apicoverage: Add support to produce junit xml results (#651) 2019-09-11 11:02:30 -07:00
html_display.go test/webhook-apicoverage: Add support to produce junit xml results (#651) 2019-09-11 11:02:30 -07:00
html_template.go test/webhook-apicoverage: Add support to produce junit xml results (#651) 2019-09-11 11:02:30 -07:00
rule.go Move webhook apicoverage to knative/pkg (#555) 2019-08-06 07:16:55 -07:00
xml_display.go test/webhook-apicoverage: Add support to produce junit xml results (#651) 2019-09-11 11:02:30 -07:00
xml_template.go test/webhook-apicoverage: Add support to produce junit xml results (#651) 2019-09-11 11:02:30 -07:00

README.md

View

This package contains types and helper methods that repos can use to display API Coverage results.

DisplayRules provides a mechanism for repos to define their own display rules. DisplayHelper methods can use these rules to define how to display results.

GetHTMLDisplay() is a utility method that can be used by repos to get a HTML(JSON) like textual display of API Coverage. This method takes an array of TypeCoverage and DisplayRules object and returns a string representing its coverage in the color coded format inside a HTML page:

Package: <PackageName>
Type: <TypeName>
{
    <FieldName> <Ignored>/<Coverage:TrueorFalse> [Values]
    ....
    ....
    ....
}

GetHTMLCoverageValuesDisplay() is a utility method that can be used by repos to produce coverage values display. The method takes as input CoverageValue and produces a display in the format inside a HTML page:

CoverageValues:

Total Fields:  <Number of total fields>
Covered Fields: <Number of fields covered>
Ignored Fields: <Number of fields ignored>
Coverage Percentage: <Percentage value of coverage>

GetCoveragePercentageXMLDisplay() is a utility method that can be used by repos to produce coverage percentage for each resource in a Junit XML results file. The method takes CoveragePercentages as input and produces a Junit result file format.