Page MenuHomeSoftware Heritage

Reorganize ListedOrigin fixtures to generate multiple visit_types
ClosedPublic

Authored by vlorentz on Jan 13 2021, 3:43 PM.

Details

Summary

To prepare for further changes in this area.

Test Plan

existing tests pass unchanged

Diff Detail

Repository
rDSCH Scheduling utilities
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 D4854 (id=17185)

Could not rebase; Attempt merge onto a62003397d...

Updating a620033..23d1b3c
Fast-forward
 swh/scheduler/cli/__init__.py          |   7 +-
 swh/scheduler/cli/origin.py            | 135 +++++++++++++++++++++++++++++++++
 swh/scheduler/model.py                 |   9 +++
 swh/scheduler/tests/common.py          |  10 +--
 swh/scheduler/tests/conftest.py        |  45 ++++++++---
 swh/scheduler/tests/test_cli_origin.py | 103 +++++++++++++++++++++++++
 swh/scheduler/tests/test_model.py      |  31 +++++++-
 7 files changed, 320 insertions(+), 20 deletions(-)
 create mode 100644 swh/scheduler/cli/origin.py
 create mode 100644 swh/scheduler/tests/test_cli_origin.py
Changes applied before test
commit 23d1b3c1883c3c955b5dd5ba1cc2270c93e156d6
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Jan 13 15:25:56 2021 +0100

    Reorganize ListedOrigin fixtures to generate multiple visit_types

commit da347f7f4c401a43ec34de76365ad323d0ff7b77
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Jan 12 17:10:39 2021 +0100

    Introduce a `swh scheduler origin schedule-next` cli
    
    This creates one-shot tasks in the classic scheduler for the next visits
    to run according to the visit scheduling policy.

commit 42957c9e96e6c7d8070e0b6c786c273e8c1602a0
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Jan 12 17:28:33 2021 +0100

    Rename test task types to names that match real tasks
    
    The success of tests using these task types would depend on the test run
    order, because these task types are (currently) being created by
    swh/scheduler/sql/50-data.sql, but the table is truncated after the
    first test completes.

commit d1393c54da99c45175dd0b6a69734d17fc887960
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Jan 12 16:16:31 2021 +0100

    Introduce a `swh scheduler origin grab-next` cli
    
    This returns, as CSV, the next origins to be visited according to the
    passed scheduling policy.

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

ardumont added inline comments.
swh/scheduler/tests/conftest.py
61

why not plain listed_origins_by_type.values() ?

one question inline but otherwise, lgtm.

(also, i'm assuming the need for the visit_types as pytest fixture is needed for later).

This revision is now accepted and ready to land.Jan 13 2021, 4:09 PM
swh/scheduler/tests/conftest.py
61

It converts List[List[ListedOrigin]] to List[ListedOrigin]. It's like a fold, with [] as the initial value of the accumulator

Build is green

Patch application report for D4854 (id=17215)

Could not rebase; Attempt merge onto a62003397d...

Updating a620033..59b4cb3
Fast-forward
 swh/scheduler/cli/__init__.py          |   7 +-
 swh/scheduler/cli/origin.py            | 136 +++++++++++++++++++++++++++++++++
 swh/scheduler/model.py                 |   9 +++
 swh/scheduler/tests/common.py          |  10 +--
 swh/scheduler/tests/conftest.py        |  45 ++++++++---
 swh/scheduler/tests/test_cli_origin.py | 103 +++++++++++++++++++++++++
 swh/scheduler/tests/test_model.py      |  31 +++++++-
 7 files changed, 321 insertions(+), 20 deletions(-)
 create mode 100644 swh/scheduler/cli/origin.py
 create mode 100644 swh/scheduler/tests/test_cli_origin.py
Changes applied before test
commit 59b4cb3f1c7a081e0d28b11d15888d38a9de151e
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Wed Jan 13 15:25:56 2021 +0100

    Reorganize ListedOrigin fixtures to generate multiple visit_types

commit 4f5338f2aba360fed2e524cbcdd23b11bacfb79d
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Jan 12 17:10:39 2021 +0100

    Introduce a `swh scheduler origin schedule-next` cli
    
    This creates one-shot tasks in the classic scheduler for the next visits
    to run according to the visit scheduling policy.

commit 3dd1d5f28d329620a65ee00749d24401b6d8cf00
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Jan 12 17:28:33 2021 +0100

    Rename test task types to names that match real tasks
    
    The success of tests using these task types would depend on the test run
    order, because these task types are (currently) being created by
    swh/scheduler/sql/50-data.sql, but the table is truncated after the
    first test completes.

commit 5d7b002ac403565e348ac8fe4dd56d015cf29cae
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Tue Jan 12 16:16:31 2021 +0100

    Introduce a `swh scheduler origin grab-next` cli
    
    This returns, as CSV, the next origins to be visited according to the
    passed scheduling policy.

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