Skip to content

Commit

Permalink
allow for bypass of not proceeding deployment check jenkins extended …
Browse files Browse the repository at this point in the history
…tests given update center sync delay is now on startup
  • Loading branch information
gabemontero committed Mar 16, 2018
1 parent 308bb2e commit ca17cf5
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion test/extended/builds/contextdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = g.Describe("[Feature:Builds][Slow] builds with a context directory", fun
// oc.KubeFramework().WaitForAnEndpoint currently will wait forever; for now, prefacing with our WaitForADeploymentToComplete,
// which does have a timeout, since in most cases a failure in the service coming up stems from a failed deployment
g.By("waiting for a deployment")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for endpoint")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/gitauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var _ = g.Describe("[Feature:Builds][Slow] can use private repositories as build
o.Expect(err).NotTo(o.HaveOccurred())

g.By("expecting the deployment of the gitserver to be in the Complete phase")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), gitServerDeploymentConfigName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), gitServerDeploymentConfigName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

sourceSecretName := secretFunc()
Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/new_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var _ = g.Describe("[Feature:Builds][Conformance] oc new-app", func() {
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for the deployment to complete")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), a58, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), a58, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())
})

Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for jenkins deployment")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "jenkins", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "jenkins", 1, false, oc)
o.Expect(err).NotTo(o.HaveOccurred())

j = jenkins.NewRef(oc)
Expand Down
2 changes: 1 addition & 1 deletion test/extended/cluster/cl.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ var _ = g.Describe("[Feature:Performance][Serial][Slow] Load cluster", func() {
// deploymentName is buildName without the -1 suffix
deploymentName := buildName[:len(buildName)-2]
e2e.Logf("Waiting for deployment: %q", deploymentName)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), ns, deploymentName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), ns, deploymentName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())
e2e.Logf("Deployment %q completed", deploymentName)
}
Expand Down
12 changes: 6 additions & 6 deletions test/extended/image_ecosystem/jenkins_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ var _ = g.Describe("[image_ecosystem][jenkins][Slow] openshift pipeline plugin",
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for jenkins deployment")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "jenkins", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "jenkins", 1, false, oc)
o.Expect(err).NotTo(o.HaveOccurred())

j = jenkins.NewRef(oc)
Expand Down Expand Up @@ -267,9 +267,9 @@ var _ = g.Describe("[image_ecosystem][jenkins][Slow] openshift pipeline plugin",
// we leverage some of the openshift utilities for waiting for the deployment before we poll
// jenkins for the successful job completion
g.By("waiting for frontend, frontend-prod deployments as signs that the build has finished")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend-prod", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend-prod", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("get build console logs and see if succeeded")
Expand Down Expand Up @@ -319,9 +319,9 @@ var _ = g.Describe("[image_ecosystem][jenkins][Slow] openshift pipeline plugin",
// we leverage some of the openshift utilities for waiting for the deployment before we poll
// jenkins for the successful job completion
g.By("waiting for frontend, frontend-prod deployments as signs that the build has finished")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend-prod", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend-prod", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("get build console logs and see if succeeded")
Expand Down Expand Up @@ -387,7 +387,7 @@ var _ = g.Describe("[image_ecosystem][jenkins][Slow] openshift pipeline plugin",
// we leverage some of the openshift utilities for waiting for the deployment before we poll
// jenkins for the successful job completion
g.By("waiting for frontend deployments as signs that the build has finished")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "frontend", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("get build console logs and see if succeeded")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/image_ecosystem/mariadb_ephemeral.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ = g.Describe("[image_ecosystem][mariadb][Slow] openshift mariadb image", f

// oc.KubeFramework().WaitForAnEndpoint currently will wait forever; for now, prefacing with our WaitForADeploymentToComplete,
// which does have a timeout, since in most cases a failure in the service coming up stems from a failed deployment
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "mariadb", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "mariadb", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("expecting the mariadb service get endpoints")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/image_ecosystem/mongodb_ephemeral.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var _ = g.Describe("[image_ecosystem][mongodb] openshift mongodb image", func()
o.Expect(oc.Run("new-app").Args("-f", templatePath).Execute()).Should(o.Succeed())

g.By("waiting for the deployment to complete")
err := exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "mongodb", 1, oc)
err := exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "mongodb", 1, true, oc)
o.Expect(err).ShouldNot(o.HaveOccurred())

g.By("expecting the mongodb pod is running")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/image_ecosystem/mysql_ephemeral.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = g.Describe("[image_ecosystem][mysql][Slow] openshift mysql image", func(

// oc.KubeFramework().WaitForAnEndpoint currently will wait forever; for now, prefacing with our WaitForADeploymentToComplete,
// which does have a timeout, since in most cases a failure in the service coming up stems from a failed deployment
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "mysql", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "mysql", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("expecting the mysql service get endpoints")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/image_ecosystem/mysql_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func replicationTestFactory(oc *exutil.CLI, tc testCase) func() {
// oc.KubeFramework().WaitForAnEndpoint currently will wait forever; for now, prefacing with our WaitForADeploymentToComplete,
// which does have a timeout, since in most cases a failure in the service coming up stems from a failed deployment
g.By("waiting for the deployment to complete")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), helperName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), helperName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for an endpoint")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/image_ecosystem/postgresql_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func PostgreSQLReplicationTestFactory(oc *exutil.CLI, image string) func() {

// oc.KubeFramework().WaitForAnEndpoint currently will wait forever; for now, prefacing with our WaitForADeploymentToComplete,
// which does have a timeout, since in most cases a failure in the service coming up stems from a failed deployment
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), postgreSQLHelperName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), postgreSQLHelperName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

err = e2e.WaitForEndpoint(oc.KubeFramework().ClientSet, oc.Namespace(), postgreSQLHelperName)
Expand Down
4 changes: 2 additions & 2 deletions test/extended/image_ecosystem/s2i_perl.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var _ = g.Describe("[image_ecosystem][perl][Slow] hot deploy for openshift perl
}
o.Expect(err).NotTo(o.HaveOccurred())

err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for endpoint")
Expand All @@ -89,7 +89,7 @@ var _ = g.Describe("[image_ecosystem][perl][Slow] hot deploy for openshift perl
g.By("turning on hot-deploy")
err = oc.Run("env").Args("dc", dcName, "PERL_APACHE2_RELOAD=true").Execute()
o.Expect(err).NotTo(o.HaveOccurred())
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 2, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 2, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for a new endpoint")
Expand Down
2 changes: 1 addition & 1 deletion test/extended/image_ecosystem/s2i_php.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = g.Describe("[image_ecosystem][php][Slow] hot deploy for openshift php im
}
o.Expect(err).NotTo(o.HaveOccurred())

err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "cakephp-mysql-example", 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), "cakephp-mysql-example", 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for endpoint")
Expand Down
4 changes: 2 additions & 2 deletions test/extended/image_ecosystem/s2i_python.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = g.Describe("[image_ecosystem][python][Slow] hot deploy for openshift pyt
}
o.Expect(err).NotTo(o.HaveOccurred())

err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for endpoint")
Expand Down Expand Up @@ -102,7 +102,7 @@ var _ = g.Describe("[image_ecosystem][python][Slow] hot deploy for openshift pyt
g.By("turning on hot-deploy")
err = oc.Run("env").Args("dc", dcName, "APP_CONFIG=conf/reload.py").Execute()
o.Expect(err).NotTo(o.HaveOccurred())
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 2, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 2, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for a new endpoint")
Expand Down
4 changes: 2 additions & 2 deletions test/extended/image_ecosystem/s2i_ruby.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var _ = g.Describe("[image_ecosystem][ruby][Slow] hot deploy for openshift ruby
}
o.Expect(err).NotTo(o.HaveOccurred())

err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for endpoint")
Expand Down Expand Up @@ -93,7 +93,7 @@ var _ = g.Describe("[image_ecosystem][ruby][Slow] hot deploy for openshift ruby
g.By("turning on hot-deploy")
err = oc.Run("env").Args("dc", dcName, "RAILS_ENV=development").Execute()
o.Expect(err).NotTo(o.HaveOccurred())
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 2, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), dcName, 2, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("waiting for a new endpoint")
Expand Down
4 changes: 2 additions & 2 deletions test/extended/image_ecosystem/sample_repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ func NewSampleRepoTest(c SampleRepoConfig) func() {
o.Expect(err).NotTo(o.HaveOccurred())

g.By("expecting the app deployment to be complete")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), c.deploymentConfigName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), c.deploymentConfigName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

if len(c.dbDeploymentConfigName) > 0 {
g.By("expecting the db deployment to be complete")
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), c.dbDeploymentConfigName, 1, oc)
err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().Apps(), oc.Namespace(), c.dbDeploymentConfigName, 1, true, oc)
o.Expect(err).NotTo(o.HaveOccurred())

g.By("expecting the db service is available")
Expand Down
8 changes: 5 additions & 3 deletions test/extended/util/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ var CheckImageStreamTagNotFoundFn = func(i *imageapi.ImageStream) bool {

// WaitForDeploymentConfig waits for a DeploymentConfig to complete transition
// to a given version and report minimum availability.
func WaitForDeploymentConfig(kc kclientset.Interface, dcClient appstypeclientset.DeploymentConfigsGetter, namespace, name string, version int64, cli *CLI) error {
func WaitForDeploymentConfig(kc kclientset.Interface, dcClient appstypeclientset.DeploymentConfigsGetter, namespace, name string, version int64, enforceNotProgressing bool, cli *CLI) error {
e2e.Logf("waiting for deploymentconfig %s/%s to be available with version %d\n", namespace, name, version)
var dc *appsapi.DeploymentConfig

Expand Down Expand Up @@ -841,8 +841,10 @@ func WaitForDeploymentConfig(kc kclientset.Interface, dcClient appstypeclientset
}
}

if progressing != nil && progressing.Status == kapi.ConditionFalse {
return false, fmt.Errorf("not progressing")
if enforceNotProgressing {
if progressing != nil && progressing.Status == kapi.ConditionFalse {
return false, fmt.Errorf("not progressing")
}
}

if progressing != nil &&
Expand Down

0 comments on commit ca17cf5

Please sign in to comment.