k3s/hack/lib
Kubernetes Submit Queue 68d22a878d
Merge pull request #67971 from Katharine/coverage-instrumentation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Add ability to build with runtime coverage instrumentation

**What this PR does / why we need it**:

This PR adds the ability to instrument a subset of kubernetes binaries to report code coverage information. The specific use-case is to help determine coverage of our end-to-end Conformance tests, as well as provide data that can be used to help determine where to focus. This PR focuses on making it possible to build with instrumentation; collecting and using the generated coverage data will be done in later PRs. For more details as to the intent, see the [design doc](https://docs.google.com/document/d/1FKMBFxz7vtA-6ZgUkA47F8m6yR00fwqLcXMVJqsHt0g/edit?usp=sharing) (google doc; requires kubernetes-dev membership).

Specifically, this PR adds a new `KUBE_BUILD_WITH_COVERAGE` make variable, which when set will cause `kube-apiserver`, `kube-controller-manager`, `kube-scheduler`, `kube-proxy` and `kubelet` to be built with coverage instrumentation. These coverage-instrumented binaries will flush coverage information to disk every five seconds, defaulting to a temporary directory unless the `KUBE_COVERAGE_FILE` environment variable is set at launch, in which case it will write to that file instead.

The mechanism used to achieve coverage instrumentation is to build the targeted binaries as "unit tests" with coverage enabled, and then rigging the unit tests to just execute the binary's usual entry point. This is implemented only for the bash build system.

/sig testing

```release-note
NONE
```
2018-09-01 01:32:52 -07:00
..
.gitattributes Capture git export-subst strings in version.sh for 'git archive' use. 2017-11-09 16:36:27 -08:00
BUILD cluster: move logging library to hack/ 2018-01-13 16:37:50 -08:00
etcd.sh Merge pull request #63633 from misterikkit/hacktest 2018-08-23 14:15:08 -07:00
golang.sh Merge pull request #67971 from Katharine/coverage-instrumentation 2018-09-01 01:32:52 -07:00
init.sh Add autoscaling/v2beta2 and custom_metrics/v1beta2 to necessary files 2018-08-27 11:07:52 -04:00
logging.sh Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
protoc.sh Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
swagger.sh Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
test.sh Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
util.sh Improve bash formatting. 2018-08-30 16:18:15 -07:00
version.sh log bad format git version 2018-05-22 23:49:50 +08:00