Page MenuHomeSoftware Heritage

Make swh-journal tests not depend on swh-model any more
Closed, MigratedEdits Locked

Description

Currently, swh-journal actually depends on swh-model only for the definition of KeyType, really.
The model objects (BaseModel subclasses), are uses as an easy way to create dataset for the tests consisting in actual model objects.
However nowadays, the journal writer depends on the ValueProtocol only.

This dependency on swh-model and on the actual model declared in swh.model.model is a burden because any modification in this model will (probably) break tests in swh-journal for no good reason.

The real dependency link we want to break is this later one, but then the only remaining dependency of swh-journal to swh-model is the definition of KeyType. I'd rather live with this definition duplicated in swh-journal than having a dependency.

Event Timeline

douardda triaged this task as Normal priority.Jan 13 2021, 4:48 PM
douardda created this task.

Back on this, the plan is now to make swh-journal not depend on the actual model definition, which is currently mostly due to the presence of the journal_data.py in swh-journal. So the plan is to move this file in swh-model so it's kept up to date with swh-model, even if it's mostly used for testing other packages (like swh-journal).

So keeping the dependency on swh-model in swh-journal's tests, but move the "problematic" parts in swh-model. Doing so we should not have too many "when a butterfly moves a wing in swh-model it breaks swh-journal" kind of coupling problem.

It may still happen but I expect much less often.

douardda claimed this task.

Let's consider it as done.