pkg/test/webhook-apicoverage/coveragecalculator
Ignacio Cano 62d3aa64b5 Renaming Importer to Source (#662)
* source stats reporter... should be used by well-behaved sources

* public fields

* moving serialization/deserialization of metrics and logging maps to pkg

* nits

* adding UT

* same order

* updates

* sock-puppet

* unregistration problem?

* removing base64 encoding

* removing TODO

* removing config changes... done in another PR

* to properly address the comment

* changing importer to source
2019-09-11 13:16:31 -07:00
..
README.md Move webhook apicoverage to knative/pkg (#555) 2019-08-06 07:16:55 -07:00
calculator.go Renaming Importer to Source (#662) 2019-09-11 13:16:31 -07:00
coveragedata.go golang format tools (#637) 2019-09-06 07:26:05 -07:00
ignorefields.go Move webhook apicoverage to knative/pkg (#555) 2019-08-06 07:16:55 -07:00

README.md

Coverage Calculator

coveragecalculator package contains types and helper methods pertaining to coverage calculation.

TypeCoverage is a type to represent coverage data for a particular API object type. This is the wire contract between the webhook server running inside the K8s cluster and any client using the API-Coverage tool. All API calls into the webhook-server would return response containing this object to represent coverage data.

IgnoredFields type provides ability for individual repos to specify fields that they would like the API Coverage tool to ignore for coverage calculation. Individual repos are expected to provide a .yaml file providing fields that they would like to ignore and use helper method ReadFromFile(filePath) to read and intialize this type. FieldIgnored() can then be called by providing packageName, typeName and FieldName to check if the field needs to be ignored.

CalculateCoverage method provides a capability to calculate coverage values. This method takes an array of TypeCoverage and iterates over them to aggreage coverage values. The aggregate result is encapsulated inside CoverageValues and returned.