diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index b920116ab25..dd1e0a1ab39 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -148,6 +148,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}" --network="${KUBE_GCE_NETWORK:-${KUBE_GKE_NETWORK:-e2e}}" \ --node-tag="${NODE_TAG:-}" \ --master-tag="${MASTER_TAG:-}" \ + --cluster-monitoring-mode="${KUBE_ENABLE_CLUSTER_MONITORING:-influxdb}" \ ${KUBE_CONTAINER_RUNTIME:+"--container-runtime=${KUBE_CONTAINER_RUNTIME}"} \ ${MASTER_OS_DISTRIBUTION:+"--master-os-distro=${MASTER_OS_DISTRIBUTION}"} \ ${NODE_OS_DISTRIBUTION:+"--node-os-distro=${NODE_OS_DISTRIBUTION}"} \ diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index d70c2015e59..1b5eba11356 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -102,6 +102,8 @@ type TestContextType struct { FeatureGates string // Node e2e specific test context NodeTestContextType + // Monitoring solution that is used in current cluster. + ClusterMonitoringMode string // Indicates what path the kubernetes-anywhere is installed on KubernetesAnywherePath string @@ -221,6 +223,7 @@ func RegisterClusterFlags() { flag.StringVar(&TestContext.Prefix, "prefix", "e2e", "A prefix to be added to cloud resources created during testing.") flag.StringVar(&TestContext.MasterOSDistro, "master-os-distro", "debian", "The OS distribution of cluster master (debian, trusty, or coreos).") flag.StringVar(&TestContext.NodeOSDistro, "node-os-distro", "debian", "The OS distribution of cluster VM instances (debian, trusty, or coreos).") + flag.StringVar(&TestContext.ClusterMonitoringMode, "cluster-monitoring-mode", "influxdb", "The monitoring solution that is used in the cluster.") // TODO: Flags per provider? Rename gce-project/gce-zone? cloudConfig := &TestContext.CloudConfig diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 06ba68f1f68..4bbb9ae36e7 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -331,6 +331,12 @@ func SkipUnlessProviderIs(supportedProviders ...string) { } } +func SkipUnlessClusterMonitoringModeIs(supportedMonitoring ...string) { + if !ClusterMonitoringModeIs(supportedMonitoring...) { + Skipf("Only next monitoring modes are supported %v (not %s)", supportedMonitoring, TestContext.ClusterMonitoringMode) + } +} + func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string) { if !MasterOSDistroIs(supportedMasterOsDistros...) { Skipf("Only supported for master OS distro %v (not %s)", supportedMasterOsDistros, TestContext.MasterOSDistro) @@ -378,6 +384,15 @@ func ProviderIs(providers ...string) bool { return false } +func ClusterMonitoringModeIs(monitoringModes ...string) bool { + for _, mode := range monitoringModes { + if strings.ToLower(mode) == strings.ToLower(TestContext.ClusterMonitoringMode) { + return true + } + } + return false +} + func MasterOSDistroIs(supportedMasterOsDistros ...string) bool { for _, distro := range supportedMasterOsDistros { if strings.ToLower(distro) == strings.ToLower(TestContext.MasterOSDistro) { diff --git a/test/e2e/instrumentation/monitoring/influxdb.go b/test/e2e/instrumentation/monitoring/influxdb.go index 0dc27036dd1..f73a3b757e5 100644 --- a/test/e2e/instrumentation/monitoring/influxdb.go +++ b/test/e2e/instrumentation/monitoring/influxdb.go @@ -39,6 +39,7 @@ var _ = instrumentation.SIGDescribe("Monitoring", func() { BeforeEach(func() { framework.SkipUnlessProviderIs("gce") + framework.SkipUnlessClusterMonitoringModeIs("influxdb") }) It("should verify monitoring pods and all cluster nodes are available on influxdb using heapster.", func() {