Skip to content

Integration Tests

Amir Malka edited this page Feb 7, 2024 · 1 revision

We rely on testcontainers to deploy external dependencies inside Docker containers:

flowchart LR
    subgraph K3s
    ETCD
    end
    ETCD---SynchronizerIC
    SynchronizerIC---SynchronizerBE
    subgraph Pulsar
    pulsar
    end
    SynchronizerBE---pulsar
    pulsar---Ingester
    subgraph postgres
    Postgres
    end
    S3Mock
    Ingester---Postgres
    Ingester---S3Mock
Loading

Happy Paths

Test Case Description Expected Result
TC-01 Initial synchronization of a single entity Synchronizer successfully synchronizes the entity from the source to the target system.
TC-01B Initial synchronization of an existing entity Synchronizer successfully synchronizes the entity from the source to the target system.
TC-02 Delta synchronization of a single entity Synchronizer successfully applies delta changes to the entity from the source to the target system.
TC-03 Conflict resolution for a single entity Synchronizer successfully resolves a conflict between the source and target systems for a single entity.
TC-04 Deletion of a single entity Synchronizer successfully deletes the entity from the source to the target system.
TC-05 Synchronizing entities with different types Synchronizer successfully synchronizes entities of different types.

The same test cases must be run from both ends, first cluster -> backend, but also backend -> cluster.

Failure Scenarios

Test Case Description Expected Result
TC-06 Invalid source data A patch is sent based on the wrong reference object, causing an invalid patch operation and a full object retrieval.
TC-07 Invalid target data Destination object in S3 differs from the checksum in postgres, causing an invalid save operation and a full object retrieval.
TC-08 Communication failure with the backend Synchronizer IC retries the connection request until it succeeds or a crashloop backoff occurs.
TC-09 Communication failure with pulsar Synchronizer BE attempts to resolve the connection issue and retry the event publication.
TC-10 Communication failure with postgres Ingester attempts to resolve the connection issue and retry the DB insertion (must be transactional with S3).
TC-11 Communication failure with S3 Ingester attempts to resolve the connection issue and retry the Object write (must be transactional with postgres).
TC-12 Inconsistencies between BE & Cluster Object which exists in the k8s cluster is missing in postgres (and vice versa - an object exists in postgres but the k8s cluster does not contain this object). We produce a reconciliation flow with the objects which exist in the BE and expect the cluster to send Put/Delete for mismatch resource version or missing objects.
Clone this wiki locally