Page MenuHomeSoftware Heritage

deposit.cli.admin: Add types and coverage on module
ClosedPublic

Authored by ardumont on Oct 13 2020, 3:00 PM.

Details

Summary

This will allow to be more confident when we will refactor the configuration
part (T1410).

This tests almost all admin cli except the swh deposit reschedule one.
That's D4256.

Test Plan

tox

Diff Detail

Repository
rDDEP Push deposit
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16224
Build 24960: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 24959: arc lint + arc unit

Event Timeline

ardumont retitled this revision from cli.admin: Add tests to deposit.cli.admin: Add tests.Oct 13 2020, 3:01 PM

Build is green

Patch application report for D4245 (id=14999)

Could not rebase; Attempt merge onto a8e6b830bb...

Updating a8e6b830..c37d5aaa
Fast-forward
 swh/deposit/api/checks.py                          |  41 ++---
 swh/deposit/cli/admin.py                           |  65 ++++---
 swh/deposit/tests/api/test_checks.py               |  74 +++++++-
 .../tests/api/test_deposit_private_check.py        |  18 +-
 swh/deposit/tests/api/test_deposit_update.py       |   4 +-
 swh/deposit/tests/cli/conftest.py                  |  12 ++
 swh/deposit/tests/cli/test_admin.py                | 189 +++++++++++++++++++++
 swh/deposit/tests/cli/test_client.py               |   8 +-
 8 files changed, 338 insertions(+), 73 deletions(-)
 create mode 100644 swh/deposit/tests/cli/conftest.py
 create mode 100644 swh/deposit/tests/cli/test_admin.py
Changes applied before test
commit c37d5aaac1a3af776fa750261e3fff67e4fab0b7
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Oct 13 14:59:50 2020 +0200

    cli.admin: Add tests

commit e5522766157421cd2b83b075c5ae349c701ee19e
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Oct 12 13:59:09 2020 +0200

    deposit.api.checks: Update api checks to allow more alternate fields
    
    at least, this makes the following fields able to be filled with either:
    - author or codemeta:author
    - title, name, codemeta:title, or codemeta:name
    
    This, for example, actually allows to use the generated metadata from the
    deposit client cli.
    
    The actual metadata generated by the cli uses `codemeta:author` and
    `codemeta:name`. Prior to this commit, those metadata would fail the previous
    check in the case of the metadata update scenario.

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

Build is green

Patch application report for D4245 (id=15014)

Rebasing onto a8e6b830bb...

Current branch diff-target is up to date.
Changes applied before test
commit 77739e54722f57591098f6bc5473e555ae016451
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Oct 13 14:59:50 2020 +0200

    cli.admin: Add tests

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

ardumont retitled this revision from deposit.cli.admin: Add tests to deposit.cli.admin: Add types and coverage on module.Oct 14 2020, 11:10 AM
ardumont edited the summary of this revision. (Show Details)

Build is green

Patch application report for D4245 (id=15028)

Rebasing onto a8e6b830bb...

Current branch diff-target is up to date.
Changes applied before test
commit f17263e2ad2ac5f52fd4f2eb0deac58e9b9dc374
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Oct 13 14:59:50 2020 +0200

    deposit.cli.admin: Add types and coverage on module
    
    This will allow to be more confident when we will refactor the configuration
    part.

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

ardumont edited the summary of this revision. (Show Details)

Rebase

Build is green

Patch application report for D4245 (id=15039)

Rebasing onto 2f5300e60a...

Current branch diff-target is up to date.
Changes applied before test
commit 51446a11df5cbd6608b282135ea5f2ff30791397
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Tue Oct 13 14:59:50 2020 +0200

    deposit.cli.admin: Add types and coverage on module
    
    This will allow to be more confident when we will refactor the configuration
    part.

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

This revision was not accepted when it landed; it landed in state Needs Review.Oct 14 2020, 4:23 PM
This revision was automatically updated to reflect the committed changes.