Skip to content

Commit

Permalink
Merge pull request #25966 from openshift-cherrypick-robot/cherry-pick…
Browse files Browse the repository at this point in the history
…-25949-to-release-4.7

[release-4.7] Bug 1939477: Update tests to use Ruby 2.7
  • Loading branch information
openshift-merge-robot committed Mar 18, 2021
2 parents 3452c6a + 3253797 commit 98285f8
Show file tree
Hide file tree
Showing 58 changed files with 466 additions and 557 deletions.
34 changes: 7 additions & 27 deletions examples/image-streams/image-streams-centos7.json
Expand Up @@ -895,7 +895,7 @@
},
"from": {
"kind": "ImageStreamTag",
"name": "2.6"
"name": "2.7"
},
"name": "latest",
"referencePolicy": {
Expand All @@ -904,40 +904,20 @@
},
{
"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.",
"description": "Build and run Ruby 2.7 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.6/README.md.",
"iconClass": "icon-ruby",
"openshift.io/display-name": "Ruby 2.5",
"openshift.io/display-name": "Ruby 2.7",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"sampleRepo": "https://github.com/sclorg/ruby-ex.git",
"supports": "ruby:2.5,ruby",
"supports": "ruby:2.7,ruby",
"tags": "builder,ruby",
"version": "2.5"
},
"from": {
"kind": "DockerImage",
"name": "registry.centos.org/centos/ruby-25-centos7:latest"
},
"name": "2.5",
"referencePolicy": {
"type": "Local"
}
},
{
"annotations": {
"description": "Build and run Ruby 2.6 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.6/README.md.",
"iconClass": "icon-ruby",
"openshift.io/display-name": "Ruby 2.6",
"openshift.io/provider-display-name": "Red Hat, Inc.",
"sampleRepo": "https://github.com/sclorg/ruby-ex.git",
"supports": "ruby:2.6,ruby",
"tags": "builder,ruby",
"version": "2.6"
"version": "2.7"
},
"from": {
"kind": "DockerImage",
"name": "registry.centos.org/centos/ruby-26-centos7:latest"
"name": "registry.centos.org/centos/ruby-27-centos7:latest"
},
"name": "2.6",
"name": "2.7",
"referencePolicy": {
"type": "Local"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstarts/rails-postgresql-persistent.json
Expand Up @@ -120,7 +120,7 @@
],
"from": {
"kind": "ImageStreamTag",
"name": "ruby:2.5",
"name": "ruby:2.7",
"namespace": "${NAMESPACE}"
}
},
Expand Down Expand Up @@ -609,4 +609,4 @@
"value": ""
}
]
}
}
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-25-centos7" created
imagestream "ruby-27-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,14 +83,14 @@
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "ruby-25-centos7"
"name": "ruby-27-centos7"
},
"spec": {
"tags": [
{
"from": {
"kind": "DockerImage",
"name": "docker.io/centos/ruby-25-centos7:latest"
"name": "docker.io/centos/ruby-27-centos7:latest"
},
"name": "latest"
}
Expand Down Expand Up @@ -143,7 +143,7 @@
"dockerStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-25-centos7:latest"
"name": "ruby-27-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-25-centos7"
"name": "ruby-27-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-25-centos7"
"dockerImageRepository": "centos/ruby-27-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -134,7 +134,7 @@
"sourceStrategy": {
"from": {
"kind": "DockerImage",
"name": "centos/ruby-25-centos7:latest"
"name": "centos/ruby-27-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-25-centos7"
"name": "ruby-27-centos7"
},
"spec": {
"dockerImageRepository": "centos/ruby-25-centos7"
"dockerImageRepository": "centos/ruby-27-centos7"
},
"status": {
"dockerImageRepository": ""
Expand Down Expand Up @@ -138,7 +138,7 @@
"sourceStrategy": {
"from": {
"kind": "ImageStreamTag",
"name": "ruby-25-centos7:latest"
"name": "ruby-27-centos7:latest"
},
"env": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/extended/builds/cluster_config.go
Expand Up @@ -194,7 +194,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Serial][Slow][Disruptive] alter
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-25-centos7) is only available on docker.io
// Image used by sample-build (centos/ruby-27-centos7) is only available on docker.io
br, err := exutil.StartBuildAndWait(oc, "sample-build")
o.Expect(err).NotTo(o.HaveOccurred())
br.AssertSuccess()
Expand Down
4 changes: 2 additions & 2 deletions test/extended/builds/dockerfile.go
Expand Up @@ -26,7 +26,7 @@ FROM %s
USER 1001
`, image.ShellImage())
testDockerfile2 = `
FROM image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.5
FROM image-registry.openshift-image-registry.svc:5000/openshift/ruby:2.7
USER 1001
`
testDockerfile3 = `
Expand Down Expand Up @@ -110,7 +110,7 @@ USER 1001
o.Expect(image.Image.DockerImageMetadata.Object.(*docker10.DockerImage).Config.User).To(o.Equal("1001"))

g.By("checking for the imported tag")
_, err = oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(context.Background(), "ruby:2.5", metav1.GetOptions{})
_, err = oc.ImageClient().ImageV1().ImageStreamTags(oc.Namespace()).Get(context.Background(), "ruby:2.7", metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
})

Expand Down
4 changes: 2 additions & 2 deletions test/extended/builds/image_source.go
Expand Up @@ -97,7 +97,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] build can have container
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-ruby25/root/usr/bin"))
o.Expect(out).To(o.ContainSubstring("bin -> ../../rh/6/root/usr/bin"))
})
})
g.Describe("buildconfig with input source image and docker strategy", func() {
Expand All @@ -124,7 +124,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds][Slow] build can have container
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-ruby25/root/usr/bin"))
o.Expect(out).To(o.ContainSubstring("bin -> ../../rh/6/root/usr/bin"))
})
})
g.Describe("creating a build with an input source image and s2i strategy", func() {
Expand Down
4 changes: 2 additions & 2 deletions test/extended/cli/admin.go
Expand Up @@ -445,9 +445,9 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring("origin-ruby-sample:latest"))

out, err = ocns.Run("adm", "build-chain").Args("ruby-25-centos7", "-o", "dot").Output()
out, err = ocns.Run("adm", "build-chain").Args("ruby-27-centos7", "-o", "dot").Output()
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(out).To(o.ContainSubstring(`digraph "ruby-25-centos7:latest"`))
o.Expect(out).To(o.ContainSubstring(`digraph "ruby-27-centos7:latest"`))

ocns.Run("delete").Args("all", "-l", "build=sti").Execute()
})
Expand Down
15 changes: 4 additions & 11 deletions test/extended/image_ecosystem/s2i_images.go
Expand Up @@ -29,26 +29,19 @@ type tc struct {
var s2iImages = map[string][]tc{
"ruby": {
{
Version: "26",
Version: "27",
Cmd: "ruby --version",
Expected: "ruby 2.6",
Expected: "ruby 2.7",
Repository: "rhscl",
NonAMD: true,
},
{
Version: "25",
Version: "26",
Cmd: "ruby --version",
Expected: "ruby 2.5",
Expected: "ruby 2.6",
Repository: "rhscl",
NonAMD: true,
},
{
Version: "24",
Cmd: "ruby --version",
Expected: "ruby 2.4",
Repository: "rhscl",
NonAMD: false,
},
},
"python": {
{
Expand Down

0 comments on commit 98285f8

Please sign in to comment.