From 67f268ae8633c9aa5b7107a7872db47bc88233c6 Mon Sep 17 00:00:00 2001 From: Petr Khartskhaev Date: Tue, 10 Feb 2026 15:28:41 +0100 Subject: [PATCH 1/2] Disable and remove openshift-4 bash tests --- .github/workflows/container-tests.yml | 2 +- test/run-openshift-remote-cluster | 48 ---------- test/test-lib-openshift.sh | 1 - test/test-lib-remote-openshift.sh | 1 - test/test-lib-ruby.sh | 132 -------------------------- test/test-openshift.yaml | 1 - 6 files changed, 1 insertion(+), 184 deletions(-) delete mode 100755 test/run-openshift-remote-cluster delete mode 120000 test/test-lib-openshift.sh delete mode 120000 test/test-lib-remote-openshift.sh delete mode 100644 test/test-lib-ruby.sh delete mode 120000 test/test-openshift.yaml diff --git a/.github/workflows/container-tests.yml b/.github/workflows/container-tests.yml index 91dbe185..7e3cabbe 100644 --- a/.github/workflows/container-tests.yml +++ b/.github/workflows/container-tests.yml @@ -9,7 +9,7 @@ jobs: needs: check-readme uses: "sclorg/ci-actions/.github/workflows/container-tests.yml@main" with: - enabled-tests: '["container","container-pytest","openshift-4","openshift-pytest","container-fips"]' + enabled-tests: '["container","container-pytest","openshift-pytest","container-fips"]' versions: '[ "2.5", "3.0", "3.3" ]' openshift-versions: '[ "2.5", "3.0", "3.3" ]' secrets: inherit diff --git a/test/run-openshift-remote-cluster b/test/run-openshift-remote-cluster deleted file mode 100755 index e421f347..00000000 --- a/test/run-openshift-remote-cluster +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# Test the Ruby S2I image in OpenShift (remote cluster) -# -# 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 Ruby runtime in format of X.Y -# OS specifies RHEL version (e.g. OS=rhel10) -# - -THISDIR=$(dirname ${BASH_SOURCE[0]}) - -source "${THISDIR}/test-lib-ruby.sh" -source "${THISDIR}/test-lib-remote-openshift.sh" - -TEST_LIST="\ -test_ruby_integration -test_ruby_imagestream -test_ruby_s2i_rails_app -test_ruby_s2i_rails_templates -test_ruby_s2i_rails_persistent_templates -test_ruby_s2i_local_app_templates -test_ruby_s2i_local_persistent_templates -test_latest_imagestreams -" - - -trap ct_os_cleanup EXIT SIGINT - -ct_os_set_ocp4 || exit $OC_ERR - -ct_os_check_compulsory_vars || exit $OC_ERR - -ct_os_check_login || exit $OC_ERR - -ct_os_tag_image_for_cvp "ruby" - -ct_pull_or_import_postgresql || exit $OC_ERR - -set -u - -# For testing on OpenShift 4 we use internal registry -export CT_OCP4_TEST=true - -TEST_SUMMARY='' -TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "openshift-remote-cluster" -# vim: set tabstop=2:shiftwidth=2:expandtab: - diff --git a/test/test-lib-openshift.sh b/test/test-lib-openshift.sh deleted file mode 120000 index f48003b8..00000000 --- a/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../common/test-lib-openshift.sh \ No newline at end of file diff --git a/test/test-lib-remote-openshift.sh b/test/test-lib-remote-openshift.sh deleted file mode 120000 index 15003d84..00000000 --- a/test/test-lib-remote-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../common/test-lib-remote-openshift.sh \ No newline at end of file diff --git a/test/test-lib-ruby.sh b/test/test-lib-ruby.sh deleted file mode 100644 index 4c82f1f8..00000000 --- a/test/test-lib-ruby.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# -# Functions for tests for the Ruby S2I image in OpenShift. -# -# IMAGE_NAME specifies a name of the candidate image used for testing. -# The image has to be available before this script is executed. -# - -THISDIR=$(dirname ${BASH_SOURCE[0]}) - -source "${THISDIR}/test-lib.sh" -source "${THISDIR}/test-lib-openshift.sh" - -function ct_pull_or_import_postgresql() { - postgresql_image="quay.io/sclorg/postgresql-16-c10s" - image_short="postgresql:16" - image_tag="${image_short}" - # Variable CVP is set by CVP pipeline - if [ "${CVP:-0}" -eq "0" ]; then - # In case of container or OpenShift 4 tests - # Pull image before going through tests - # Exit in case of failure, because postgresql container is mandatory - ct_pull_image "${postgresql_image}" "true" - else - # Import postgresql-16-c10s image before running tests on CVP - oc import-image "${image_short}:latest" --from="${postgresql_image}:latest" --insecure=true --confirm - # Tag postgresql image to "postgresql:16" which is expected by test suite - oc tag "${image_short}:latest" "${image_tag}" - fi -} - -function rails_ex_branch() { - # Ruby 3.3 introduced too many incompatibilities to be able - # to use the same Gemfile as for the previous versions. - # We can use the same Gemfile for RHEL 8, 9, and 10 - # as long as Ruby MAJOR.MINOR <= 3.1. - - # Latest stable - rails_example_repo_branch="3.3" - if { echo "$VERSION"; echo "3.1"; } | sort --version-sort --check=quiet; then - # Ruby 3.1 and prior. - rails_example_repo_branch="master" - fi - - echo "$rails_example_repo_branch" -} - -function test_ruby_integration() { - ct_os_test_s2i_app "${IMAGE_NAME}" \ - "https://github.com/sclorg/s2i-ruby-container.git" \ - "${VERSION}/test/puma-test-app" \ - ".*" -} - -# Check the imagestream -function test_ruby_imagestream() { - ct_os_test_image_stream_s2i "${THISDIR}/imagestreams/ruby-${OS//[0-9]/}.json" "${IMAGE_NAME}" \ - "https://github.com/sclorg/s2i-ruby-container.git" \ - "${VERSION}/test/puma-test-app" \ - ".*" -} - -function test_ruby_s2i_rails_app() { - ct_os_test_s2i_app "${IMAGE_NAME}" \ - "https://github.com/sclorg/rails-ex#$(rails_ex_branch)" \ - . \ - 'Welcome to your Rails application' -} - - -function test_ruby_s2i_rails_templates() { - # TODO: this was not working because the referenced example dir was added as part of this commit - ct_os_test_template_app "${IMAGE_NAME}" \ - "https://raw.githubusercontent.com/sclorg/rails-ex/$(rails_ex_branch)/openshift/templates/rails.json" \ - "ruby" \ - "Welcome to your Rails application" \ - 8080 http 200 \ - "-p SOURCE_REPOSITORY_REF=$(rails_ex_branch) -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex -p RUBY_VERSION=${VERSION} -p NAME=ruby-testing" \ - "quay.io/sclorg/postgresql-12-c8s|postgresql:12-el8" -} - -# This is not working. See issue https://github.com/sclorg/s2i-ruby-container/issues/588 -function test_ruby_s2i_rails_persistent_templates() { - return -# ct_os_test_template_app "${IMAGE_NAME}" \ -# "https://raw.githubusercontent.com/sclorg/rails-ex/$(rails_ex_branch)/openshift/templates/rails-postgresql-persistent.json" \ -# "ruby" \ -# "Welcome to your Rails application" \ -# 8080 http 200 \ -# "-p SOURCE_REPOSITORY_REF=$(rails_ex_branch) -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex -p RUBY_VERSION=${VERSION} -p POSTGRESQL_VERSION=12-el8 -p NAME=ruby-testing \ -# -p DATABASE_USER=testu \ -# -p DATABASE_PASSWORD=testp" \ -# "quay.io/sclorg/postgresql-12-c8s|postgresql:12-el8" -} - -# This is not working. See issue https://github.com/sclorg/s2i-ruby-container/issues/588 -function test_ruby_s2i_local_persistent_templates() { - return -# ct_os_test_template_app "${IMAGE_NAME}" \ -# "${THISDIR}/examples/rails-postgresql-persistent.json" \ -# "ruby" \ -# "Welcome to your Rails application" \ -# 8080 http 200 \ -# "-p SOURCE_REPOSITORY_REF=$(rails_ex_branch) -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex -p RUBY_VERSION=${VERSION} -p POSTGRESQL_VERSION=12-el8 -p NAME=ruby-testing \ -# -p DATABASE_USER=testu \ -# -p DATABASE_PASSWORD=testp" \ -# "quay.io/sclorg/postgresql-12-c8s|postgresql:12-el8" -} - -function test_ruby_s2i_local_app_templates() { - # TODO: this was not working because the referenced example dir was added as part of this commit - ct_os_test_template_app "${IMAGE_NAME}" \ - "${THISDIR}/examples/rails.json" \ - "ruby" \ - "Welcome to your Rails application" \ - 8080 http 200 \ - "-p SOURCE_REPOSITORY_REF=$(rails_ex_branch) -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex -p RUBY_VERSION=${VERSION} -p NAME=ruby-testing" \ - "quay.io/sclorg/postgresql-12-c8s|postgresql:12-el8" -} - -function test_latest_imagestreams() { - local result=1 - # Switch to root directory of a container - pushd "${THISDIR}/../.." >/dev/null || return 1 - ct_check_latest_imagestreams - result=$? - popd >/dev/null || return 1 - return $result -} - -# vim: set tabstop=2:shiftwidth=2:expandtab: - diff --git a/test/test-openshift.yaml b/test/test-openshift.yaml deleted file mode 120000 index 9316d8fa..00000000 --- a/test/test-openshift.yaml +++ /dev/null @@ -1 +0,0 @@ -../common/test-openshift.yaml \ No newline at end of file From cbfeb4971da93d1f2e28f597aee289f30b7e0f81 Mon Sep 17 00:00:00 2001 From: Petr Khartskhaev Date: Wed, 11 Feb 2026 10:20:50 +0100 Subject: [PATCH 2/2] Fix typo in openshift pytest --- test/test_ocp_s2i_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_ocp_s2i_templates.py b/test/test_ocp_s2i_templates.py index c4702a8e..5ecc7f71 100644 --- a/test/test_ocp_s2i_templates.py +++ b/test/test_ocp_s2i_templates.py @@ -38,7 +38,7 @@ def test_rails_template_inside_cluster(self, template_type): Test if Ruby s2i local templates work properly """ assert self.oc_api.upload_image( - VARS.DEPLOYED_PGSQL_IMAGE, VARS.PSQL_IMAGE_SHORT + VARS.DEPLOYED_PSQL_IMAGE, VARS.PSQL_IMAGE_SHORT ) service_name = f"ruby-{VARS.SHORT_VERSION}-testing" if template_type == "local":