-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add tests for Ansible Verifier #367
Conversation
β¨ feat(molecule): add etcd health check test π fix(molecule): enable verifier in molecule config The molecule configuration file was updated to enable the verifier. A new group_vars file was added to set the default Postgres database name, user, and password. Tests were added to check if PostgreSQL is running, listening on the default port, and if the database exists. A test was added to check the replication status of PostgreSQL. Tests were added to check the status of Patroni and etcd. These tests will help ensure that the application is running correctly and that the infrastructure is properly configured.
Thank you for your contribution I think we should clarify the title of this PR |
I believe we are talking about additional tests here It is important to note that the necessary tests are performed in the main playbook here is an example: https://github.com/vitabaks/postgresql_cluster/blob/master/roles/patroni/tasks/main.yml#L836 You can find a lot of detailed checks in the code. |
maybe so "Add tests for Ansible Verifier" |
It's important to note that there are two scopes of testing in our process:
I believe that both types of tests are necessary. However, I could consider combining them and initiating them at the right time. This is what I anticipate with the collection format: I will have a 'healthcheck' playbook that can be launched at any time to check the health status of our infrastructure. This playbook will itself be triggered by molecule's verify. In summary, I differentiate between the tests performed during installation, which are an integral part of the installation process, and the verification tests performed at the end. To provide a bit more context, I plan to implement the 'side_effect' in the future. This process will aim to disrupt a part of the infrastructure (for example, by killing a master container) to then launch the verify and ensure everything is working correctly (i.e., the recovery is successful). This is just an example to highlight the importance of conducting tests after the convergence (installation) phase. https://github.com/confluentinc/cp-ansible/tree/7.4.0-post/molecule |
Co-authored-by: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com>
β¨ feat(verify.yml): include all tests and remove replica tests π fix(postgres.yml): use patroni_superuser_username and patroni_superuser_password instead of postgres_user and postgres_password π fix(postgres.yml): fix typo in task name The all.yml file was removed as it was no longer needed. The verify.yml file was updated to include all tests and remove replica tests. The postgres.yml file was updated to use patroni_superuser_username and patroni_superuser_password instead of postgres_user and postgres_password. A typo in the task name was also fixed.
The test to check if the databases exist is redundant as it is already being checked in the `molecule/default/converge.yml` playbook. Removing this test will reduce the time taken to run the tests and improve the overall performance of the test suite.
The indentation of the file path in the include_vars task was fixed to be consistent with the rest of the file.
Thank you for sharing your detailed testing approach. |
@ThomasSanson Let me know when you're done working on this PR. |
The database name was changed from postgres to template1 to avoid issues with the postgres database being used as a template database.
@vitabaks all done for me, this pull request is ready |
π feat(molecule): add Postgres and Patroni tests
β¨ feat(molecule): add etcd health check test
π fix(molecule): enable verifier in molecule config The molecule configuration file was updated to enable the verifier. A new group_vars file was added to set the default Postgres database name, user, and password. Tests were added to check if PostgreSQL is running, listening on the default port, and if the database exists. A test was added to check the replication status of PostgreSQL. Tests were added to check the status of Patroni and etcd. These tests will help ensure that the application is running correctly and that the infrastructure is properly configured.