Page MenuHomeSoftware Heritage

pytest_plugin: Avoid fixture client to declare optional dependency
ClosedPublic

Authored by ardumont on Jul 16 2020, 9:36 AM.

Details

Summary

Before this commit, this would make swh_storage_backend_config fixture clients
require to declare an optional dependency on swh.journal. Otherwise, it would not
build [1].

This commit fixes it by dropping this configuration in the main pytest plugin.
It keeps the storage tests testing with that journal_writer collaborator though (as initially)
by declaring an override which still provides it.

This fixes the debian build [1]

[1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DLDBASE/job/gbp-buildpackage/152/console

This replaces D3514 by fixing the problem at the source. D3514 took the path to
change the configuration within the clients. This is not sustainable as this
would require other fixture clients to do the same.

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
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 D3515 (id=12425)

Rebasing onto f5811da184...

Current branch diff-target is up to date.
Changes applied before test
commit 8bc79443eda76975df65fa302184ce1a1fc62b11
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 16 09:33:00 2020 +0200

    pytest_plugin: Avoid fixture client to declare optional dependency
    
    Prior to this commit, this would make swh_storage_backend_config fixture clients
    need to declare an optional dependency on swh.journal. Otherwise, it would not
    work [1].
    
    This commit fixes it by dropping this configuration in the main pytest plugin.
    It keeps the storage tests testing with that journal_writer collaborator though
    by declaring an override which still provides it.
    
    This fixes the debian build [1]
    
    [1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DLDBASE/job/gbp-buildpackage/152/console

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

This revision is now accepted and ready to land.Jul 16 2020, 10:42 AM
douardda added a subscriber: douardda.

ok, but should check whether some other packages that uses this pytest plugin can be impacted.

ok, but should check whether some other packages that uses this pytest plugin can be impacted.

Well, they should be impacted but in the right way ;)
They should no longer break (as in [1])