Skip to content

Conversation

@phracek
Copy link
Member

@phracek phracek commented Nov 11, 2025

This pull request migrates bash test suite
to container-ci-suite stored here: https://github.org/sclorg/container-ci-suite

Introduce PyTest suite migrated from test/run bash suite.
Migration matrix is:

build_s2i_app is fixture that takes Path test-app from conftest.py
file.

test_container_application.py tests all test-app directories.

test_container_basics.py tests only basics w/o application.
It also tests test_dockerfile and test_minimal_dockerfile

Signed-off-by: Petr "Stone" Hracek [email protected]

phracek added a commit to phracek/s2i-python-container that referenced this pull request Nov 11, 2025
phracek added a commit that referenced this pull request Nov 11, 2025
This blocks: #768

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Nov 11, 2025

Rebased against master. Let's run first round of tests.
[test][test-pytest][test-openshift-pytest]

@github-actions
Copy link

github-actions bot commented Nov 11, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
RHEL8 - PyTest - OpenShift 4 - 3.12RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 13:51:4426min 23stest pipeline
RHEL8 - PyTest - OpenShift 4 - 3.9RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 13:51:4424min 56stest pipeline
RHEL8 - 3.9-minimalRHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:08:0124min 43stest pipeline
RHEL8 - PyTest - 3.11RHEL-8.10.0-Nightlyx86_64✅ passed27.11.2025 14:54:1222min 38stest pipeline
RHEL8 - PyTest - OpenShift 4 - 3.12-minimalRHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 13:51:4823min 53stest pipeline
RHEL8 - PyTest - 3.9RHEL-8.10.0-Nightlyx86_64✅ passed27.11.2025 14:34:1122min 21stest pipeline
RHEL8 - PyTest - 3.12-minimalRHEL-8.10.0-Nightlyx86_64✅ passed27.11.2025 15:04:0923min 23stest pipeline
RHEL10 - PyTest - OpenShift 4 - 3.12-minimalRHEL-10-Nightlyx86_64❌ error19.11.2025 08:24:4714min 53stest pipeline
RHEL8 - PyTest - OpenShift 4 - 3.11RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 13:51:4525min 12stest pipeline
RHEL10 - PyTest - 3.12-minimalRHEL-10-Nightlyx86_64❌ error27.11.2025 14:19:2214min 21stest pipeline
RHEL8 - PyTest - 3.9-minimalRHEL-8.10.0-Nightlyx86_64✅ passed27.11.2025 15:00:3621min 43stest pipeline
RHEL9 - PyTest - OpenShift 4 - 3.12RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 13:51:4431min 10stest pipeline
RHEL8 - PyTest - 3.11-minimalRHEL-8.10.0-Nightlyx86_64✅ passed27.11.2025 14:08:5721min 48stest pipeline
RHEL9 - 3.9RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 13:51:5130min 25stest pipeline
RHEL9 - 3.12-minimalRHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 14:29:3228min 8stest pipeline
RHEL9 - PyTest - 3.12-minimalRHEL-9.6.0-Nightlyx86_64✅ passed27.11.2025 14:09:1923min 44stest pipeline
RHEL9 - PyTest - OpenShift 4 - 3.12-minimalRHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 17:13:2529min 5stest pipeline
RHEL9 - PyTest - OpenShift 4 - 3.11RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 13:51:4630min 7stest pipeline
RHEL8 - 3.11RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:36:5527min 32stest pipeline
RHEL9 - PyTest - 3.9RHEL-9.6.0-Nightlyx86_64✅ passed27.11.2025 14:21:3123min 52stest pipeline
RHEL9 - PyTest - OpenShift 4 - 3.9RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 17:13:2329min 56stest pipeline
RHEL9 - PyTest - 3.11RHEL-9.6.0-Nightlyx86_64✅ passed27.11.2025 13:49:0925min 43stest pipeline
RHEL8 - 3.12RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:37:2727min 10stest pipeline
RHEL8 - 3.12-minimalRHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 13:51:5126min 17stest pipeline
RHEL10 - 3.12-minimalRHEL-10-Nightlyx86_64❌ error19.11.2025 08:24:5114min 35stest pipeline
CentOS Stream 9 - PyTest - 3.9CentOS-Stream-9x86_64✅ passed27.11.2025 14:44:5718min 50stest pipeline
CentOS Stream 10 - PyTest - 3.12-minimalCentOS-Stream-10x86_64❌ error27.11.2025 15:06:3922min 15stest pipeline
CentOS Stream 9 - PyTest - 3.11-minimalCentOS-Stream-9x86_64✅ passed27.11.2025 15:06:5423min 42stest pipeline
CentOS Stream 9 - PyTest - 3.12-minimalCentOS-Stream-9x86_64✅ passed27.11.2025 14:52:1620min 6stest pipeline
CentOS Stream 10 - 3.12CentOS-Stream-10x86_64✅ passed18.11.2025 14:30:3319min 36stest pipeline
RHEL9 - PyTest - 3.12RHEL-9.6.0-Nightlyx86_64✅ passed27.11.2025 14:02:3826min 22stest pipeline
RHEL8 - PyTest - 3.12RHEL-8.10.0-Nightlyx86_64✅ passed27.11.2025 13:59:3821min 2stest pipeline
RHEL8 - 3.11-minimalRHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:38:5125min 18stest pipeline
RHEL8 - 3.9RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:36:3927min 3stest pipeline
Fedora - PyTest - 3.13Fedora-latestx86_64✅ passed27.11.2025 15:05:1225min 30stest pipeline
CentOS Stream 9 - PyTest - 3.9-minimalCentOS-Stream-9x86_64✅ passed27.11.2025 14:42:0716min 45stest pipeline
CentOS Stream 10 - PyTest - 3.12CentOS-Stream-10x86_64✅ passed27.11.2025 14:44:2421min 24stest pipeline
CentOS Stream 9 - 3.12-minimalCentOS-Stream-9x86_64✅ passed18.11.2025 13:51:5220min 9stest pipeline
RHEL9 - 3.11RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 17:13:3429min 53stest pipeline
RHEL9 - 3.12RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 14:34:2930min 39stest pipeline
CentOS Stream 9 - PyTest - 3.11CentOS-Stream-9x86_64✅ passed27.11.2025 14:02:1826min 36stest pipeline
CentOS Stream 9 - PyTest - 3.12CentOS-Stream-9x86_64✅ passed27.11.2025 14:00:5920min 26stest pipeline
CentOS Stream 9 - 3.9-minimalCentOS-Stream-9x86_64✅ passed18.11.2025 14:28:3419min 46stest pipeline
CentOS Stream 9 - 3.12CentOS-Stream-9x86_64✅ passed18.11.2025 13:51:5321min 24stest pipeline
CentOS Stream 9 - 3.11CentOS-Stream-9x86_64✅ passed18.11.2025 14:26:4622min 50stest pipeline
CentOS Stream 10 - 3.12-minimalCentOS-Stream-10x86_64✅ passed18.11.2025 14:38:5018min 32stest pipeline
CentOS Stream 9 - 3.9CentOS-Stream-9x86_64✅ passed18.11.2025 14:37:1121min 26stest pipeline
Fedora - 3.13Fedora-latestx86_64✅ passed18.11.2025 13:52:0117min 47stest pipeline
RHEL9 - OpenShift 4 - 3.12-minimalRHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 14:16:2126min 8stest pipeline
RHEL10 - OpenShift 4 - 3.12-minimalRHEL-10-Nightlyx86_64❌ error19.11.2025 08:29:1614min 46stest pipeline
RHEL8 - OpenShift 4 - 3.9RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:24:0721min 48stest pipeline
RHEL9 - OpenShift 4 - 3.9RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 14:18:1925min 23stest pipeline
RHEL9 - OpenShift 4 - 3.12RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 14:10:2527min 17stest pipeline
RHEL9 - OpenShift 4 - 3.11RHEL-9.6.0-Nightlyx86_64✅ passed18.11.2025 14:22:1828min 1stest pipeline
RHEL8 - OpenShift 4 - 3.12-minimalRHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:10:1418min 28stest pipeline
RHEL8 - OpenShift 4 - 3.12RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:10:4118min 23stest pipeline
RHEL8 - OpenShift 4 - 3.11RHEL-8.10.0-Nightlyx86_64✅ passed18.11.2025 14:18:4821min 44stest pipeline
CentOS Stream 9 - 3.11-minimalCentOS-Stream-9x86_64✅ passed18.11.2025 13:52:0619min 51stest pipeline
Fedora - 3.13-minimalFedora-latestx86_64✅ passed18.11.2025 14:09:2016min 25stest pipeline
CentOS Stream 10 - 3.13CentOS-Stream-10x86_64✅ passed18.11.2025 14:35:0920min 56stest pipeline
CentOS Stream 10 - PyTest - 3.13CentOS-Stream-10x86_64✅ passed27.11.2025 14:48:5919min 45stest pipeline

@phracek
Copy link
Member Author

phracek commented Nov 11, 2025

RHEL8 failures are caused by CDN errors:

[MIRROR] libffi-devel-3.1-24.el8.x86_64.rpm: Curl error (28): Timeout was reached for https://stagecdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/Packages/l/libffi-devel-3.1-24.el8.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[MIRROR] hunspell-en-0.20140811.1-12.el8.noarch.rpm: Curl error (56): Failure when receiving data from the peer for https://stagecdn.redhat.com/content/dist/rhel8/8/x86_64/appstream/os/Packages/h/hunspell-en-0.20140811.1-12.el8.noarch.rpm [Received HTTP code 503 from proxy after CONNECT]
[MIRROR] libtalloc-2.4.1-0.el8.x86_64.rpm: Curl error (28): Timeout was reached for https://stagecdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/Packages/l/libtalloc-2.4.1-0.el8.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[MIRROR] openldap-devel-2.4.46-21.el8_10.x86_64.rpm: Curl error (28): Timeout was reached for https://stagecdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/Packages/o/openldap-devel-2.4.46-21.el8_10.x86_64.rpm [Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds]
[MIRROR] hunspell-en-GB-0.20140811.1-12.el8.noarch.rpm: Curl error (56): Failure when receiving data from the peer for https://stagecdn.redhat.com/content/dist/rhel8/8/x86_64/appstream/os/Packages/h/hunspell-en-GB-0.20140811.1-12.el8.noarch.rpm [Received HTTP code 503 from proxy after CONNECT]
[MIRROR] libffi-devel-3.1-24.el8.x86_64.rpm: Curl error (56): Failure when receiving data from the peer for https://stagecdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/Packages/l/libffi-devel-3.1-24.el8.x86_64.rpm [Received HTTP code 503 from proxy after CONNECT]
[FAILED] libffi-devel-3.1-24.el8.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success

The downloaded packages were saved in cache until the next successful t

@phracek
Copy link
Member Author

phracek commented Nov 12, 2025

[test][test-all]

@phracek
Copy link
Member Author

phracek commented Nov 13, 2025

The new container-ci-suite was released. Let's re-test it.

[test-all]

@phracek
Copy link
Member Author

phracek commented Nov 13, 2025

Python failures are:

C10S - PyTest - 3.12-minimal:

[notice] A new release of pip is available: 24.2 -> 25.3
[notice] To update, run: pip install --upgrade pip
--> 04db29fbc4be
[2/2] STEP 1/6: FROM quay.io/sclorg/python-312-minimal-c10s:3.12-minimal
[2/2] STEP 2/6: COPY --from=builder $APP_ROOT $APP_ROOT
--> 8b1aba1b0f19
[2/2] STEP 3/6: USER 0
--> 8f0c8050bef9
[2/2] STEP 4/6: RUN microdnf install -y httpd enchant
Downloading metadata...
Downloading metadata...
Downloading metadata...
error: No package matches 'enchant'
Error: building at STEP "RUN microdnf install -y httpd enchant": while running runtime: exit status 1

It caused, I guess, main image should not be pulled. C10S - 3.12 should not be exists in quay.io/sclorg/python-312-c10s. RHEL10 does not exists.

Fedora PyTest - 3.13 - test_container_basics.py::TestS2IPythonContainer::test_dockerfiles[Dockerfile.tpl] INFO:Image name to test: quay.io/fedora/python3-313:3.13

Downloading setuptools-80.9.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 428.5 MB/s eta 0:00:00
Building wheels for collected packages: psycopg2-binary
  Building wheel for psycopg2-binary (pyproject.toml): started
  Building wheel for psycopg2-binary (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for psycopg2-binary (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [115 lines of output]
      /tmp/pip-build-env-jyymjeu8/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-313/psycopg2
  

RHEL8 - 3.11 and RHEL9-PyTest-3.11

[notice] To update, run: python3.11 -m pip install --upgrade pip
---> Installing dependencies via pipenv ...
Courtesy Notice:
Pipenv found itself running within a virtual environment,  so it will 
automatically use that environment, instead of  creating its own for any 
project. You can set
PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and 
create  its own instead.
You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (63c7a0)...
Looking in indexes: https://pypi.python.org/simple
Obtaining file:///opt/app-root/src (from -r 
/tmp/pipenv-48jubp3a-requirements/pipenv-7im0x6ci-reqs.txt (line 1))
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File 
"/opt/app-root/src/.local/venvs/pipenv/lib/python3.11/site-packages/pipenv/patch
ed/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
    status = _inner_run()
             ^^^^^^^^^^^^
  File 
"/opt/app-root/src/.local/venvs/pipenv/lib/python3.11/site-packages/pipenv/patch
ed/pip/_internal/cli/base_command.py", line 96, in _inner_run
    return self.run(options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/opt/app-root/src/.local/venvs/pipenv/lib/python3.11/site-packages/pipenv/patch
ed/pip/_internal/cli/req_command.py", line 68, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File 

@frenzymadness
Copy link
Member

It caused, I guess, main image should not be pulled. C10S - 3.12 should not be exists in quay.io/sclorg/python-312-c10s. RHEL10 does not exists.

I don't understand this sentence, sorry. We have dockerfiles here for 3.12 and 3.12-minimal based on C10S.

Fedora PyTest - 3.13 - test_container_basics.py::TestS2IPythonContainer::test_dockerfiles[Dockerfile.tpl] INFO:Image name to test: quay.io/fedora/python3-313:3.13

The version of psycopg2-binary I see in the logs indicates that this test used django-ex branch 3.2.x and that's incorrect. New Pythons like 3.13 should use Django version/branch 4.2.x that has newer psycopg2-binary dependency and that new version provides wheels for Python 3.13.

RHEL8 - 3.11 and RHEL9-PyTest-3.11

I need more time to investigate the last one. I'm not able to reproduce locally so I need to build the container image first.

Also VARS.* variables are used during the migration.

Signed-off-by: Petr "Stone" Hracek <[email protected]>
Migration matrix is:

`build_s2i_app` is fixture that takes `Path` test-app from `conftest.py`
file.

test_container_application.py tests all test-app directories.

test_container_basics.py tests only basics w/o application.
It also tests test_dockerfile and test_minimal_dockerfile

Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
Add distgen generated files

Signed-off-by: Petr "Stone" Hracek <[email protected]>
Fix proper branch in `test_dockerfiles` function.

Add test suite to Class and build application once.

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Nov 18, 2025

I have fixed some issues. Let's re-run tests again
[test-all]

Copy link
Member

@frenzymadness frenzymadness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good overall. Just a few nitpicks.

image_name=full_image_name, loops=1
)
print(f"Is image {full_image_name} pulled? {is_pulled}")
if is_pulled:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this part just fail when we are unable to pull the full image and therefore run the tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See here: https://github.com/sclorg/s2i-python-container/blob/master/test/run#L236. In case it is not pull, then skip the tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem in bash suite is here:

$ IMAGE_NAME=quay.io/sclorg/python-39-minimal-c9s:39-minimal
$ NEW_IMAGE=${IMAGE_NAME/-minimal/}
$ echo $NEW_IMAGE
quay.io/sclorg/python-39-c9s:39-minimal
$

which is totally different image.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frenzymadness What about if full version does not exist? Like python-312-minimal for RHEL10? It should not fail, I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation, that makes sense. Could you please improve the message to something like: The full container image for the minimal one does not exist, skipping the rest of the tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 4638046

@frenzymadness
Copy link
Member

Let me know if you want me to take a look at the results of the failed tests.

Use default branch 4.2.X for all versions except 3.6

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Nov 26, 2025

Let's test it again

[test-pytest]

minimal one does not have it.

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Nov 27, 2025

[test-pytest]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants