Skip to content

Conversation

@phracek
Copy link
Member

@phracek phracek commented Dec 4, 2025

Migration matrix is:

  • run_container_creation_tests -> test_container_configuration.py(test_try_image_invalid_combinations, test_container_creation_fails, test_invalid_configuration_tests.py
  • run_configuration_tests -> test_container_configuration.py(TestMariaDBConfigurationTests and TestsMariaDBConfiguratioTest) TestMariaDB
  • run_general_tests -> test_container_general.py(test_run and test_datadir)
  • run_change_password_test -> test_container_password.py
  • run_change_password_new_user_test -> test_container_password.py
  • run_replication_test -> test_container_replication.py
  • run_s2i_test -> test_container_basics.py
  • run_ssl_test -> test_container_basics.py
  • run_upgrade_test -> test_container_upgrade.py
  • run_plugin_test -> test_container_plugin.py

Migration matrix is:

- run_container_creation_tests -> test_container_configuration.py(test_try_image_invalid_combinations,
  test_container_creation_fails, test_invalid_configuration_tests.py
- run_configuration_tests ->
  test_container_configuration.py(TestMariaDBConfigurationTests and
  TestsMariaDBConfiguratioTest)
  TestMariaDB
- run_general_tests -> test_container_general.py(test_run and
  test_datadir)
- run_change_password_test -> test_container_password.py
- run_change_password_new_user_test -> test_container_password.py
- run_replication_test -> test_container_replication.py
- run_s2i_test -> test_container_basics.py
- run_ssl_test -> test_container_basics.py
- run_upgrade_test -> test_container_upgrade.py
- run_plugin_test -> test_container_plugin.py

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

phracek commented Dec 4, 2025

[test-pytest]

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Pull Request validation

Failed

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

Success

🟢 CI - All checks have passed

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - PyTest - 11.8Fedora-latestx86_64✅ passed14.01.2026 09:06:3811min 56stest pipeline
Fedora - PyTest - 10.11Fedora-latestx86_64✅ passed14.01.2026 09:06:1610min 3stest pipeline
CentOS Stream 9 - PyTest - 10.11CentOS-Stream-9x86_64✅ passed14.01.2026 09:18:4414min 40stest pipeline
CentOS Stream 10 - PyTest - 10.11CentOS-Stream-10x86_64✅ passed14.01.2026 09:06:1814min 6stest pipeline
RHEL10 - PyTest - 10.11RHEL-10-Nightlyx86_64✅ passed23.01.2026 09:38:3417min 56stest pipeline
RHEL9 - PyTest - 10.5RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:06:2638min 53stest pipeline
RHEL9 - PyTest - 10.11RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:18:5738min 29stest pipeline
RHEL9 - Unsubscribed host - PyTest - 10.11RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:06:1633min 49stest pipeline
RHEL8 - PyTest - 10.5RHEL-8.10.0-Nightlyx86_64✅ passed14.01.2026 09:20:3832min 9stest pipeline
RHEL9 - Unsubscribed host - PyTest - 10.5RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:18:4534min 14stest pipeline
RHEL8 - PyTest - 10.3RHEL-8.10.0-Nightlyx86_64✅ passed14.01.2026 09:06:5435min 23stest pipeline
RHEL10 - Unsubscribed host - PyTest - 10.11RHEL-10-Nightlyx86_64✅ passed23.01.2026 09:38:3217min 60stest pipeline
CentOS Stream 9 - PyTest - 10.5CentOS-Stream-9x86_64✅ passed14.01.2026 09:06:1613min 31stest pipeline
RHEL8 - PyTest - 10.11RHEL-8.10.0-Nightlyx86_64✅ passed14.01.2026 09:06:2535min 5stest pipeline
Fedora - 10.11Fedora-latestx86_64✅ passed14.01.2026 09:06:328min 29stest pipeline
Fedora - 11.8Fedora-latestx86_64✅ passed14.01.2026 09:06:238min 54stest pipeline
CentOS Stream 9 - 10.5CentOS-Stream-9x86_64✅ passed14.01.2026 09:06:1812min 26stest pipeline
CentOS Stream 9 - 10.11CentOS-Stream-9x86_64✅ passed14.01.2026 09:06:2711min 9stest pipeline
RHEL10 - Unsubscribed host - 10.11RHEL-10-Nightlyx86_64✅ passed23.01.2026 09:38:3316min 2stest pipeline
RHEL9 - Unsubscribed host - 10.11RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:19:1333min 21stest pipeline
RHEL9 - 10.11RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:17:3636min 14stest pipeline
RHEL9 - 10.5RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:16:5636min 18stest pipeline
CentOS Stream 10 - 10.11CentOS-Stream-10x86_64✅ passed14.01.2026 09:06:1811min 6stest pipeline
RHEL8 - 10.11RHEL-8.10.0-Nightlyx86_64✅ passed14.01.2026 09:06:3331min 30stest pipeline
RHEL8 - 10.3RHEL-8.10.0-Nightlyx86_64✅ passed14.01.2026 09:06:1632min 34stest pipeline
RHEL8 - 10.5RHEL-8.10.0-Nightlyx86_64✅ passed14.01.2026 09:06:1831min 21stest pipeline
RHEL10 - 10.11RHEL-10-Nightlyx86_64✅ passed23.01.2026 09:38:3214min 51stest pipeline
RHEL9 - Unsubscribed host - 10.5RHEL-9.6.0-Nightlyx86_64✅ passed14.01.2026 09:06:2634min 29stest pipeline

Lets' connect to proper DB including --disable certificates

Let's check if Slave is really  runnning before SQL command is called.

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

phracek commented Dec 5, 2025

[test-pytest]

Call sql commands at once.
Change initial names to understandable.
Use DatabaseWrapper directly to call sql commands.

Check mariadb configuration values together. Do not duplicate code.

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

phracek commented Dec 12, 2025

re-trigger tests after a hude refactoring.

[test][test-pytest]

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

phracek commented Dec 15, 2025

re-trigger tests after fixing issue on Fedora

[test][test-pytest]

and parametrized it.

It is easier to review code.

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

phracek commented Jan 9, 2026

[test][test-pytest]

@phracek
Copy link
Member Author

phracek commented Jan 12, 2026

@frenzymadness PTAL in case you have free time.

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.

This PR adds 1355 lines of code so it will take a while to review it. I'm submitting what I have so far so we can ping-pong small portions of it.

is defined in VARS variable directly

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Update also description for better reading what each test does
in case it is huge

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
if mariadb contains proper settings

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
The function is already part of container-ci-suite.

Add several documentation part to the tests

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

phracek commented Jan 14, 2026

@frenzymadness I have tryied to address all issues. As soon as you will have a spare time. Please look at this.

Next time, we can add each test by simple PR for better review.

It makes sense for me to PostgreSQL container.

@phracek
Copy link
Member Author

phracek commented Jan 14, 2026

[test-pytest][test]

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.

I've found some possible improvements, but nothing really serious, so do whatever you prefer with them and merge this PR then. Sorry it took me so long to do the review.

Comment on lines +190 to +197
@pytest.mark.parametrize(
"action",
[
"",
"analyze",
"optimize",
],
)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand how the different values here affect the containers. I see the test uses a different name for cid file but what is the real impact?

Comment on lines +51 to +80
def test_password_change(self, username, password, pwd_change):
"""
Test password change.
"""

self.password_change_test(
username=username,
password=password,
pwd_dir=pwd_dir_change,
pwd_change=pwd_change,
)

@pytest.mark.parametrize(
"username, password, user_change",
[
("user", "foo", False),
("user2", "bar", True),
],
)
def test_password_change_new_user_test(self, username, password, user_change):
"""
Test user change.
"""
self.password_change_test(
username=username,
password=password,
pwd_dir=user_dir_change,
user_change=user_change,
)

Copy link
Member

Choose a reason for hiding this comment

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

What is the benefit of having two tests with different parameters calling the same function with the same logic? Cannot we have one test with all parameters combined and full logic inside?

Comment on lines +92 to +97
1. Create a container with the given arguments
2. Check if the container is created successfully
3. Check if the database connection works
4. Check if the userchange, then user2 does exist in the database
5. Check if the password works
6. Check if the password does not work
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, but are those comments created by AI? I find very little value in them. The test is kinda complex and a comment like this does not help at all.


def test_plugin_installation(self):
"""
Test plugin installation.
Copy link
Member

Choose a reason for hiding this comment

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

Just an example of a useful comment for this test: "Test installs a plugin that stores error messages in a log file and then checks that the plugin works correctly".

Comment on lines +77 to +95
slave_found = False
for _ in range(3):
result = self.db_wrapper_api.run_sql_command(
container_ip=master_cip,
username="root",
password="root",
container_id=master_cid,
database=f"db {VARS.SSL_OPTION}",
sql_cmd="SHOW SLAVE HOSTS;",
podman_run_command="exec",
)
if not result:
sleep(3)
continue
if slave_cip in result:
slave_found = True
break
sleep(3)
assert slave_found
Copy link
Member

Choose a reason for hiding this comment

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

This can be simplified to something like:

for _ in range(3):
    result =if slave_cip in result:
        break
    sleep(3)
else:
    assert False, "Slave IP not found!"

If you break from for loop, the else block is ignored.

Comment on lines +107 to +108
"Slave_IO_Running:\\s*Yes",
"Slave_SQL_Running:\\s*Yes",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Slave_IO_Running:\\s*Yes",
"Slave_SQL_Running:\\s*Yes",
r"Slave_IO_Running:\s*Yes",
r"Slave_SQL_Running:\s*Yes",

Comment on lines +143 to +147
# sql_cmd = "select * from t1;"
# mysql_cmd = f'mysql -uroot <<< "{sql_cmd}"'
# table_output = PodmanCLIWrapper.call_podman_command(
# cmd=f"exec {slave_cid} bash -c '{mysql_cmd}'",
# )
Copy link
Member

Choose a reason for hiding this comment

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

Forgotten comment

Comment on lines +32 to +34
"""
Test SSL.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Another example - the comment is not very useful if it's a 1:1 copy of the name of the test function.

Comment on lines +105 to +106
assert not re.search("Running mysql_upgrade", output), (
"mysql_upgrade did not run"
Copy link
Member

Choose a reason for hiding this comment

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

Reversed logic: we expect NOT to find "Running mysql_upgrade", and if we find it, the error message should say something like: "Unexpected mysql_upgrade found".

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