// If set to true test will dump data about the namespace in which test was running.
DumpLogsOnFailurebool
// Name of the node to run tests on (node e2e suite only).
NodeNamestring
}
typeCloudConfigstruct{
...
...
@@ -83,7 +85,8 @@ type CloudConfig struct {
varTestContextTestContextType
varfederatedKubeContextstring
funcRegisterFlags(){
// Register flags common to all e2e test suites.
funcRegisterCommonFlags(){
// Turn on verbose by default to get spec names
config.DefaultReporterConfig.Verbose=true
...
...
@@ -93,6 +96,19 @@ func RegisterFlags() {
// Randomize specs as well as suites
config.GinkgoConfig.RandomizeAllSpecs=true
flag.StringVar(&TestContext.GatherKubeSystemResourceUsageData,"gather-resource-usage","false","If set to 'true' or 'all' framework will be monitoring resource usage of system all add-ons in (some) e2e tests, if set to 'master' framework will be monitoring master node only, if set to 'none' of 'false' monitoring will be turned off.")
flag.BoolVar(&TestContext.GatherLogsSizes,"gather-logs-sizes",false,"If set to true framework will be monitoring logs sizes on all machines running e2e tests.")
flag.BoolVar(&TestContext.GatherMetricsAfterTest,"gather-metrics-at-teardown",false,"If set to true framwork will gather metrics from all components after each test.")
flag.StringVar(&TestContext.OutputPrintType,"output-print-type","hr","Comma separated list: 'hr' for human readable summaries 'json' for JSON ones.")
flag.BoolVar(&TestContext.DumpLogsOnFailure,"dump-logs-on-failure",true,"If set to true test will dump data about the namespace in which test was running.")
}
// Register flags specific to the cluster e2e test suite.
funcRegisterClusterFlags(){
// TODO: Move to common flags once namespace deletion is fixed for node e2e.
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.VerifyServiceAccount,"e2e-verify-service-account",true,"If true tests will verify the service account before running.")
flag.StringVar(&TestContext.KubeConfig,clientcmd.RecommendedConfigPathFlag,os.Getenv(clientcmd.RecommendedConfigPathEnvVar),"Path to kubeconfig containing embedded authinfo.")
flag.StringVar(&TestContext.KubeContext,clientcmd.FlagContext,"","kubeconfig context to use/override. If unset, will use value from 'current-context'")
flag.StringVar(&TestContext.KubeAPIContentType,"kube-api-content-type","","ContentType used to communicate with apiserver")
...
...
@@ -126,12 +142,10 @@ func RegisterFlags() {
flag.DurationVar(&TestContext.SystemPodsStartupTimeout,"system-pods-startup-timeout",10*time.Minute,"Timeout for waiting for all system pods to be running before starting tests.")
flag.StringVar(&TestContext.UpgradeTarget,"upgrade-target","ci/latest","Version to upgrade to (e.g. 'release/stable', 'release/latest', 'ci/latest', '0.19.1', '0.19.1-669-gabac8c8') if doing an upgrade test.")
flag.StringVar(&TestContext.PrometheusPushGateway,"prom-push-gateway","","The URL to prometheus gateway, so that metrics can be pushed during e2es and scraped by prometheus. Typically something like 127.0.0.1:9091.")
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.StringVar(&TestContext.GatherKubeSystemResourceUsageData,"gather-resource-usage","false","If set to 'true' or 'all' framework will be monitoring resource usage of system all add-ons in (some) e2e tests, if set to 'master' framework will be monitoring master node only, if set to 'none' of 'false' monitoring will be turned off.")
flag.BoolVar(&TestContext.GatherLogsSizes,"gather-logs-sizes",false,"If set to true framework will be monitoring logs sizes on all machines running e2e tests.")
flag.BoolVar(&TestContext.GatherMetricsAfterTest,"gather-metrics-at-teardown",false,"If set to true framwork will gather metrics from all components after each test.")
flag.StringVar(&TestContext.OutputPrintType,"output-print-type","hr","Comma separated list: 'hr' for human readable summaries 'json' for JSON ones.")
flag.BoolVar(&TestContext.DumpLogsOnFailure,"dump-logs-on-failure",true,"If set to true test will dump data about the namespace in which test was running.")
}
// Register flags specific to the node e2e test suite.
funcRegisterNodeFlags(){
flag.StringVar(&TestContext.NodeName,"node-name","","Name of the node to run tests on (node e2e suite only).")