Skip to content

Commit

Permalink
Move extended build tests from ruby:2.x to ruby:2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
adambkaplan committed Jul 23, 2019
1 parent 75aae0d commit 847153a
Show file tree
Hide file tree
Showing 44 changed files with 139 additions and 293 deletions.
80 changes: 0 additions & 80 deletions examples/image-streams/image-streams-centos7.json
Expand Up @@ -1265,86 +1265,6 @@
"type": "Local"
}
},
{
"annotations": {
"description": "Build and run Ruby 2.0 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.0/README.md.",
"iconClass": "icon-ruby",
"openshift.io/display-name": "Ruby 2.0",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"sampleRepo": "https://github.com/sclorg/ruby-ex.git",
"supports": "ruby:2.0,ruby",
"tags": "hidden,builder,ruby",
"version": "2.0"
},
"from": {
"kind": "DockerImage",
"name": "docker.io/openshift/ruby-20-centos7:latest"
},
"name": "2.0",
"referencePolicy": {
"type": "Local"
}
},
{
"annotations": {
"description": "Build and run Ruby 2.2 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/tree/master/2.2/README.md.",
"iconClass": "icon-ruby",
"openshift.io/display-name": "Ruby 2.2",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"sampleRepo": "https://github.com/sclorg/ruby-ex.git",
"supports": "ruby:2.2,ruby",
"tags": "hidden,builder,ruby",
"version": "2.2"
},
"from": {
"kind": "DockerImage",
"name": "docker.io/centos/ruby-22-centos7:latest"
},
"name": "2.2",
"referencePolicy": {
"type": "Local"
}
},
{
"annotations": {
"description": "Build and run Ruby 2.3 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/blob/master/2.3/README.md.",
"iconClass": "icon-ruby",
"openshift.io/display-name": "Ruby 2.3",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"sampleRepo": "https://github.com/sclorg/ruby-ex.git",
"supports": "ruby:2.3,ruby",
"tags": "builder,ruby",
"version": "2.3"
},
"from": {
"kind": "DockerImage",
"name": "docker.io/centos/ruby-23-centos7:latest"
},
"name": "2.3",
"referencePolicy": {
"type": "Local"
}
},
{
"annotations": {
"description": "Build and run Ruby 2.4 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/blob/master/2.4/README.md.",
"iconClass": "icon-ruby",
"openshift.io/display-name": "Ruby 2.4",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"sampleRepo": "https://github.com/sclorg/ruby-ex.git",
"supports": "ruby:2.4,ruby",
"tags": "builder,ruby",
"version": "2.4"
},
"from": {
"kind": "DockerImage",
"name": "docker.io/centos/ruby-24-centos7:latest"
},
"name": "2.4",
"referencePolicy": {
"type": "Local"
}
},
{
"annotations": {
"description": "Build and run Ruby 2.5 applications on CentOS 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/blob/master/2.5/README.md.",
Expand Down
2 changes: 1 addition & 1 deletion examples/sample-app/README.md
Expand Up @@ -171,7 +171,7 @@ This section covers how to perform all the steps of building, deploying, and upd
service "frontend" created
route "route-edge" created
imagestream "origin-ruby-sample" created
imagestream "ruby-22-centos7" created
imagestream "ruby-25-centos7" created
buildconfig "ruby-sample-build" created
deploymentconfig "frontend" created
service "database" created
Expand Down
6 changes: 3 additions & 3 deletions examples/sample-app/application-template-dockerbuild.json
Expand Up @@ -83,10 +83,10 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "ruby-22-centos7"
"name": "ruby-25-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-22-centos7"
"dockerImageRepository": "centos/ruby-25-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -138,7 +138,7 @@
"dockerStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-22-centos7:latest"
"name": "ruby-25-centos7:latest"
},
"env": [
{
Expand Down
6 changes: 3 additions & 3 deletions examples/sample-app/application-template-pullspecbuild.json
Expand Up @@ -83,10 +83,10 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "ruby-22-centos7"
"name": "ruby-25-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-22-centos7"
"dockerImageRepository": "centos/ruby-25-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -134,7 +134,7 @@
"sourceStrategy": {
"from": {
"kind": "DockerImage",
"name": "centos/ruby-22-centos7:latest"
"name": "centos/ruby-25-centos7:latest"
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions examples/sample-app/application-template-stibuild.json
Expand Up @@ -83,10 +83,10 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "ruby-22-centos7"
"name": "ruby-25-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-22-centos7"
"dockerImageRepository": "centos/ruby-25-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -138,7 +138,7 @@
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-22-centos7:latest"
"name": "ruby-25-centos7:latest"
},
"env": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/cluster_config.go
Expand Up @@ -59,7 +59,7 @@ var _ = g.Describe("[Feature:Builds][Serial][Slow][Disruptive] alter builds via
g.By("waiting 1s for build controller configuration to propagate")
time.Sleep(1 * time.Second)
g.By("starting build sample-build and waiting for success")
// Image used by sample-build (centos/ruby-22-centos7) is only available on docker.io
// Image used by sample-build (centos/ruby-25-centos7) is only available on docker.io
br, err := exutil.StartBuildAndWait(oc, "sample-build")
o.Expect(err).NotTo(o.HaveOccurred())
br.AssertSuccess()
Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/forcepull.go
Expand Up @@ -57,7 +57,7 @@ func checkPodFlag(bldPrefix string, oc *exutil.CLI) {
/*
If docker.io is not responding to requests in a timely manner, this test suite will be adversely affected.
If you suspect such a situation, attempt pulling some openshift images other than ruby-22-centos7
If you suspect such a situation, attempt pulling some openshift images other than ruby-25-centos7
while this test is running and compare results. Restarting your docker daemon, assuming you can ping docker.io quickly, could
be a quick fix.
*/
Expand Down
4 changes: 2 additions & 2 deletions test/extended/builds/image_source.go
Expand Up @@ -72,7 +72,7 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have container image source
g.By("expecting the pod to contain the file from the input image")
out, err := oc.Run("exec").Args(pod.Name, "-c", pod.Spec.Containers[0].Name, "--", "ls", "-R", "-l", "injected/opt/app-root").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("bin -> ../../rh/rh-ruby22/root/usr/bin"))
o.Expect(out).To(o.ContainSubstring("bin -> ../../rh/rh-ruby25/root/usr/bin"))
})
})
g.Describe("buildconfig with input source image and docker strategy", func() {
Expand All @@ -99,7 +99,7 @@ var _ = g.Describe("[Feature:Builds][Slow] build can have container image source
g.By("expecting the pod to contain the file from the input image")
out, err := oc.Run("exec").Args(pod.Name, "-c", pod.Spec.Containers[0].Name, "--", "ls", "-R", "-l", "injected/opt/app-root").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("bin -> ../../rh/rh-ruby22/root/usr/bin"))
o.Expect(out).To(o.ContainSubstring("bin -> ../../rh/rh-ruby25/root/usr/bin"))
})
})
g.Describe("creating a build with an input source image and s2i strategy", func() {
Expand Down
1 change: 1 addition & 0 deletions test/extended/builds/pipeline_origin_bld.go
Expand Up @@ -251,6 +251,7 @@ var _ = g.Describe("[Feature:Builds][Feature:Jenkins][Slow] openshift pipeline b
o.Expect(err).NotTo(o.HaveOccurred())
err = oc.Run("delete").Args("is", "ruby").Execute()
o.Expect(err).NotTo(o.HaveOccurred())
// TODO: Update to ruby 2.5
err = oc.Run("delete").Args("is", "ruby-22-centos7").Execute()
o.Expect(err).NotTo(o.HaveOccurred())

Expand Down
17 changes: 10 additions & 7 deletions test/extended/builds/start.go
Expand Up @@ -193,7 +193,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {

o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("Uploading file"))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("as binary input for the build ..."))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))
})

g.It("should accept --from-dir as input", func() {
Expand All @@ -206,7 +206,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
g.By(fmt.Sprintf("verifying the build %q status", br.BuildPath))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("Uploading directory"))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("as binary input for the build ..."))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))
})

g.It("should accept --from-repo as input", func() {
Expand All @@ -221,7 +221,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("Uploading"))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring(`at commit "HEAD"`))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("as binary input for the build ..."))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))
})

g.It("should accept --from-repo with --commit as input", func() {
Expand All @@ -242,11 +242,12 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring(fmt.Sprintf("at commit \"%s\"", commit)))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("as binary input for the build ..."))
o.Expect(buildLog).To(o.ContainSubstring(fmt.Sprintf("\"commit\":\"%s\"", commit)))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))
})

// run one valid binary build so we can do --from-build later
g.It("should reject binary build requests without a --from-xxxx value", func() {
g.Skip("TODO: refactor such that we don't rely on external package managers (i.e. Rubygems)")
g.By("starting a valid build with a directory")
br, err := exutil.StartBuildAndWait(oc, "sample-build-binary", "--follow", fmt.Sprintf("--from-dir=%s", exampleBuild))
br.AssertSuccess()
Expand All @@ -255,7 +256,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("Uploading directory"))
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring("as binary input for the build ..."))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))

g.By("starting a build without a --from-xxxx value")
br, err = exutil.StartBuildAndWait(oc, "sample-build-binary")
Expand All @@ -269,17 +270,19 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
})

g.It("shoud accept --from-file with https URL as an input", func() {
g.Skip("TODO: update https://github.com/openshift/ruby-hello-world to be compatible with ruby 2.5")
g.By("starting a valid build with input file served by https")
br, err := exutil.StartBuildAndWait(oc, "sample-build", fmt.Sprintf("--from-file=%s", exampleGemfileURL))
br.AssertSuccess()
verifyNodeSelector(oc, br.BuildName)
buildLog, err := br.Logs()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring(fmt.Sprintf("Uploading file from %q as binary input for the build", exampleGemfileURL)))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))
})

g.It("shoud accept --from-archive with https URL as an input", func() {
g.Skip("TODO: update https://github.com/openshift/ruby-hello-world to be compatible with ruby 2.5")
g.By("starting a valid build with input archive served by https")
// can't use sample-build-binary because we need contextDir due to github archives containing the top-level directory
br, err := exutil.StartBuildAndWait(oc, "sample-build-github-archive", fmt.Sprintf("--from-archive=%s", exampleArchiveURL))
Expand All @@ -288,7 +291,7 @@ var _ = g.Describe("[Feature:Builds][Slow] starting a build using CLI", func() {
buildLog, err := br.Logs()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(br.StartBuildStdErr).To(o.ContainSubstring(fmt.Sprintf("Uploading archive from %q as binary input for the build", exampleArchiveURL)))
o.Expect(buildLog).To(o.ContainSubstring("Your bundle is complete"))
o.Expect(buildLog).To(o.ContainSubstring("Build complete"))
})
})

Expand Down

0 comments on commit 847153a

Please sign in to comment.