Commit 2d36e9e8 authored by Katharine Berry's avatar Katharine Berry

Add KUBE_COVERAGE_FLUSH_INTERVAL to set flush interval.

parent 0fb4b920
...@@ -29,7 +29,7 @@ import ( ...@@ -29,7 +29,7 @@ import (
"time" "time"
) )
const flushInterval = 5 * time.Second var flushInterval = 5 * time.Second
var coverageFile string var coverageFile string
...@@ -49,6 +49,10 @@ func InitCoverage(name string) { ...@@ -49,6 +49,10 @@ func InitCoverage(name string) {
coverageFile = "/tmp/k8s-" + name + ".cov" coverageFile = "/tmp/k8s-" + name + ".cov"
} }
if duration, err := time.ParseDuration(os.Getenv("KUBE_COVERAGE_FLUSH_INTERVAL")); err == nil {
flushInterval = duration
}
// Set up the unit test framework with the required arguments to activate test coverage. // Set up the unit test framework with the required arguments to activate test coverage.
flag.CommandLine.Parse([]string{"-test.coverprofile", tempCoveragePath()}) flag.CommandLine.Parse([]string{"-test.coverprofile", tempCoveragePath()})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment