Page MenuHomeSoftware Heritage

test: Make sure loader runs use tmp_path fixture
ClosedPublic

Authored by ardumont on Wed, Nov 10, 10:36 AM.

Details

Summary

Without this, tests are leaving leftovers in /tmp after running tests. This commit fixes
that by using tmp_path as root directory which is cleaned up afterwards by pytest.

Related to T3719

Test Plan

tox

Diff Detail

Repository
rDLDSVN Subversion (SVN) 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 D6632 (id=24102)

Could not rebase; Attempt merge onto e36caff0a4...

Updating e36caff..1adb571
Fast-forward
 swh/loader/svn/loader.py            | 146 +++++++++++++++++-------------------
 swh/loader/svn/svn.py               |  14 +++-
 swh/loader/svn/tasks.py             |   7 --
 swh/loader/svn/tests/test_loader.py | 100 ++++++++++++------------
 4 files changed, 132 insertions(+), 135 deletions(-)
Changes applied before test
commit 1adb57107dc46a00039cd068dbb6d04793475c83
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Nov 10 10:33:56 2021 +0100

    test: Make sure loader runs use tmp_path fixture
    
    Without this, tests are leaving leftovers in /tmp after running tests. This commit fixes
    that by using tmp_path as root directory which is cleaned up afterwards by pytest.
    
    Related to T3719

commit 9ddf7115b8e6bc3825bc5e931a23608226450fc6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Nov 9 18:18:00 2021 +0100

    Clean up loader, add types and update docstrings
    
    This also drops either no longer used or ineffective parameters from the loader to ease
    readability.
    
    Related to T3719

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

This revision is now accepted and ready to land.Wed, Nov 10, 11:15 AM

Add some other tests which were missing the fix

Build is green

Patch application report for D6632 (id=24104)

Could not rebase; Attempt merge onto e36caff0a4...

Updating e36caff..d06d3e9
Fast-forward
 swh/loader/svn/loader.py            | 146 +++++++++++++++++-------------------
 swh/loader/svn/svn.py               |  14 +++-
 swh/loader/svn/tasks.py             |   7 --
 swh/loader/svn/tests/test_loader.py | 100 ++++++++++++------------
 swh/loader/svn/tests/test_utils.py  |  16 ++--
 5 files changed, 143 insertions(+), 140 deletions(-)
Changes applied before test
commit d06d3e9c5a94a5de1cbcd8cc2cd3eaf35bef3b27
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Nov 10 10:33:56 2021 +0100

    test: Ensure tests use tmp_path fixture so it's cleaned up properly
    
    Without this, tests are leaving leftovers in /tmp after running tests. This commit fixes
    that by using tmp_path as root directory which is properly cleaned up when tests are
    done.
    
    Related to T3719

commit 9ddf7115b8e6bc3825bc5e931a23608226450fc6
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Nov 9 18:18:00 2021 +0100

    Clean up loader, add types and update docstrings
    
    This also drops either no longer used or ineffective parameters from the loader to ease
    readability.
    
    Related to T3719

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