From bbc054f546bbf22efdb4ed0b190600bd36512b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Suszy=C5=84ski?= Date: Mon, 24 Aug 2020 21:54:51 +0200 Subject: [PATCH] Docs for Eventing upgrade tests config overrides. --- test/upgrade/README.md | 18 ++++++++++++++++++ test/upgrade/prober/prober.go | 19 ++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/test/upgrade/README.md b/test/upgrade/README.md index 10c477e1534..6f1619183b2 100644 --- a/test/upgrade/README.md +++ b/test/upgrade/README.md @@ -83,3 +83,21 @@ Diagram below describe the setup: +--------+ +---------+ | (default) +----------+ ``` + +#### Probe test configuration + +Probe test behavior can be influenced from outside without modifying its source +code. That can be beneficial if one would like to run upgrade tests in different +context. One such example might be running Eventing upgrade tests in place that +have Serving and Eventing both installed. In such environment one can set +environment variable `E2E_UPGRADE_TESTS_SERVING_USE` to enable usage of ksvc +forwarder (which is disabled by default): + +``` +$ export E2E_UPGRADE_TESTS_SERVING_USE=true +``` + +Any option, apart from namespace, in +[`knative.dev/eventing/test/upgrade/prober.Config`](https://github.com/knative/eventing/blob/022e281/test/upgrade/prober/prober.go#L52-L63) +struct can be influenced, by using `E2E_UPGRADE_TESTS_XXXXX` environmental +variable prefix (using [kelseyhightower/envconfig](https://github.com/kelseyhightower/envconfig#usage) usage). diff --git a/test/upgrade/prober/prober.go b/test/upgrade/prober/prober.go index bf8179e1839..081448df3c6 100644 --- a/test/upgrade/prober/prober.go +++ b/test/upgrade/prober/prober.go @@ -64,19 +64,20 @@ type ServingConfig struct { } func NewConfig(namespace string) *Config { - servingConfig := ServingConfig{ - Use: false, - ScaleToZero: true, - } - err := envconfig.Process("e2e_upgrade_tests_serving", &servingConfig) - ensure.NoError(err) - return &Config{ - Namespace: namespace, + config := &Config{ + Namespace: "", Interval: Interval, FinishedSleep: 5 * time.Second, FailOnErrors: true, - Serving: servingConfig, + Serving: ServingConfig{ + Use: false, + ScaleToZero: true, + }, } + err := envconfig.Process("e2e_upgrade_tests", config) + ensure.NoError(err) + config.Namespace = namespace + return config } // RunEventProber starts a single Prober of the given domain.