Page MenuHomeSoftware Heritage

Refactor DVCS loader tests to actually run the DVCSLoader store_data method
ClosedPublic

Authored by olasd on May 29 2020, 3:01 PM.

Details

Summary

This will allow us to run integration tests on the behavior of that method. This
also caught a tiny bug in the store_data method.

Test Plan

tox

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz added a subscriber: vlorentz.

this should be two commits, though

This revision is now accepted and ready to land.May 29 2020, 3:02 PM

Build is green

Patch application report for D3200 (id=11357)

Could not rebase; Attempt merge onto faa138226d...

Updating faa1382..6fdb065
Fast-forward
 swh/loader/core/loader.py            |  2 +-
 swh/loader/core/tests/test_loader.py | 37 ++++++++++++++++++++++++++----------
 2 files changed, 28 insertions(+), 11 deletions(-)
Changes applied before test
commit 6fdb065fc767d656430904dcd3581cedee19f35c
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri May 29 14:36:41 2020 +0200

    Refactor DVCS loader tests to actually run the DVCSLoader store_data method
    
    This will allow us to run integration tests on the behavior of that method. This
    also caught a tiny bug in the store_data method.

commit 326bc17070e637ceb1f35ecac37a95188d225341
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri May 29 14:55:00 2020 +0200

    Make the test_loader origin a global variable to be able to reuse it later

commit cf98b1cb9b990966513551556caba34feff0561b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri May 29 14:55:30 2020 +0200

    Drop useless fs mark on test that does not use any test fixtures

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

this should be two commits, though

If I split this in two commits, then either the first commit changes the tests (and is red), or the first commit changes the function (and it's not tested). So I'd rather keep the commit as a whole.