End-to-End Tests

CloudNativePG is automatically tested after each commit via a suite of End-to-end(E2E)tests , which ensures that the operator correctly deploys and manages PostgreSQL clusters.

Moreover, the following Kubernetes versions are tested for each commit, helping detect bugs at an early stage of the development process:

  • 1.27

  • 1.26

  • 1.25

  • 1.24

  • 1.23

The following PostgreSQL versions are tested:

  • PostgreSQL 15

  • PostgreSQL 14

  • PostgreSQL 13

  • PostgreSQL 12

  • PostgreSQL 11

For each tested version of Kubernetes and PostgreSQL, a Kubernetes cluster is created using Kind , and the following suite of E2E tests are performed on that cluster:

  • Basic: Installationoftheoperator; Creation of a Cluster; * Usage of a persistent volume for data storage;

  • Serviceconnectivity: Connectionviaservices,includingread-only; Connection via user-provided server and/or client certificates; * PgBouncer;

  • Self-healing: Failover; Switchover; Primaryendpointswitchincaseoffailoverinlessthan10seconds; Primary endpoint switch in case of switchover in less than 20 seconds; Recoverfromadegradedstateinlessthan60seconds; PVC Deletion;

  • BackupandRestore: BackupandScheduledBackupsexecutionusingBarmanCloudonS3; Backup and ScheduledBackups execution using Barman Cloud on Azure blob storage; RestorefrombackupusingBarmanCloudonS3; Restore from backup using Barman Cloud on Azure blob storage; * Wal-Restore;

  • Operator: OperatorDeployment; Operator configuration via ConfigMap; Operatorpoddeletion; Operator pod eviction; Operatorupgrade; Operator High Availability;

  • Observability: Metricscollection; PgBouncer Metrics; * JSON log format;

  • Replication: Physicalreplicaclusters; Replication Slots; Synchronousreplication; Scale-up and scale-down of a Cluster;

  • Plugin: ClusterHibernationusingCNPGplugin; Fencing; * Creation of a connection certificate;

  • PostgresConfiguration: ManagePostgreSQLconfigurationchanges; Rolling updates when changing PostgreSQL images;

  • PodScheduling: Tolerationsandtaints; Pod affinity using NodeSelector ;

  • ClusterMetadata: ConfigMapforClusterLabelsandAnnotations; Object metadata;

  • Recovery: Datacorruption; pg_basebackup;

  • ImportingDatabases: Microserviceapproach; Monolith approach;

  • Storage: * Storage expansion;

  • Security: * AppArmor annotation propagation. Executed only on Azure environment;

  • Maintenance: * Node Drain;