refactor SingleDbTestFixture class to add generic db initialization
Closed
requested to merge generated-differential-D538-source into generated-differential-D538-target
Compare changes
This series of commits, along with their counterparts in swh-archiver, swh-indexer, swh-scheduler, swh-storage and swh-vault is the firt step for swh-storage#1265 (closed) (aka kill swh-storage-datatest).
we aim at removing the need for the swh-storage-testdata/dumps files in any test that reauire a pg database.
For this we build the required db based on sql files now shipped within the python package. This require several refactorings of SingleDbTestFixture.setUpClass and .add_db() methods:
We also add a small helper function to sort numerical file names, and provide a DB_DUMP_TYPES as a global variable to prepare the next commit in which a new cli tool 'swh-db-init' is added.
We also provide a new generic swh-db-init cli tool used to initialise a database for a given (swh) module, like:
swh-db-init storage
Related to swh-storage#1265 (closed).
swh-core tests should still run fine, but this breaks listed packages until other patches are applied.
Migrated from D538 (view on Phabricator)