Page MenuHomeSoftware Heritage

Expose a pytest_plugin module so other loaders can reuse for tests
ClosedPublic

Authored by ardumont on Jul 10 2020, 3:42 PM.

Details

Summary

This does not expose the pytest-plugin through the setuptools entry as this can
be problematic. Instead that relies on the specific modules (loader-*) declaring
they need the dependency in their root conftest.

As i'm heading there when i'm done with the check-snapshot improvments (and
tagging a new release).
Might as well prepare some cleanup as well.

Related to T2484

Test Plan

tox

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D3495 (id=12358)

Could not rebase; Attempt merge onto 72590f9980...

Updating 72590f9..47578a0
Fast-forward
 conftest.py                 | 51 +++++--------------------------------------
 pytest.ini                  |  2 --
 swh/loader/pytest_plugin.py | 53 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 48 deletions(-)
 create mode 100644 swh/loader/pytest_plugin.py
Changes applied before test
commit 47578a0e7ddf26c0e6d822d345f86fb9c38a17e4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:41:44 2020 +0200

    Expose a pytest_plugin module so other loaders can reuse for tests
    
    This does not expose the pytest-plugin through the setuptools entry as this can
    be problematic. Instead that relies on the speific modules (loader-*) needing
    it to declare that needed dependency in their root conftest.

commit 604352e710952db1fece8becfb757fb56a800ef8
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:30:35 2020 +0200

    pytest: Remove no longer needed pytest setup
    
    Both swh.scheduler and swh.storage stopped exporting this plugin automatically.

See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/138/ for more details.

Build is green

Patch application report for D3495 (id=12366)

Could not rebase; Attempt merge onto fe28c44349...

Updating fe28c44..e2658c8
Fast-forward
 conftest.py                 | 51 +++++--------------------------------------
 pytest.ini                  |  2 --
 swh/loader/pytest_plugin.py | 53 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 48 deletions(-)
 create mode 100644 swh/loader/pytest_plugin.py
Changes applied before test
commit e2658c8e3dfe5680e6552e5e08cee7413d48dc80
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:41:44 2020 +0200

    Expose a pytest_plugin module so other loaders can reuse for tests
    
    This does not expose the pytest-plugin through the setuptools entry as this can
    be problematic. Instead that relies on the speific modules (loader-*) needing
    it to declare that needed dependency in their root conftest.

commit 59bddb8446d072cea5b549853742d01027632a76
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:30:35 2020 +0200

    pytest: Remove no longer needed pytest setup
    
    Both swh.scheduler and swh.storage stopped exporting this plugin automatically.

See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/141/ for more details.

This revision is now accepted and ready to land.Jul 10 2020, 4:53 PM

Rebase (and rework commit message)

Build is green

Patch application report for D3495 (id=12377)

Could not rebase; Attempt merge onto fcc7e61bf9...

Updating fcc7e61..9f04d72
Fast-forward
 conftest.py                 | 51 +++++--------------------------------------
 pytest.ini                  |  2 --
 swh/__init__.py             |  7 +++++-
 swh/loader/__init__.py      |  7 +++++-
 swh/loader/pytest_plugin.py | 53 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+), 50 deletions(-)
 create mode 100644 swh/loader/pytest_plugin.py
Changes applied before test
commit 9f04d72516fcc22215fc62a08ab3a59103231440
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:41:44 2020 +0200

    Expose a pytest_plugin module so other loaders can reuse for tests
    
    This does not expose the pytest-plugin through the setuptools entry as this can
    be problematic. Instead that relies on the specific modules (loader-*)
    declaring they need that dependency in their root conftest.

commit 1f876c8eba8b3649324020abf8ff408e3b01ad06
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:30:35 2020 +0200

    pytest: Remove no longer needed pytest setup
    
    Both swh.scheduler and swh.storage stopped exporting this plugin automatically.

commit ae7e388823135b0288933d4d8291dfe1c3b6ad50
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 10 15:52:01 2020 +0200

    Explicit types in __init__ files

See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/148/ for more details.