Page MenuHomeSoftware Heritage

package.loader: Migrate away from SWHConfig mixin
ClosedPublic

Authored by ardumont on Oct 2 2020, 10:00 AM.

Details

Summary

Impact is already dealt with within that diff (all package loaders are defined in the same repository).

Related to T1532 T1410 D3965

Test Plan

tox
(failing until swh.core > 0.3.1, including D3965, is released)

Diff Detail

Event Timeline

Build has FAILED

Patch application report for D4125 (id=14528)

Could not rebase; Attempt merge onto d5f9a4574d...

Updating d5f9a45..28b1519
Fast-forward
 swh/loader/core/loader.py                  | 28 +++++------
 swh/loader/core/tests/test_loader.py       | 74 +++++++++++++-----------------
 swh/loader/package/loader.py               | 16 ++++---
 swh/loader/package/pypi/tests/test_pypi.py | 22 +++++++--
 4 files changed, 71 insertions(+), 69 deletions(-)
Changes applied before test
commit 28b15195b1981b0f9a563c2be06477bb87258171
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 2 10:00:30 2020 +0200

    package.loader: Migrate away from SWHConfig mixin
    
    Related to T1532
    Related to T1410
    Related to D3965

commit d7f117424a3659f55cc61a965076212d98caa02a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 2 09:47:34 2020 +0200

    core.loader: Migrate away from SWHConfig mixin
    
    Related to T1532
    Related to T1410
    Related to D3965

Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/312/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/312/console

vlorentz added inline comments.
swh/loader/package/pypi/tests/test_pypi.py
149–150

where is this error raised?

the test should check it contains the variable's name, otherwise it's hard to debug it.

swh/loader/package/pypi/tests/test_pypi.py
149–150

yeah, i'm unsure about adding this test.
It's redundant but it was the original one so...

To answer, it's raised from within the load_from_envvar call [1]
Furthermore, It's a generic case for all package loaders... but i don't really know if i need to replicate this for all loaders or if just this one is enough...

[1] check D3965 again, it's there, you validated it a while back ;)

swh/loader/package/pypi/tests/test_pypi.py
149–150

I'll try to move it in the package loader tests (one level up) instead.
And i'll adapt with what you said about the env variable name missing.

thanks.

  • Rebase
  • adapt according to exchange

Build has FAILED

Patch application report for D4125 (id=14547)

Could not rebase; Attempt merge onto d5f9a4574d...

Updating d5f9a45..5e4fd64
Fast-forward
 swh/loader/core/loader.py                  | 33 +++++++------------
 swh/loader/core/tests/test_loader.py       | 52 +++++++-----------------------
 swh/loader/package/loader.py               | 16 +++++----
 swh/loader/package/pypi/tests/test_pypi.py | 17 +++++++---
 swh/loader/package/tests/test_loader.py    | 19 +++++++++++
 5 files changed, 63 insertions(+), 74 deletions(-)
Changes applied before test
commit 5e4fd64d106100b2da115d421baa869eab5f9c39
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 2 10:00:30 2020 +0200

    package.loader: Migrate away from SWHConfig mixin
    
    Related to T1532
    Related to T1410
    Related to D3965

commit b81bcf4b4c40dc6139aa46a75e2df42539980a90
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 2 09:47:34 2020 +0200

    core.loader: Migrate away from SWHConfig mixin
    
    Related to T1532
    Related to T1410
    Related to D3965

Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/314/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/314/console

ardumont added inline comments.
swh/loader/package/pypi/tests/test_pypi.py
149–150

moved in test_loader.py below.

done!

Build is green

Patch application report for D4125 (id=14547)

Could not rebase; Attempt merge onto d5f9a4574d...

Updating d5f9a45..5e4fd64
Fast-forward
 swh/loader/core/loader.py                  | 33 +++++++------------
 swh/loader/core/tests/test_loader.py       | 52 +++++++-----------------------
 swh/loader/package/loader.py               | 16 +++++----
 swh/loader/package/pypi/tests/test_pypi.py | 17 +++++++---
 swh/loader/package/tests/test_loader.py    | 19 +++++++++++
 5 files changed, 63 insertions(+), 74 deletions(-)
Changes applied before test
commit 5e4fd64d106100b2da115d421baa869eab5f9c39
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 2 10:00:30 2020 +0200

    package.loader: Migrate away from SWHConfig mixin
    
    Related to T1532
    Related to T1410
    Related to D3965

commit b81bcf4b4c40dc6139aa46a75e2df42539980a90
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Oct 2 09:47:34 2020 +0200

    core.loader: Migrate away from SWHConfig mixin
    
    Related to T1532
    Related to T1410
    Related to D3965

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

This revision is now accepted and ready to land.Oct 2 2020, 12:36 PM