Skip to content

Commit

Permalink
Use correct branch
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek committed Sep 13, 2024
1 parent adf4e76 commit 72e3aa0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/rails-postgresql-persistent.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.0-ubi9 by default).",
"required": true,
"value": "3.0-ubi9"
"value": "3.3-ubi9"
},
{
"name": "POSTGRESQL_VERSION",
Expand Down
2 changes: 1 addition & 1 deletion examples/rails-postgresql.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.0-ubi9 by default).",
"required": true,
"value": "3.0-ubi9"
"value": "3.3-ubi9"
},
{
"name": "MEMORY_LIMIT",
Expand Down
19 changes: 10 additions & 9 deletions test/test_helm_ruby_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ def teardown_method(self):
self.hc_api.delete_project()

@pytest.mark.parametrize(
"version,registry",
"version,registry,expected",
[
("3.3-ubi9", "registry.redhat.io/ubi9/ruby-33:latest"),
("3.3-ubi8", "registry.redhat.io/ubi8/ruby-33:latest"),
("3.1-ubi9", "registry.redhat.io/ubi9/ruby-31:latest"),
("3.1-ubi8", "registry.redhat.io/ubi8/ruby-31:latest"),
("3.0-ubi9", "registry.redhat.io/ubi9/ruby-30:latest"),
("2.5-ubi8", "registry.redhat.io/ubi8/ruby-25:latest"),
("3.3-ubi9", "registry.redhat.io/ubi9/ruby-33:latest", True),
("3.3-ubi8", "registry.redhat.io/ubi8/ruby-33:latest", True),
("3.1-ubi9", "registry.redhat.io/ubi9/ruby-31:latest", True),
("3.1-ubi8", "registry.redhat.io/ubi8/ruby-31:latest", True),
("3.0-ubi9", "registry.redhat.io/ubi9/ruby-30:latest", True),
("3.0-ubi8", "registry.redhat.io/ubi8/ruby-30:latest", False),
("2.5-ubi8", "registry.redhat.io/ubi8/ruby-25:latest", True),
],
)
def test_package_imagestream(self, version, registry):
def test_package_imagestream(self, version, registry, expected):
assert self.hc_api.helm_package()
assert self.hc_api.helm_installation()
assert self.hc_api.check_imagestreams(version=version, registry=registry)
assert self.hc_api.check_imagestreams(version=version, registry=registry) == expected
12 changes: 10 additions & 2 deletions test/test_helm_ruby_rails_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def teardown_method(self):
def test_curl_connection(self):
if self.hc_api.oc_api.shared_cluster:
pytest.skip("Do NOT test on shared cluster")
rails_ex_branch = "master"
if VERSION == "3.3":
rails_ex_branch = VERSION
self.hc_api.package_name = "ruby-imagestreams"
assert self.hc_api.helm_package()
assert self.hc_api.helm_installation()
Expand All @@ -53,7 +56,8 @@ def test_curl_connection(self):
assert self.hc_api.helm_installation(
values={
"ruby_version": f"{VERSION}{TAG}",
"namespace": self.hc_api.namespace
"namespace": self.hc_api.namespace,
"source_repository_ref": rails_ex_branch,
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="rails-example")
Expand All @@ -63,6 +67,9 @@ def test_curl_connection(self):
)

def test_by_helm_test(self):
rails_ex_branch = "master"
if VERSION == "3.3":
rails_ex_branch = VERSION
self.hc_api.package_name = "ruby-imagestreams"
assert self.hc_api.helm_package()
assert self.hc_api.helm_installation()
Expand All @@ -71,7 +78,8 @@ def test_by_helm_test(self):
assert self.hc_api.helm_installation(
values={
"ruby_version": f"{VERSION}{TAG}",
"namespace": self.hc_api.namespace
"namespace": self.hc_api.namespace,
"source_repository_ref": rails_ex_branch,
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="rails-example")
Expand Down

0 comments on commit 72e3aa0

Please sign in to comment.