Skip to content

Commit

Permalink
Merge pull request openshift#23947 from adambkaplan/ensure-rollout
Browse files Browse the repository at this point in the history
Check ocm rollout between build tests
  • Loading branch information
openshift-merge-robot authored Nov 9, 2019
2 parents 608e80b + e5dc28c commit 496eb7c
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions test/extended/builds/cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ 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"

buildv1 "github.com/openshift/api/build/v1"
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.
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -160,7 +168,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)
Expand All @@ -170,6 +178,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()
})
Expand Down Expand Up @@ -228,8 +237,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{})
Expand Down Expand Up @@ -328,6 +336,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() {
Expand Down

0 comments on commit 496eb7c

Please sign in to comment.