⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@phracek
Copy link
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_extensions.py

All tests are migrated except run_migration_test and run_upgrade_test.

The migration matrix is following:
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_extensions.py

The following tests are NOT migrated yet.
run_migration_test and run_upgrade_tests.

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@github-actions
Copy link

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
Member Author

phracek commented Jan 6, 2026

Let's try first round
[test-pytest]

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - PyTest - 16Fedora-latestx86_64✅ passed07.01.2026 13:53:427min 47stest pipeline
Fedora - PyTest - 15Fedora-latestx86_64✅ passed07.01.2026 13:53:498min 4stest pipeline
CentOS Stream 9 - PyTest - 13CentOS-Stream-9x86_64✅ passed07.01.2026 13:53:4211min 30stest pipeline
CentOS Stream 10 - PyTest - 16CentOS-Stream-10x86_64✅ passed07.01.2026 13:53:5810min 34stest pipeline
CentOS Stream 9 - PyTest - 15CentOS-Stream-9x86_64✅ passed07.01.2026 13:53:5411min 48stest pipeline
CentOS Stream 9 - PyTest - 16CentOS-Stream-9x86_64✅ passed07.01.2026 13:53:5011min 40stest pipeline
RHEL10 - Unsubscribed host - PyTest - 16RHEL-10-Nightlyx86_64✅ passed07.01.2026 13:53:4215min 45stest pipeline
RHEL8 - PyTest - 12RHEL-8.10.0-Nightlyx86_64✅ passed07.01.2026 13:53:4517min 17stest pipeline
RHEL8 - PyTest - 16RHEL-8.10.0-Nightlyx86_64✅ passed07.01.2026 13:53:4516min 2stest pipeline
RHEL9 - Unsubscribed host - PyTest - 13RHEL-9.6.0-Nightlyx86_64✅ passed07.01.2026 13:53:4217min 35stest pipeline
RHEL9 - Unsubscribed host - PyTest - 16RHEL-9.6.0-Nightlyx86_64✅ passed07.01.2026 13:53:4320min 52stest pipeline
RHEL9 - Unsubscribed host - PyTest - 15RHEL-9.6.0-Nightlyx86_64✅ passed07.01.2026 13:53:4319min 22stest pipeline
RHEL9 - PyTest - 15RHEL-9.6.0-Nightlyx86_64✅ passed07.01.2026 13:53:5721min 42stest pipeline
RHEL8 - PyTest - 15RHEL-8.10.0-Nightlyx86_64✅ passed07.01.2026 13:53:4317min 38stest pipeline
RHEL9 - PyTest - 13RHEL-9.6.0-Nightlyx86_64✅ passed07.01.2026 13:53:4320min 3stest pipeline
RHEL9 - PyTest - 16RHEL-9.6.0-Nightlyx86_64✅ passed07.01.2026 13:53:5421min 13stest pipeline
RHEL10 - PyTest - 16RHEL-10-Nightlyx86_64✅ passed07.01.2026 13:53:4314min 53stest pipeline
RHEL8 - PyTest - 13RHEL-8.10.0-Nightlyx86_64✅ passed07.01.2026 13:53:4817min 54stest pipeline

Don not call the function twice

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek phracek force-pushed the container_pytests branch from d7126c2 to a7a86fd Compare January 7, 2026 13:52
@phracek
Copy link
Member Author

phracek commented Jan 7, 2026

Let's try next round
[test-pytest]

function

Signed-off-by: Petr "Stone" Hracek <[email protected]>
Copy link
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

container_id=VARS.IMAGE_NAME,
username="postgres",
password=admin_password,
database="postgres?sslmode=require",
Copy link
Contributor

Choose a reason for hiding this comment

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

This technically produces the correct URI string, but ?sslmode=require isn't part of the database name and should be treated separately as an argument/parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

And if one were to URI encode the database name like I propose we do in the bash tests, the string would come out to postgresql://postgres@ip:5432/postgres%3Fsslmode%3Drequire which obviously fails.

So I suggest that postgresql_cmd be modified to include a parameters argument where these would be included.

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines +151 to +156
[
'"the user"',
'"the pass"',
'"the db"',
"",
],
Copy link
Contributor

Choose a reason for hiding this comment

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

This defines the username as the user when creating the container because it's passed as an environment variable, but as "the user" when connecting to it, which is different from the former. I suggest removing the single quotes and instead surrounding psql_user etc. with double quotes below (line 173-181) inside the f-strings.

Copy link
Contributor

Choose a reason for hiding this comment

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

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