From 348a5f87521df61344b159417bcaa04956d1e2b7 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Tue, 8 Jun 2021 08:41:34 +0200 Subject: [PATCH 1/2] Modify experimental features e2e test setup Signed-off-by: Francesco Guardiani --- .github/workflows/kind-e2e.yaml | 6 ++++++ test/experimental/config/features.yaml | 24 ++++++++++++++++++++++++ test/experimental/main_test.go | 23 ----------------------- 3 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 test/experimental/config/features.yaml diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml index 8eea1965905..b5e4882ccd0 100644 --- a/.github/workflows/kind-e2e.yaml +++ b/.github/workflows/kind-e2e.yaml @@ -134,6 +134,12 @@ jobs: source ./vendor/knative.dev/hack/infra-library.sh wait_until_pods_running ${SYSTEM_NAMESPACE} + - name: Apply experimental features config + if: matrix.test-suite == './test/experimental' + run: | + kubectl apply -f ./test/experimental/config + wait_until_pods_running ${SYSTEM_NAMESPACE} + - name: Run e2e Tests run: | export GO111MODULE=on diff --git a/test/experimental/config/features.yaml b/test/experimental/config/features.yaml new file mode 100644 index 00000000000..36fc042ffd7 --- /dev/null +++ b/test/experimental/config/features.yaml @@ -0,0 +1,24 @@ +# Copyright 2021 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: config-features + namespace: knative-eventing + labels: + eventing.knative.dev/release: devel + knative.dev/config-propagation: original + knative.dev/config-category: eventing +data: diff --git a/test/experimental/main_test.go b/test/experimental/main_test.go index af45258aaf2..a90cab15cdd 100644 --- a/test/experimental/main_test.go +++ b/test/experimental/main_test.go @@ -23,13 +23,8 @@ import ( "os" "testing" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - experimental "knative.dev/eventing/pkg/apis/feature" - "knative.dev/pkg/system" - // Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters). _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - kubeclient "knative.dev/pkg/client/injection/kube/client" "knative.dev/pkg/injection" _ "knative.dev/pkg/system/testing" @@ -63,24 +58,6 @@ func TestMain(m *testing.M) { // is passing and saving the client injection enabled context for use later. global = environment.NewGlobalEnvironment(ctx) - // -- Setup the experimental features CM -- - experimentalFeaturesCm, err := kubeclient.Get(ctx). - CoreV1(). - ConfigMaps(system.Namespace()). - Get(ctx, experimental.FlagsConfigName, metav1.GetOptions{}) - if err != nil { - panic("Cannot retrieve the experimental features config map") - } - - // Enable the experimental features to test - _, err = kubeclient.Get(ctx). - CoreV1(). - ConfigMaps(system.Namespace()). - Update(ctx, experimentalFeaturesCm, metav1.UpdateOptions{}) - if err != nil { - panic("Cannot update the experimental features config map") - } - // Run the tests. os.Exit(m.Run()) } From 59b57b00cd2925dcdf89446b076a80e009fec1c1 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Tue, 8 Jun 2021 09:42:20 +0200 Subject: [PATCH 2/2] Moved the experimental features setup phase Signed-off-by: Francesco Guardiani --- .github/workflows/kind-e2e.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml index b5e4882ccd0..eb7a37c5c11 100644 --- a/.github/workflows/kind-e2e.yaml +++ b/.github/workflows/kind-e2e.yaml @@ -128,16 +128,15 @@ jobs: source ./test/e2e-common.sh test_setup - - name: Wait for things to be up - run: | - set -e - source ./vendor/knative.dev/hack/infra-library.sh - wait_until_pods_running ${SYSTEM_NAMESPACE} - - name: Apply experimental features config if: matrix.test-suite == './test/experimental' run: | kubectl apply -f ./test/experimental/config + + - name: Wait for things to be up + run: | + set -e + source ./vendor/knative.dev/hack/infra-library.sh wait_until_pods_running ${SYSTEM_NAMESPACE} - name: Run e2e Tests