Page MenuHomeSoftware Heritage

loader.svn: Start tests refactoring with pytest
ClosedPublic

Authored by ardumont on Jul 2 2020, 7:21 PM.

Details

Summary

This starts to align the existing svn tests with the core/package ones. For
now, utilities functions are in this repository close to the tests. They will
most possibly be refactored out in swh-loader-core at some point.

Related to T2462

Test Plan

tox

Event Timeline

Build is green

Patch application report for D3397 (id=12047)

Rebasing onto ee23fd7582...

Current branch diff-target is up to date.
Changes applied before test
commit 9394be5c0af0d837a197c91ea11050ef1fcafee2
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 2 19:19:13 2020 +0200

    Start tests refactoring with pytest
    
    This starts to align the existing svn tests with the core/package ones. For
    now, utilities functions are in this repository close to the tests. They will
    most possibly be refactored out in swh-loader-core at some point.
    
    Related to T2462

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

swh/loader/svn/tests/test_loader.py
13

Maybe those need to move to swh.loader.tests.common instead now...

189

That's coming from [1] which I intend more or less to rewrite slowly and when we need to.
At some point, that should go back in swh-loader-core.

[1] https://forge.softwareheritage.org/source/swh-loader-core/browse/master/swh/loader/core/tests/__init__.py$207-227

Build is green

Patch application report for D3397 (id=12051)

Rebasing onto ee23fd7582...

Current branch diff-target is up to date.
Changes applied before test
commit 5d770ec3934b84413b13b63a19443592832c8e0a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 2 19:19:13 2020 +0200

    Start tests with pytest refactoring: Add scenario for 1 visit
    
    This starts to align the existing svn tests with the core/package ones. For
    now, utilities functions are in this repository close to the tests. They will
    most possibly be refactored out in swh-loader-core at some point.
    
    Related to T2462

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

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/loader/svn/tests/conftest.py
61

Could you explain why this is needed?

This revision is now accepted and ready to land.Jul 3 2020, 9:46 AM
swh/loader/svn/tests/conftest.py
61

in comment or in here?

datadir targets by default a "data" folder within the tests folder.
In that repository it's named "resources" so we need the override to be able to use it in here.

I intend this to be "data" when i'm done refactoring ;)
So I did not bother much in the docstring.

swh/loader/svn/tests/conftest.py
61

Either.

But why not rename it now?

swh/loader/svn/tests/conftest.py
61

Because that will touch other parts of the code as well.
And i'm trying to keep diff tidy for you all reviewers to not get lost in a gazillion lines of unnecessary diffs.

Build is green

Patch application report for D3397 (id=12060)

Rebasing onto ee23fd7582...

Current branch diff-target is up to date.
Changes applied before test
commit 5c46affea65d6fb9a922d4f6ff0ab8920e121db8
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Jul 2 19:19:13 2020 +0200

    Start tests with pytest refactoring: Add scenario for 1 visit
    
    This starts to align the existing svn tests with the core/package ones. For
    now, utilities functions are in this repository close to the tests. They will
    most possibly be refactored out in swh-loader-core at some point.
    
    Related to T2462

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