Page MenuHomeSoftware Heritage

test: Explicit that 2 visits without change ends up with no snapshot
ClosedPublic

Authored by ardumont on Sep 15 2021, 10:27 AM.

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 D6262 (id=22671)

Rebasing onto 9be124af21...

Current branch diff-target is up to date.
Changes applied before test
commit b0433072af5b6e0ae4077ef3ce1d30171f66fb0f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Sep 15 10:24:48 2021 +0200

    test: Explicit that 2 visits without change ends up with no snapshot

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

Explicit that the snapshot is null

olasd added inline comments.
swh/loader/mercurial/tests/test_from_disk.py
187–188

If there was no filtering whatsoever, we would expect the result of the second load to be exactly the same result as the first one (i.e. the same snapshot, with the exact same underlying objects).

In effect, the counters should not change between the first and the second load (except for one more OriginVisit).

The issue that I think you had pointed out, was that the final OriginVisitStatus of the second OriginVisit didn't get a snapshot entry. So you need to add a check for that.

Build is green

Patch application report for D6262 (id=22672)

Rebasing onto 9be124af21...

Current branch diff-target is up to date.
Changes applied before test
commit 139061bcc38bd5652a266b5eb0645a1492e7a5aa
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Sep 15 10:24:48 2021 +0200

    test: Explicit that 2 visits without change ends up with no snapshot

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

swh/loader/mercurial/tests/test_from_disk.py
187–188

Totally agreed! Thanks.

I've updated the diff to that effect.

It's a bit weird to accept a diff with an explicit reference to a bug. :P

I've suggested a tiny change.

swh/loader/mercurial/tests/test_from_disk.py
183–185
This revision is now accepted and ready to land.Sep 15 2021, 3:15 PM

Adapt according to suggestion

Build is green

Patch application report for D6262 (id=22714)

Rebasing onto 9be124af21...

Current branch diff-target is up to date.
Changes applied before test
commit bf39050051ec5c7b4c6cc7b4801079ea591cd549
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Wed Sep 15 10:24:48 2021 +0200

    test: Explicit that 2 visits without change ends up with no snapshot

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