Commit 4a785d06 authored by gmarek's avatar gmarek

Enable Add-On resource gathering in scalability tests

parent 3136acad
......@@ -426,7 +426,8 @@ case ${JOB_NAME} in
kubernetes-e2e-gce-scalability)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-scalability"}
: ${E2E_NETWORK:="e2e-scalability"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\]"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\] \
--gather-resource-usage=true"}
: ${KUBE_GCE_INSTANCE_PREFIX:="e2e-scalability"}
: ${PROJECT:="kubernetes-jenkins"}
# Override GCE defaults.
......
......@@ -82,6 +82,9 @@ var _ = Describe("Density [Skipped]", func() {
var ns string
var uuid string
framework := NewFramework("density")
framework.NamespaceDeletionTimeout = time.Hour
// Gathers data prior to framework namespace teardown
AfterEach(func() {
// Remove any remaining pods from this test if the
......@@ -110,10 +113,6 @@ var _ = Describe("Density [Skipped]", func() {
Expect(highLatencyRequests).NotTo(BeNumerically(">", 0), "There should be no high-latency requests")
})
framework := NewFramework("density")
framework.NamespaceDeletionTimeout = time.Hour
framework.GatherKubeSystemResourceUsageData = testContext.GatherKubeSystemResourceUsageData
BeforeEach(func() {
c = framework.Client
ns = framework.Namespace.Name
......
......@@ -84,7 +84,7 @@ func init() {
flag.BoolVar(&testContext.VerifyServiceAccount, "e2e-verify-service-account", true, "If true tests will verify the service account before running.")
flag.BoolVar(&testContext.DeleteNamespace, "delete-namespace", true, "If true tests will delete namespace after completion. It is only designed to make debugging easier, DO NOT turn it off by default.")
flag.BoolVar(&testContext.CleanStart, "clean-start", false, "If true, purge all namespaces except default and system before running tests. This serves to cleanup test namespaces from failed/interrupted e2e runs in a long-lived cluster.")
flag.BoolVar(&testContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", true, "If set to true framework will be monitoring resource usage of system add-ons in (some) e2e tests.")
flag.BoolVar(&testContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", false, "If set to true framework will be monitoring resource usage of system add-ons in (some) e2e tests.")
}
func TestE2E(t *testing.T) {
......
......@@ -40,10 +40,7 @@ type Framework struct {
Client *client.Client
NamespaceDeletionTimeout time.Duration
// If set to true framework will start a goroutine monitoring resource usage of system add-ons.
// It will read the data every 30 seconds from all Nodes and print summary during afterEach.
GatherKubeSystemResourceUsageData bool
gatherer containerResourceGatherer
gatherer containerResourceGatherer
}
// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
......@@ -81,7 +78,7 @@ func (f *Framework) beforeEach() {
Logf("Skipping waiting for service account")
}
if f.GatherKubeSystemResourceUsageData {
if testContext.GatherKubeSystemResourceUsageData {
f.gatherer.startGatheringData(c, time.Minute)
}
}
......@@ -125,7 +122,7 @@ func (f *Framework) afterEach() {
Logf("Found DeleteNamespace=false, skipping namespace deletion!")
}
if f.GatherKubeSystemResourceUsageData {
if testContext.GatherKubeSystemResourceUsageData {
f.gatherer.stopAndPrintData([]int{50, 90, 99, 100})
}
// Paranoia-- prevent reuse!
......
......@@ -119,22 +119,24 @@ type CloudConfig struct {
}
type TestContextType struct {
KubeConfig string
KubeContext string
CertDir string
Host string
RepoRoot string
Provider string
CloudConfig CloudConfig
KubectlPath string
OutputDir string
prefix string
MinStartupPods int
UpgradeTarget string
PrometheusPushGateway string
VerifyServiceAccount bool
DeleteNamespace bool
CleanStart bool
KubeConfig string
KubeContext string
CertDir string
Host string
RepoRoot string
Provider string
CloudConfig CloudConfig
KubectlPath string
OutputDir string
prefix string
MinStartupPods int
UpgradeTarget string
PrometheusPushGateway string
VerifyServiceAccount bool
DeleteNamespace bool
CleanStart bool
// If set to true framework will start a goroutine monitoring resource usage of system add-ons.
// It will read the data every 30 seconds from all Nodes and print summary during afterEach.
GatherKubeSystemResourceUsageData bool
}
......
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