Skip to content

pytest_plugin: Rework scaffolding of swh_storage fixture

Following of discussion from !1152 (merged)

To prevent other swh packages to override the swh_storage_backend_config with a wrapped storage configuration, who does not necessarily support the same interfaces as a real storage backend, rework the scaffolding of swh_storage fixture the following way:

  • add check in swh_storage_backend fixture to ensure a not wrapped storage will be instantiated

  • add a swh_storage_pipeline_steps fixture to define the configuration for a pipeline of storage wrappers

  • add a swh_storage_config fixture generating serializable storage configuration from the swh_storage_backend_config fixture and swh_storage_pipeline_steps

  • modify swh_storage fixture to instantiate a wrapped storage from the steps defined by swh_storage_pipeline_steps and the backend storage instantiated by the swh_storage_backend fixture

This will break tests in most swh packages using the swh_storage fixture but this will simplify storage configuration in those tests once migrated to the new fixtures.

Edited by Antoine Lambert

Merge request reports

Loading