Page MenuHomeSoftware Heritage

tests: Refactor svn load from remote dump scenario
ClosedPublic

Authored by ardumont on Jul 3 2020, 12:39 PM.

Details

Summary

This actually fixes an issue with the snapshot which in some cases was not of
the right type. It got revealed by that scenario.

Related to T2462

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 D3408 (id=12085)

Could not rebase; Attempt merge onto 62973d8447...

Updating 62973d8..22176a5
Fast-forward
 swh/loader/svn/loader.py            |   7 +-
 swh/loader/svn/tests/test_loader.py | 391 +++++++++++++++---------------------
 2 files changed, 169 insertions(+), 229 deletions(-)
Changes applied before test
commit 22176a5ab67480bc0c562fd681360fa02f638314
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 3 12:32:50 2020 +0200

    tests: Refactor svn load from remote dump scenario
    
    This actually fix an issue with the snapshot which in some cases were not of
    the right type.
    
    Related to T2462

commit 1a6a52e3a096dbd7faab7bcef73a6a747d41f3d9
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 3 11:48:22 2020 +0200

    tests: Refactor repository with wrong symlinks scenario
    
    Related to T2462

commit 06a54b4701462ea9938b75790abecf42102252e2
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 3 11:35:27 2020 +0200

    tests: Refactor repository with symlinks scenario
    
    Related to T2462

commit da93e37b92a8038c0ea301fc67a7ddcf5823b97a
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 3 11:28:36 2020 +0200

    tests: Refactor repository with svn:externals property scenario
    
    Related to T2462

commit 6636006a6fda54dde5dd5d28255ca0628f8fdc73
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Jul 3 11:17:00 2020 +0200

    tests: Refactor mixed crlf lf scenario
    
    Related to T2462

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

anlambert added a subscriber: anlambert.
anlambert added inline comments.
swh/loader/svn/tests/test_loader.py
740–756

Can you clarify why you do that renaming ? I guess that because the origin has already has been loaded once and a new load will do nothing without that renaming.

This revision is now accepted and ready to land.Jul 3 2020, 1:29 PM
swh/loader/svn/tests/test_loader.py
740–756

Yes, so we match the eventful-eventful case in the original scenario.
Although, that's the case because the old scenario was using 2 in-memory storages (no shared state).

Here the state is now shared as we use a pg-storage instead.

I'm doing a last visit for the same origin repo-url in the end of the scenario to "demo" the uneventful case.
(Although that's unclear whether it works here and not in the dedicated test for it -> i'll have a look when i'm done refactoring all those scenarios [1]).

[1] Right now, i'm missing the case "repository has been modified after ingestion" which I deliberately kept for the end at it's an annoying one.