Page MenuHomeSoftware Heritage

Add a blacklist_types argument to object_dicsts() and objects() hypothesis generators
ClosedPublic

Authored by douardda on Apr 21 2020, 11:37 AM.

Details

Summary

so one can choose not to generate some of the object types.

Diff Detail

Event Timeline

Build is green

Patch application report for D3037 (id=10788)

Rebasing onto bfba3bdda5...

Current branch diff-target is up to date.
Changes applied before test
commit d66f0c39265a0b91de3e5e370cc5c5328a6654f7
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Apr 21 11:33:32 2020 +0200

    Add a blacklist_types argument to object_dicsts() and objects() hypothesis generators
    
    so one can choose not to generate some of the object types.

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

ardumont added a subscriber: ardumont.

As mentioned in irc, you could add origin_visit_status as defaults in the black list parameters.
Since we are in a transition phase for that part.

The diff about those should then be adapted and force the blacklist_type parameter to be the empty tuple.

This revision is now accepted and ready to land.Apr 21 2020, 12:01 PM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/model/tests/test_hypothesis_strategies.py
24–26

You should make this a list of object_dicts to make the test more relevant.

By default, it might only try a couple of objects.

66–68

same

This revision now requires changes to proceed.Apr 21 2020, 12:12 PM
douardda removed a reviewer: vlorentz.
douardda removed a subscriber: vlorentz.

Set the default value for blacklist_types to ("origin_visit_status",)

to make it not break dependency packages.

Build is green

Patch application report for D3037 (id=10791)

Rebasing onto bfba3bdda5...

Current branch diff-target is up to date.
Changes applied before test
commit d3a7f314eddfb2ee2b3b6bcf86a5eb94b8f8cf9f
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Apr 21 11:33:32 2020 +0200

    Add a blacklist_types argument to object_dicsts() and objects() hypothesis generators
    
    so one can choose not to generate some of the object types.
    
    Blacklist "origin_visit_status" by default to prevent breaking dependent
    packages' tests.

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

swh/model/tests/test_hypothesis_strategies.py
24–26

According to my runs, it does at least try one of each types, then the number for each type seems to depend on the strategy used for this type.

Each test execution tries 100 objects.

So I'm not sure what a list would really add there.

Build is green

Patch application report for D3037 (id=10798)

Rebasing onto bfba3bdda5...

Current branch diff-target is up to date.
Changes applied before test
commit 36b7a1afbf0dbf0a8c3f6d1a14b7961099375570
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Apr 21 11:33:32 2020 +0200

    Add a blacklist_types argument to object_dicts() and objects() hypothesis strategies
    
    so one can choose not to generate some of the object types.
    
    Blacklist "origin_visit_status" by default to prevent breaking dependent
    packages' tests.

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

fix the test test_generation_blacklist

Build is green

Patch application report for D3037 (id=10800)

Rebasing onto bfba3bdda5...

Current branch diff-target is up to date.
Changes applied before test
commit ebd38077962687e0f962d1edab275f6d33b72312
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue Apr 21 11:33:32 2020 +0200

    Add a blacklist_types argument to object_dicts() and objects() hypothesis strategies
    
    so one can choose not to generate some of the object types.
    
    Blacklist "origin_visit_status" by default to prevent breaking dependent
    packages' tests.

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

This revision is now accepted and ready to land.Apr 21 2020, 3:26 PM