vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 411 forks source link

Add the Molecule tests for the Type C schema (Consul) #375

Closed vitabaks closed 11 months ago

vitabaks commented 1 year ago

Issue Description:

As part of our ongoing commitment to code quality and robust testing, we've identified the need to implement Molecule tests for the Type C schema, specifically for Consul. Currently, this component lacks the appropriate Molecule tests which are crucial in ensuring its functionality and reliability.

Proposed Solution:

The goal is to add Molecule tests for the Consul cluster of the (Type C schema). These tests will assess the functionality of the Consul component and ensure that it works as expected within the larger schema. This would greatly enhance your confidence in the stability of the system and its resilience to various edge cases.

Benefits:

Implementing these tests will:

  1. Increase the robustness of our testing suite.
  2. Enhance the reliability of the Type C schema.
  3. Help identify and potential bugs or issues.

We welcome any contributions or thoughts on how best to approach this. Thank you for considering this request.

ThomasSanson commented 1 year ago

Hello @vitabaks,

I agree with the importance of implementing Molecule tests for the Type C schema, specifically for Consul. This is crucial for ensuring the functionality and reliability of this component.

However, I wanted to suggest a slightly different approach for implementing these tests. Could we consider using the matrix option of Github Actions per Molecule scenario? This way, we could test all necessary OS versions per scenario. You can find more information about this in the Github documentation.

An alternative would be to directly mix the different OS in Molecule platforms, although I'm less keen on this approach.

In any case, this will have a significant impact on the CI, but I don't think we have many options.

Finally, a future solution could be to split the building blocks (HA Proxy, Consul, Postgres, Keepalive, etc.) into different projects and to keep this one as the central one thanks to collections.

What do you think?

vitabaks commented 1 year ago

No, I don't think it's necessary to separate cluster components. It is necessary to test the entire cluster scheme (including these components).

thanks for the comments and any ideas.

I will take on this task.

ThomasSanson commented 1 year ago

@vitabaks

I suggest that we switch to Collection mode initially (work in progress with @pa-decarvalho), and from there, we will have a folder organization and thus a more "clean" structure to delve into various testing scenarios and refactoring.

vitabaks commented 11 months ago

Done https://github.com/vitabaks/postgresql_cluster/pull/511