self = <swh.storage.tests.test_postgresql_migration.TestPgStorageMigration object at 0x7fd3c88619e8>
storage = <swh.storage.postgresql.storage.Storage object at 0x7fd3b977ba90>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7fd3ace19cc0>
migrate_after_insert = True
@pytest.mark.parametrize("migrate_after_insert", (True, False))
def test_directory(self, storage, sample_data, migrate_after_insert):
swh_storage = storage
if migrate_after_insert:
swh_storage.directory_add(sample_data.directories)
swh_storage.content_add(sample_data.contents)
with swh_storage.db() as db:
> self._migrate(db)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_postgresql_migration.py:130:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.tests.test_postgresql_migration.TestPgStorageMigration object at 0x7fd3c88619e8>
db = <swh.storage.postgresql.db.Db object at 0x7fd3ace19978>
def _migrate(self, db):
current_version = db.dbversion()["version"]
filenames = sorted(
glob.glob(os.path.join(DIR, "../../../sql/upgrades/*.sql")), key=sortkey,
)
nb_migrations = 0
for filename in filenames:
(version_str, ext) = os.path.splitext(os.path.basename(filename))
assert ext == ".sql"
version = int(version_str)
if version <= current_version:
# this migration file is older than the current schema version
assert nb_migrations == 0
continue
nb_migrations += 1
psql_run_file(db.conn.dsn, filename)
> assert nb_migrations, "no migrations applied"
E AssertionError: no migrations applied
E assert 0
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_postgresql_migration.py:85: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Mar 4 2021, 4:11 PM