From aa2a8b513f48bfd0ce1cad8bfdba9e23213b5cd6 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Thu, 10 Oct 2019 16:59:53 -0400 Subject: [PATCH 1/3] Check ocm rollout between build tests * Make sure the OCM rollout completes between disruptive test runs. --- test/extended/builds/cluster_config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/extended/builds/cluster_config.go b/test/extended/builds/cluster_config.go index e2d6a61c35f5..67ad0ccc5924 100644 --- a/test/extended/builds/cluster_config.go +++ b/test/extended/builds/cluster_config.go @@ -238,6 +238,10 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via buildConfig.Spec.BuildOverrides = configv1.BuildOverrides{} _, err = oc.AdminConfigClient().ConfigV1().Builds().Update(buildConfig) o.Expect(err).NotTo(o.HaveOccurred()) + checkOCMProgressing(operatorv1.ConditionTrue) + checkOCMProgressing(operatorv1.ConditionFalse) + checkDSRolloutState(true) + checkDSRolloutState(false) }) g.It("Apply default proxy configuration to source build pod through env vars", func() { From dc63ff270ca0c90ab7578a287fdc72bdb9ca9154 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Fri, 11 Oct 2019 14:13:23 -0400 Subject: [PATCH 2/3] restructure tests to include/exclude ocm rollout --- test/extended/builds/cluster_config.go | 27 +++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/test/extended/builds/cluster_config.go b/test/extended/builds/cluster_config.go index 67ad0ccc5924..c3a828569b5e 100644 --- a/test/extended/builds/cluster_config.go +++ b/test/extended/builds/cluster_config.go @@ -160,7 +160,7 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via oc.Run("create").Args("-f", buildFixture2).Execute() }) - g.AfterEach(func() { + g.JustAfterEach(func() { if g.CurrentGinkgoTestDescription().Failed { exutil.DumpPodStates(oc) exutil.DumpPodLogsStartingWith("", oc) @@ -170,6 +170,7 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via g.Context("registries config context", func() { + // Altering registries config does not force an OCM rollout g.AfterEach(func() { oc.AsAdmin().Run("apply").Args("-f", defaultConfigFixture).Execute() }) @@ -228,8 +229,7 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via }) - g.Context("build config context", func() { - + g.Context("build config no ocm rollout", func() { g.AfterEach(func() { g.By("reset build cluster configuration") buildConfig, err := oc.AdminConfigClient().ConfigV1().Builds().Get("cluster", metav1.GetOptions{}) @@ -238,10 +238,6 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via buildConfig.Spec.BuildOverrides = configv1.BuildOverrides{} _, err = oc.AdminConfigClient().ConfigV1().Builds().Update(buildConfig) o.Expect(err).NotTo(o.HaveOccurred()) - checkOCMProgressing(operatorv1.ConditionTrue) - checkOCMProgressing(operatorv1.ConditionFalse) - checkDSRolloutState(true) - checkDSRolloutState(false) }) g.It("Apply default proxy configuration to source build pod through env vars", func() { @@ -332,6 +328,23 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via o.Expect(*build.Spec.Source.Git.HTTPSProxy).To(o.Equal(buildConfig.Spec.BuildDefaults.GitProxy.HTTPSProxy)) o.Expect(*build.Spec.Source.Git.NoProxy).To(o.Equal(buildConfig.Spec.BuildDefaults.GitProxy.NoProxy)) }) + }) + + g.Context("build config with ocm rollout", func() { + + g.AfterEach(func() { + g.By("reset build cluster configuration") + buildConfig, err := oc.AdminConfigClient().ConfigV1().Builds().Get("cluster", metav1.GetOptions{}) + o.Expect(err).NotTo(o.HaveOccurred()) + buildConfig.Spec.BuildDefaults = configv1.BuildDefaults{} + buildConfig.Spec.BuildOverrides = configv1.BuildOverrides{} + _, err = oc.AdminConfigClient().ConfigV1().Builds().Update(buildConfig) + o.Expect(err).NotTo(o.HaveOccurred()) + checkOCMProgressing(operatorv1.ConditionTrue) + checkOCMProgressing(operatorv1.ConditionFalse) + checkDSRolloutState(true) + checkDSRolloutState(false) + }) // this replaces coverage from the TestBuildDefaultEnvironment integration test g.It("Apply env configuration to build pod", func() { From e5dc28c9436199c8c12af48359a51cd5108dd2cd Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Wed, 16 Oct 2019 13:27:58 -0400 Subject: [PATCH 3/3] debug rollout --- test/extended/builds/cluster_config.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/extended/builds/cluster_config.go b/test/extended/builds/cluster_config.go index c3a828569b5e..08638e877c28 100644 --- a/test/extended/builds/cluster_config.go +++ b/test/extended/builds/cluster_config.go @@ -4,6 +4,13 @@ import ( "fmt" "time" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/util/wait" + e2e "k8s.io/kubernetes/test/e2e/framework" + g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" @@ -11,11 +18,6 @@ import ( configv1 "github.com/openshift/api/config/v1" operatorv1 "github.com/openshift/api/operator/v1" exutil "github.com/openshift/origin/test/extended/util" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/util/wait" ) // e2e tests of the build controller configuration. @@ -94,6 +96,12 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via ds.Status.UpdatedNumberScheduled == ds.Status.DesiredNumberScheduled { return true, nil } + e2e.Logf("ocm Desired: %d, Current: %d, Ready: %d, Available: %d, Updated: %d", + ds.Status.DesiredNumberScheduled, + ds.Status.CurrentNumberScheduled, + ds.Status.NumberReady, + ds.Status.NumberAvailable, + ds.Status.UpdatedNumberScheduled) return false, nil }) o.Expect(err).NotTo(o.HaveOccurred())