Page MenuHomeSoftware Heritage

Move all celery-related fixtures to the swh.scheduler pytest plugin
ClosedPublic

Authored by olasd on Jul 8 2020, 6:00 PM.

Details

Summary

This allows us to reuse these fixtures in other modules without brittle
swh.scheduler.tests.conftest star imports.

Unfortunately, we can't really override pytest fixtures from one plugin to
another. We therefore reimplement the fixtures provided by celery, inlining the
static configuration and renaming them to our names in the process.

This also adds a backwards-compatibility import from pytest_plugin to conftest,
to allow old users of the conftest fixtures to keep working.

Test Plan

tox tests updated

Diff Detail

Repository
rDSCH Scheduling utilities
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 D3469 (id=12271)

Rebasing onto ce63e6afd0...

Current branch diff-target is up to date.
Changes applied before test
commit 7009c3bfc210dc28dde5fe22b9ba0ad4c86b0a0f
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Jul 8 17:55:07 2020 +0200

    Move all celery-related fixtures to the swh.scheduler pytest plugin
    
    This allows us to reuse these fixtures in other modules without brittle
    swh.scheduler.tests.conftest star imports.
    
    Unfortunately, we can't really override pytest fixtures from one plugin to
    another. We therefore reimplement the fixtures provided by celery, inlining the
    static configuration and renaming them to our names in the process.
    
    This also adds a backwards-compatibility import from pytest_plugin to conftest,
    to allow old users of the conftest fixtures to keep working.

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

douardda added a subscriber: douardda.

looks fine, as far as I can tell

This revision is now accepted and ready to land.Jul 8 2020, 6:15 PM