Page MenuHomeSoftware Heritage

mercurial.loader: Refactor remaining tests to use pytest
ClosedPublic

Authored by ardumont on Jul 7 2020, 3:58 PM.

Details

Summary

This did not touch any tests data. This now loads the loader fully through
a pg-storage instance.

This stops using the BaseLoaderTest from swh.loader.core.

(coverage remained the same 82%)

Related to T2487

Test Plan

tox

Diff Detail

Repository
rDLDHG Mercurial 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 D3448 (id=12215)

Rebasing onto 2308eca5f5...

Current branch diff-target is up to date.
Changes applied before test
commit 9e3a4b31015c7767c588dfba7683ec4d30b0f856
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Jul 7 15:55:53 2020 +0200

    Refactor remaining tests to use pytest
    
    Related to T2487

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

  • Improve test docstring
  • Move assertions together
  • Add more checks
  • Drop obsolete call to origin_get (with type!)
ardumont added inline comments.
swh/loader/mercurial/tests/conftest.py
45

@vlorentz I forgot to update it in the prior diff [1] but see, it's here ;)

[1] D3440#inline-23794

swh/loader/mercurial/tests/test_loader.py
210

I don't recall exactly what exactly was the bug about but that's the scenario to ensure we don't fail on it again [1]

[1] https://www.mercurial-scm.org/wiki/TransplantExtension

Build is green

Patch application report for D3448 (id=12219)

Rebasing onto 2308eca5f5...

Current branch diff-target is up to date.
Changes applied before test
commit 56b3a8812c9e77a711cca1e8cca6426845fabba7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Jul 7 15:55:53 2020 +0200

    Refactor remaining tests to use pytest
    
    Related to T2487

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

anlambert added a subscriber: anlambert.

Looks good !

swh/loader/mercurial/tests/test_loader.py
210

Test context: T1729

This revision is now accepted and ready to land.Jul 7 2020, 4:26 PM
swh/loader/mercurial/tests/test_loader.py
210

Thank you, sir ;)

This revision was automatically updated to reflect the committed changes.