Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/openshift-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [ "2.5-ubi8", "3.0-ubi9", "3.3-ubi8", "3.3-ubi9" ]
version: [ "2.5-ubi8", "3.0-ubi9", "3.3-ubi8", "3.3-ubi9", "3.3-ubi10" ]

if: |
github.event.issue.pull_request
Expand Down
4 changes: 2 additions & 2 deletions openshift/templates/rails-postgresql-persistent.json
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@
{
"name": "RUBY_VERSION",
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.3-ubi8 by default).",
"description": "Version of Ruby image to be used (3.3-ubi9 by default).",
"required": true,
"value": "3.3-ubi8"
"value": "3.3-ubi9"
},
{
"name": "POSTGRESQL_VERSION",
Expand Down
4 changes: 2 additions & 2 deletions openshift/templates/rails-postgresql.json
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@
{
"name": "RUBY_VERSION",
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.3-ubi8 by default).",
"description": "Version of Ruby image to be used (3.3-ubi9 by default).",
"required": true,
"value": "3.3-ubi8"
"value": "3.3-ubi9"
},
{
"name": "POSTGRESQL_VERSION",
Expand Down
4 changes: 2 additions & 2 deletions openshift/templates/rails.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@
{
"name": "RUBY_VERSION",
"displayName": "Ruby Version",
"description": "Version of Ruby image to be used (3.3-ubi8 by default).",
"description": "Version of Ruby image to be used (3.3-ubi9 by default).",
"required": true,
"value": "3.3-ubi8"
"value": "3.3-ubi9"
},
{
"name": "MEMORY_LIMIT",
Expand Down
24 changes: 3 additions & 21 deletions tests/test_rails.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

VERSION=os.getenv("SINGLE_VERSION")
if not VERSION:
VERSION="3.1-ubi8"
VERSION="3.3-ubi9"

class TestRailsAppExTemplate:

def setup_method(self):
self.oc_api = OpenShiftAPI(pod_name_prefix="rails-example")
self.oc_api = OpenShiftAPI(pod_name_prefix="rails-example", shared_cluster=True)
json_raw_file = self.oc_api.get_raw_url_for_json(
container="s2i-ruby-container", dir="imagestreams", filename="ruby-rhel.json"
)
Expand All @@ -36,25 +36,7 @@ def test_template_inside_cluster(self):
template=template_json, name_in_template="rails-example", expected_output=expected_output,
openshift_args=[f"SOURCE_REPOSITORY_REF={branch_to_test}", f"RUBY_VERSION={VERSION}", "NAME=rails-example"]
)
assert self.oc_api.template_deployed(name_in_template="rails-example")
assert self.oc_api.is_template_deployed(name_in_template="rails-example", timeout=600)
assert self.oc_api.check_response_inside_cluster(
name_in_template="rails-example", expected_output=expected_output
)

def test_template_by_request(self):
if VERSION.startswith("3.3"):
branch_to_test = "3.3"
else:
branch_to_test = "master"
expected_output = "Welcome to your Rails application"
template_json = self.oc_api.get_raw_url_for_json(
container="rails-ex", branch=branch_to_test, dir="openshift/templates", filename="rails.json"
)
assert self.oc_api.deploy_template(
template=template_json, name_in_template="rails-example", expected_output=expected_output,
openshift_args=[f"SOURCE_REPOSITORY_REF={branch_to_test}", f"RUBY_VERSION={VERSION}", "NAME=rails-example"]
)
assert self.oc_api.template_deployed(name_in_template="rails-example")
assert self.oc_api.check_response_outside_cluster(
name_in_template="rails-example", expected_output=expected_output
)
43 changes: 10 additions & 33 deletions tests/test_rails_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,12 @@

VERSION=os.getenv("SINGLE_VERSION")
if not VERSION:
VERSION="3.1-ubi8"
VERSION="3.3-ubi9"

class TestRailsAppWithPostgreSQLExTemplate:

def setup_method(self):
self.oc_api = OpenShiftAPI(pod_name_prefix="rails-example")
json_raw_file = self.oc_api.get_raw_url_for_json(
container="s2i-ruby-container", dir="imagestreams", filename="ruby-rhel.json"
)
self.oc_api.import_is(path=json_raw_file, name="ruby")
json_raw_file = self.oc_api.get_raw_url_for_json(
container="postgresql-container", dir="imagestreams", filename="postgresql-rhel.json"
)
self.oc_api.import_is(path=json_raw_file, name="postgresql")
self.oc_api = OpenShiftAPI(pod_name_prefix="rails-example", shared_cluster=True)

def teardown_method(self):
self.oc_api.delete_project()
Expand All @@ -32,29 +24,14 @@ def test_template_inside_cluster(self):
branch_to_test = "3.3"
else:
branch_to_test = "master"
expected_output = "Welcome to your Rails application"
template_json = self.oc_api.get_raw_url_for_json(
container="rails-ex", branch=branch_to_test, dir="openshift/templates", filename="rails-postgresql-persistent.json"
)
assert self.oc_api.deploy_template(
template=template_json, name_in_template="rails-example", expected_output=expected_output,
openshift_args=[
f"SOURCE_REPOSITORY_REF={branch_to_test}",
f"RUBY_VERSION={VERSION}",
"NAME=rails-example",
"POSTGRESQL_VERSION=12-el8"
]
json_raw_file = self.oc_api.get_raw_url_for_json(
container="s2i-ruby-container", dir="imagestreams", filename="ruby-rhel.json"
)
assert self.oc_api.template_deployed(name_in_template="rails-example")
assert self.oc_api.check_response_inside_cluster(
name_in_template="rails-example", expected_output=expected_output
self.oc_api.import_is(path=json_raw_file, name="ruby", skip_check=True)
json_raw_file = self.oc_api.get_raw_url_for_json(
container="postgresql-container", dir="imagestreams", filename="postgresql-rhel.json"
)

def test_template_by_request(self):
if VERSION.startswith("3.3"):
branch_to_test = "3.3"
else:
branch_to_test = "master"
self.oc_api.import_is(path=json_raw_file, name="postgresql", skip_check=True)
expected_output = "Welcome to your Rails application"
template_json = self.oc_api.get_raw_url_for_json(
container="rails-ex", branch=branch_to_test, dir="openshift/templates", filename="rails-postgresql-persistent.json"
Expand All @@ -68,7 +45,7 @@ def test_template_by_request(self):
"POSTGRESQL_VERSION=12-el8"
]
)
assert self.oc_api.template_deployed(name_in_template="rails-example")
assert self.oc_api.check_response_outside_cluster(
assert self.oc_api.is_template_deployed(name_in_template="rails-example", timeout=600)
assert self.oc_api.check_response_inside_cluster(
name_in_template="rails-example", expected_output=expected_output
)