Skip to content

Container PyTest suite for Postgresql-container#640

Open
phracek wants to merge 18 commits intosclorg:masterfrom
phracek:container_pytests
Open

Container PyTest suite for Postgresql-container#640
phracek wants to merge 18 commits intosclorg:masterfrom
phracek:container_pytests

Conversation

@phracek
Copy link
Copy Markdown
Member

@phracek phracek commented Jan 6, 2026

This pull request adds PyTest suite migrated from run_pytest scripts.

run_container_creation_tests -> test_container_configuration.py
run_general_tests -> test_container_general.py
run_change_password_test -> test_container_password.py
run_replication_test -> test_container_replication.py
run_s2i_test -> test_container_basics.py
run_test_cfg_hook -> test_container_configuration.py
run_s2i_bake_data_test -> test_container_ssl.py
run_s2i_enable_ssl_test -> test_container_ssl.py
run_pgaudit_test -> test_container_extensions.py
run_pgvector_test -> test_container_extensions.py
run_env_extension_load_test -> test_container_extensions.py
run_logging_test -> test_container_logging.py

All tests are migrated except run_migration_test and run_upgrade_test.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 6, 2026

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

@phracek
Copy link
Copy Markdown
Member Author

phracek commented Jan 6, 2026

Let's try first round
[test-pytest]

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 6, 2026

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - PyTest - 16Fedora-latestx86_64✅ passed14.04.2026 08:32:2510min 26stest pipeline
Fedora - PyTest - 15Fedora-latestx86_64✅ passed14.04.2026 07:59:2810min 42stest pipeline
CentOS Stream 9 - PyTest - 13CentOS-Stream-9x86_64✅ passed14.04.2026 07:59:2513min 22stest pipeline
CentOS Stream 10 - PyTest - 16CentOS-Stream-10x86_64✅ passed14.04.2026 08:19:5913min 11stest pipeline
CentOS Stream 9 - PyTest - 15CentOS-Stream-9x86_64✅ passed14.04.2026 08:13:4313min 20stest pipeline
CentOS Stream 9 - PyTest - 16CentOS-Stream-9x86_64✅ passed14.04.2026 08:11:5014min 42stest pipeline
RHEL10 - Unsubscribed host - PyTest - 16RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 07:59:2721min 11stest pipeline
RHEL8 - PyTest - 12RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 07:59:2517min 50stest pipeline
RHEL8 - PyTest - 16RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 07:59:2719min 33stest pipeline
RHEL9 - Unsubscribed host - PyTest - 13RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:09:5119min 45stest pipeline
RHEL9 - Unsubscribed host - PyTest - 16RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2622min 26stest pipeline
RHEL9 - Unsubscribed host - PyTest - 15RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2522min 37stest pipeline
RHEL9 - PyTest - 15RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:21:5323min 41stest pipeline
RHEL8 - PyTest - 15RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 08:13:5518min 2stest pipeline
RHEL9 - PyTest - 13RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:09:4924min 33stest pipeline
RHEL9 - PyTest - 16RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2827min 28stest pipeline
RHEL10 - PyTest - 16RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 08:19:5021min 56stest pipeline
RHEL8 - PyTest - 13RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 07:59:2918min 48stest pipeline
Fedora - PyTest - 18Fedora-latestx86_64✅ passed14.04.2026 08:34:2910min 42stest pipeline
CentOS Stream 9 - PyTest - 18CentOS-Stream-9x86_64✅ passed14.04.2026 08:38:0614min 7stest pipeline
RHEL9 - Unsubscribed host - PyTest - 18RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2821min 59stest pipeline
RHEL10 - PyTest - 18RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 08:22:0021min 14stest pipeline
RHEL10 - Unsubscribed host - PyTest - 18RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 08:21:4521min 7stest pipeline
RHEL9 - PyTest - 18RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2726min 1stest pipeline
CentOS Stream 10 - PyTest - 18CentOS-Stream-10x86_64✅ passed14.04.2026 08:32:1413min 48stest pipeline
Fedora - 16Fedora-latestx86_64✅ passed14.04.2026 08:28:148min 33stest pipeline
CentOS Stream 10 - 16CentOS-Stream-10x86_64✅ passed14.04.2026 08:23:4210min 45stest pipeline
CentOS Stream 9 - 13CentOS-Stream-9x86_64✅ passed14.04.2026 08:34:2011min 5stest pipeline
CentOS Stream 9 - 15CentOS-Stream-9x86_64✅ passed14.04.2026 08:36:0412min 56stest pipeline
RHEL10 - 16RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 08:17:4518min 13stest pipeline
RHEL8 - 15RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 07:59:2518min 8stest pipeline
RHEL10 - Unsubscribed host - 18RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 08:11:5318min 47stest pipeline
RHEL9 - 13RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:30:1821min 51stest pipeline
RHEL9 - Unsubscribed host - 16RHEL-9.8.0-Nightlyx86_64✅ passed01.04.2026 11:30:2621min 45stest pipeline
RHEL9 - 15RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2823min 55stest pipeline
Fedora - 15Fedora-latestx86_64✅ passed14.04.2026 07:59:288min 42stest pipeline
RHEL8 - 12RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 08:27:5715min 35stest pipeline
CentOS Stream 9 - 16CentOS-Stream-9x86_64✅ passed14.04.2026 07:59:2812min 38stest pipeline
Fedora - 18Fedora-latestx86_64✅ passed14.04.2026 07:59:278min 49stest pipeline
RHEL9 - Unsubscribed host - 13RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:27:5819min 47stest pipeline
RHEL9 - 18RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:24:0123min 37stest pipeline
CentOS Stream 9 - 18CentOS-Stream-9x86_64✅ passed14.04.2026 08:19:5012min 36stest pipeline
RHEL10 - Unsubscribed host - 16RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 08:36:2120min 16stest pipeline
RHEL9 - Unsubscribed host - 18RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 07:59:2524min 2stest pipeline
RHEL8 - 13RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 08:23:5116min 44stest pipeline
RHEL9 - 16RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:27:0424min 13stest pipeline
RHEL8 - 16RHEL-8.10.0-Nightlyx86_64✅ passed14.04.2026 08:23:5417min 50stest pipeline
RHEL10 - 18RHEL-10.2-Nightlyx86_64✅ passed14.04.2026 07:59:2520min 32stest pipeline
RHEL9 - Unsubscribed host - 15RHEL-9.8.0-Nightlyx86_64✅ passed14.04.2026 08:23:4821min 39stest pipeline
CentOS Stream 10 - 18CentOS-Stream-10x86_64✅ passed14.04.2026 07:59:2511min 49stest pipeline

@phracek
Copy link
Copy Markdown
Member Author

phracek commented Jan 7, 2026

Let's try next round
[test-pytest]

Comment thread test/test_container_configuration.py
Copy link
Copy Markdown
Contributor

@pkhartsk pkhartsk left a comment

Choose a reason for hiding this comment

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

Found some things and included proposed fixes for both

Comment thread test/test_container_ssl.py Outdated
Comment thread test/test_container_configuration.py Outdated
@phracek
Copy link
Copy Markdown
Member Author

phracek commented Mar 18, 2026

I will rewrite it so that each commit will represent each test suite and ocp_renaming will be a part of another PR.

@phracek
Copy link
Copy Markdown
Member Author

phracek commented Mar 31, 2026

@fila43 Please review parts test_container_upgrade.py and test_container_migration.py. The pagila is now part of this repo. In case you would like to download it e.g. from https://github.com/devrimgunduz/pagila, then please let me know. Thanks.

Comment thread test/conftest.py Outdated
phracek added 4 commits April 1, 2026 13:11
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_s2i_test -> test_container_basics.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_container_creation_tests -> test_container_configuration.py
run_test_cfg_hook -> test_container_configuration.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_pgaudit_test -> test_container_extensions.py
run_pgvector_test -> test_container_extensions.py
run_env_extension_load_test -> test_container_extensions.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek phracek force-pushed the container_pytests branch from 6ae07ed to 5217d9d Compare April 1, 2026 11:11
@phracek
Copy link
Copy Markdown
Member Author

phracek commented Apr 1, 2026

Rebased against 'master' branch

[test-pytest][test]

Copy link
Copy Markdown
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.

First few ideas.

Also, there are typos in commit messages: propoer instead of proper and test_container_generall.py instead of test_container_general.py

Comment thread test/conftest.py Outdated
Comment thread test/test_container_password.py Outdated
Comment thread test/conftest.py Outdated
Comment thread test/test_container_configuration.py Outdated
Comment thread test/test_container_extensions.py Outdated
phracek added 12 commits April 7, 2026 19:26
run_general_tests -> test_container_general.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_logging_test -> test_container_logging.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_change_password_test -> test_container_password

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_replication_test -> test_container_replication.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
run_s2i_bake_data_test -> test_container_ssl.py
run_s2i_enable_ssl_test -> test_container_ssl.py

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Test summary for version 16

```
=========================== short test summary info ============================
PASSED test_container_migrate.py::TestPostgreSQLMigration::test_migration_functionality[13]
PASSED test_container_migrate.py::TestPostgreSQLMigration::test_migration_functionality[15]
SKIPPED [1] test_container_migrate.py:55: registry.redhat.io/rhel9/postgresql-12 image not found in registry so skipping migration test..
SKIPPED [1] test_container_migrate.py:51: Migration path from 16 -> 16 is not valid so skipping.
SKIPPED [1] test_container_migrate.py:51: Migration path from 18 -> 16 is not valid so skipping.
```

Test summary for version 18
```
=========================== short test summary info ============================
PASSED test_container_migrate.py::TestPostgreSQLMigration::test_migration_functionality[13]
PASSED test_container_migrate.py::TestPostgreSQLMigration::test_migration_functionality[15]
PASSED test_container_migrate.py::TestPostgreSQLMigration::test_migration_functionality[16]
SKIPPED [1] test_container_migrate.py:55: registry.redhat.io/rhel9/postgresql-12 image not found in registry so skipping migration test..
SKIPPED [1] test_container_migrate.py:51: Migration path from 18 -> 18 is not valid so skipping.

```

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Skip in case of previous version does not exist

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Sometimes /usr/libexec/check-container does not work
properly.
Let's check it by accepting connections by simple command

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Delete temporary directories at the end of each tests

We do not need SSL warnings at all.

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek phracek force-pushed the container_pytests branch from 5217d9d to a116509 Compare April 8, 2026 13:46
Copy link
Copy Markdown
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.

A couple more points.

Comment thread test/conftest.py Outdated
Comment thread test/test_container_extensions.py
Comment thread test/test_container_basics.py Outdated
phracek added 2 commits April 13, 2026 12:40
We do not need 'none' in case 'version' exist in list
then return index - 1 otherwise return None

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Update comment 4 in test_container_basics.py

Remove obsoleted test, as it is not present in test/run_test bash
tests as well.

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek
Copy link
Copy Markdown
Member Author

phracek commented Apr 13, 2026

@frenzymadness Thanks for the second round of review.

@phracek
Copy link
Copy Markdown
Member Author

phracek commented Apr 14, 2026

[test][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.

4 participants