gchq / sleeper

A cloud-native, serverless, scalable, cheap key-value store
Apache License 2.0
62 stars 9 forks source link

Remove test duplication between IngestJobRunnerIT and IngestCoordinatorCommonIT #2793

Closed patchwork01 closed 3 months ago

patchwork01 commented 3 months ago

Background

Split from:

We noticed duplication of tests between IngestJobRunnerIT and IngestCoordinatorCommonIT. The tests for the job runner are parameterised in the same way as the ingest coordinator tests, except that they're configured with instance and table properties.

Description

We'd like to avoid testing the integration between the different configuration options for the ingest coordinator in more than one place.

The combinations of the parameterised configuration do need to be tested together, but the integration can just be tested once. We can have other tests just pick one set of configuration to use.

Analysis

We can analyse the differences between IngestJobRunnerIT and IngestCoordinatorCommonIT. Anything that tests the combination of configuration options can be moved to IngestCoordinatorCommonIT. We can also convert IngestCoordinatorCommonIT to use instance and table properties, rather than calling the IngestCoordinator builder directly. We could make it use IngestFactory.

Once IngestJobRunnerIT is just testing the concerns of the job runner, that should make it much easier to unify with the task runner tests if we want to, as in https://github.com/gchq/sleeper/issues/2713.