-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add container-ci-suite for testing ruby-container in Openshift 4 (#551)
* Add PyTest suite for testing ruby container in OpenShift 4 * Add symlinks to each versions * Get rid of testing OpenShift 3 * Get rid of conu. It is not used at all. Remove test_s2i.py from version 3.3 as well. --------- Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
- Loading branch information
Showing
49 changed files
with
336 additions
and
98 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/run-openshift-pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_ex_standalone.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_latest_imagestreams.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_integration.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_local_templates.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_rails_ex_templates.py |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/run-openshift-pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_ex_standalone.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_latest_imagestreams.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_integration.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_local_templates.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_rails_ex_templates.py |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/run-openshift-pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_ex_standalone.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_latest_imagestreams.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_integration.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_local_templates.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_rails_ex_templates.py |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/run-openshift-pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_ex_standalone.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_ruby_latest_imagestreams.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_imagestreams.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_integration.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_local_templates.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../test/test_s2i_rails_ex_templates.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
# | ||
# IMAGE_NAME specifies a name of the candidate image used for testing. | ||
# The image has to be available before this script is executed. | ||
# VERSION specifies the major version of the MariaDB in format of X.Y | ||
# OS specifies RHEL version (e.g. OS=rhel7) | ||
# | ||
|
||
THISDIR=$(dirname ${BASH_SOURCE[0]}) | ||
|
||
cd "${THISDIR}" && python3.12 -m pytest -s -rA --showlocals -vv test_*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import os | ||
import sys | ||
|
||
import pytest | ||
|
||
from container_ci_suite.utils import check_variables | ||
from container_ci_suite.openshift import OpenShiftAPI | ||
|
||
if not check_variables(): | ||
print("At least one variable from IMAGE_NAME, OS, SINGLE_VERSION is missing.") | ||
sys.exit(1) | ||
|
||
|
||
VERSION = os.getenv("SINGLE_VERSION") | ||
IMAGE_NAME = os.getenv("IMAGE_NAME") | ||
OS = os.getenv("TARGET") | ||
|
||
|
||
# Replacement with 'test_python_s2i_app_ex' | ||
class TestS2IRailsExTemplate: | ||
|
||
def setup_method(self): | ||
self.oc_api = OpenShiftAPI(pod_name_prefix="ruby-testing", version=VERSION) | ||
|
||
def teardown_method(self): | ||
self.oc_api.delete_project() | ||
|
||
def test_dancer_ex_template_inside_cluster(self): | ||
service_name = "ruby-testing" | ||
rails_ex_branch = "master" | ||
if VERSION == "3.3": | ||
rails_ex_branch = VERSION | ||
assert self.oc_api.deploy_s2i_app( | ||
image_name=IMAGE_NAME, app=f"https://github.com/sclorg/rails-ex#{rails_ex_branch}", | ||
context=".", | ||
service_name=service_name | ||
) | ||
assert self.oc_api.template_deployed(name_in_template=service_name) | ||
assert self.oc_api.check_response_inside_cluster( | ||
name_in_template=service_name, expected_output="Welcome to your Rails application" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
import sys | ||
|
||
from pathlib import Path | ||
|
||
from container_ci_suite.imagestreams import ImageStreamChecker | ||
from container_ci_suite.utils import check_variables | ||
|
||
TEST_DIR = Path(os.path.abspath(os.path.dirname(__file__))) | ||
|
||
if not check_variables(): | ||
print("At least one variable from IMAGE_NAME, OS, SINGLE_VERSION is missing.") | ||
sys.exit(1) | ||
|
||
VERSION = os.getenv("SINGLE_VERSION") | ||
|
||
|
||
# Replacement with 'test_latest_imagestreams' | ||
class TestLatestImagestreams: | ||
|
||
def setup_method(self): | ||
self.isc = ImageStreamChecker(working_dir=TEST_DIR.parent.parent) | ||
|
||
def test_latest_imagestream(self): | ||
self.latest_version = self.isc.get_latest_version() | ||
assert self.latest_version != "" | ||
self.isc.check_imagestreams(self.latest_version) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
import sys | ||
|
||
from container_ci_suite.openshift import OpenShiftAPI | ||
from container_ci_suite.utils import check_variables | ||
|
||
|
||
if not check_variables(): | ||
print("At least one variable from IMAGE_NAME, OS, SINGLE_VERSION is missing.") | ||
sys.exit(1) | ||
|
||
|
||
VERSION = os.getenv("SINGLE_VERSION") | ||
IMAGE_NAME = os.getenv("IMAGE_NAME") | ||
OS = os.getenv("OS") | ||
|
||
SHORT_VERSION = "".join(VERSION.split(".")) | ||
|
||
|
||
class TestRubyImagestreams: | ||
|
||
def setup_method(self): | ||
self.oc_api = OpenShiftAPI(pod_name_prefix="ruby", version=VERSION) | ||
|
||
def teardown_method(self): | ||
self.oc_api.delete_project() | ||
|
||
def ruby(self): | ||
service_name = f"ruby-{SHORT_VERSION}-testing" | ||
assert self.oc_api.deploy_imagestream_s2i( | ||
imagestream_file=f"{VERSION}/imagestreams/ruby-rhel.json", | ||
image_name=IMAGE_NAME, | ||
app="https://github.com/sclorg/s2i-ruby-container.git", | ||
context=f"{VERSION}/test/puma-test-app" | ||
) | ||
assert self.oc_api.template_deployed(name_in_template=service_name) | ||
assert self.oc_api.check_response_inside_cluster( | ||
name_in_template=service_name, expected_output="Hello world!" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
import sys | ||
|
||
from container_ci_suite.utils import check_variables | ||
from container_ci_suite.openshift import OpenShiftAPI | ||
|
||
if not check_variables(): | ||
print("At least one variable from IMAGE_NAME, OS, SINGLE_VERSION is missing.") | ||
sys.exit(1) | ||
|
||
|
||
VERSION = os.getenv("SINGLE_VERSION") | ||
IMAGE_NAME = os.getenv("IMAGE_NAME") | ||
OS = os.getenv("TARGET") | ||
|
||
|
||
# Replacement with 'test_python_s2i_app_ex' | ||
class TestS2IRubyTemplate: | ||
|
||
def setup_method(self): | ||
self.oc_api = OpenShiftAPI(pod_name_prefix="ruby-testing", version=VERSION) | ||
|
||
def teardown_method(self): | ||
self.oc_api.delete_project() | ||
|
||
def test_rails_template_inside_cluster(self): | ||
service_name = "ruby-testing" | ||
assert self.oc_api.deploy_s2i_app( | ||
image_name=IMAGE_NAME, app=f"https://github.com/sclorg/s2i-ruby-container.git", | ||
context=f"{VERSION}/test/puma-test-app", | ||
service_name=service_name | ||
) | ||
assert self.oc_api.template_deployed(name_in_template=service_name) | ||
assert self.oc_api.check_response_inside_cluster( | ||
name_in_template=service_name, expected_output="Hello world!" | ||
) |
Oops, something went wrong.