Page MenuHomeSoftware Heritage

Add minimal test coverage for swh.storage.schemata
ClosedPublic

Authored by olasd on Nov 12 2019, 7:56 PM.

Details

Summary

Adds a sqlalchemy test fixture on top of pytest_postgresql, as well as
a regression test for D2263.

Depends on D2263.

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8973
Build 13113: tox-on-jenkinsJenkins
Build 13112: arc lint + arc unit

Event Timeline

Add missing .[schemata] dependency on py3-slow environment

anlambert added a subscriber: anlambert.

pytest fixtures declaration should be simplified.

Otherwise, this feels weird to have database declarations only related to the debian lister/loader in swh-storage.
Maybe this could be moved in swh-lister or swh-loader-debian ?

swh/storage/tests/schemata/conftest.py
11

Using @pytest.fixture is sufficient here (see pytest doc)

swh/storage/tests/schemata/test_distribution.py
12

same here

This revision now requires changes to proceed.Nov 13 2019, 11:12 AM

Otherwise, this feels weird to have database declarations only related to the debian lister/loader in swh-storage.
Maybe this could be moved in swh-lister or swh-loader-debian ?

Both the lister and loader use these models; It made sense, at the time it was introduced, to put this functionality in a swh.storage subpackage, rather than introduce a dependency between lister and loader.

Use @pytest.fixture instead of yield_fixture

This revision is now accepted and ready to land.Nov 13 2019, 1:10 PM

Otherwise, this feels weird to have database declarations only related to the debian lister/loader in swh-storage.
Maybe this could be moved in swh-lister or swh-loader-debian ?

For info, it's already been moved to swh-lister (see swh.lister.debian.models which is almost the same as schemata, almost because it got slightly adapted since).
As i am currently deploying the latest lister-debian and the new debian-loader... I waited for this to be deployed and running in production prior to remove it from swh.storage (the old debian-loader still depends on this even if it's not really running).
I'll do migrate those tests as well in due time.

Cheers,

Otherwise, this feels weird to have database declarations only related to the debian lister/loader in swh-storage.
Maybe this could be moved in swh-lister or swh-loader-debian ?

For info, it's already been moved to swh-lister (see swh.lister.debian.models which is almost the same as schemata, almost because it got slightly adapted since).
As i am currently deploying the latest lister-debian and the new debian-loader... I waited for this to be deployed and running in production prior to remove it from swh.storage (the old debian-loader still depends on this even if it's not really running).
I'll do migrate those tests as well in due time.

done in D2273 btw