Page MenuHomeSoftware Heritage

Add a test for the build_isochrone_graph() function
AbandonedPublic

Authored by douardda on May 25 2021, 10:15 AM.

Details

Reviewers
aeviso
Group Reviewers
Reviewers
Summary

this test is far from ideal, since it's mostly the record of what happen
during a "known good" session of revision insertions, but at least it
should allow to refactor code related to the isochrone graph computation
with a bit more confidence...

Depends on D5771

Event Timeline

Build is green

Patch application report for D5772 (id=20637)

Could not rebase; Attempt merge onto b2ddef88eb...

Updating b2ddef8..235cb4a
Fast-forward
 swh/provenance/provenance.py               | 14 ++---
 swh/provenance/tests/test_provenance_db.py | 96 +++++++++++++++++++++++++++++-
 2 files changed, 101 insertions(+), 9 deletions(-)
Changes applied before test
commit 235cb4ade51da82b36c9bfeae9c7415681ec4b1b
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed May 12 10:30:23 2021 +0200

    Add a test for the build_isochrone_graph() function
    
    this test is far from ideal, since it's mostly the record of what happen
    during a "known good" session of revision insertions, but at least it
    should allow to refactor code related to the isochrone graph computation
    with a bit more confidence...

commit 6ae8de468d94ab3398016add37747a13e43e8cac
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue May 11 15:33:57 2021 +0200

    Replace the 'dates' argument of IsochroneNode() by a simple 'date' one
    
    there is no need for passing a dict here, we only care about the date
    for the node being instanciated.

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

Build is green

Patch application report for D5772 (id=20670)

Could not rebase; Attempt merge onto 77fce4e59d...

Updating 77fce4e..edff905
Fast-forward
 swh/provenance/provenance.py               | 26 ++++----
 swh/provenance/tests/test_provenance_db.py | 96 +++++++++++++++++++++++++++++-
 2 files changed, 110 insertions(+), 12 deletions(-)
Changes applied before test
commit edff905d0df269cb90246ef77b554b1ca58cbeef
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed May 12 10:30:23 2021 +0200

    Add a test for the build_isochrone_graph() function
    
    this test is far from ideal, since it's mostly the record of what happen
    during a "known good" session of revision insertions, but at least it
    should allow to refactor code related to the isochrone graph computation
    with a bit more confidence...

commit 113e11031aa5365a9244409a0cfe646061cb94f9
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue May 11 15:33:57 2021 +0200

    Replace the 'dates' argument of IsochroneNode() by a simple 'date' one
    
    there is no need for passing a dict here, we only care about the date
    for the node being instanciated.

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

aeviso requested changes to this revision.May 28 2021, 2:54 PM

Not sure if I follow what the test is doing since it not clear to me what's the content of storage_and_CMDBTS, but as far as I understand this is only testing that the id and maxdate of the root node matches with what's "expected". What about the rest of the graph? The topology of the full structure should be considered (assuming we know that's storage_and_CMDBTS and how provenace was populated).

This revision now requires changes to proceed.May 28 2021, 2:54 PM

Not sure if I follow what the test is doing since it not clear to me what's the content of storage_and_CMDBTS,

storage_and_CMDBTS is a pytest fixture returning a storage populated from the CMDBTS git repo. It has been introduced in rev 15e390fb66c990aba8b9454f675f716f1e1e579b

but as far as I understand this is only testing that the id and maxdate of the root node matches with what's "expected". What about the rest of the graph?

This test only test that the isochrone graph computation does what it used to do, so one can think about refactoring the code involved with some confidence. Let me quote the git commit message coming with this:

this test is far from ideal, since it's mostly the record of what happen
during a "known good" session of revision insertions, but at least it
should allow to refactor code related to the isochrone graph computation
with a bit more confidence...

so yes, it's not complete/ideal, but better than no test at all for now...

The topology of the full structure should be considered (assuming we know that's storage_and_CMDBTS and how provenace was populated).

Yes we know, it's documented in the code and has been introduced in revision previously mentioned.

Build is green

Patch application report for D5772 (id=20733)

Rebasing onto 5aa0314dd7...

Current branch diff-target is up to date.
Changes applied before test
commit defcb388ffba0869edb1a126b6626710c396c2ac
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed May 12 10:30:23 2021 +0200

    Add a test for the build_isochrone_graph() function
    
    this test is far from ideal, since it's mostly the record of what happen
    during a "known good" session of revision insertions, but at least it
    should allow to refactor code related to the isochrone graph computation
    with a bit more confidence...

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

Build is green

Patch application report for D5772 (id=20764)

Rebasing onto 49e47c3ea7...

Current branch diff-target is up to date.
Changes applied before test
commit cb623cb0e7dd9a2a568b6d2645e89c4d86ba0a66
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed May 12 10:30:23 2021 +0200

    Add a test for the build_isochrone_graph() function
    
    this test is far from ideal, since it's mostly the record of what happen
    during a "known good" session of revision insertions, but at least it
    should allow to refactor code related to the isochrone graph computation
    with a bit more confidence...

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

probably useless now with D5805 coming along.