Page MenuHomeSoftware Heritage

tests: Add some missing unknown object tests
ClosedPublic

Authored by anlambert on Sep 7 2022, 11:36 AM.

Details

Summary

Add tests when querying an unknown content, directory, release or
revision through a valid SWHID.

Also simplify code for getting a release or revision by id.

Depends on D8408

Diff Detail

Repository
rDGQL GraphQL API
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 D8409 (id=30342)

Could not rebase; Attempt merge onto 467e0b7e28...

Updating 467e0b7..62920c3
Fast-forward
 swh/graphql/resolvers/base_connection.py          |  4 ++++
 swh/graphql/resolvers/base_node.py                |  2 ++
 swh/graphql/resolvers/content.py                  |  4 +---
 swh/graphql/resolvers/directory.py                |  5 +----
 swh/graphql/resolvers/directory_entry.py          |  5 +----
 swh/graphql/resolvers/origin.py                   |  7 +++----
 swh/graphql/resolvers/release.py                  |  4 +---
 swh/graphql/resolvers/revision.py                 |  7 +++----
 swh/graphql/resolvers/search.py                   |  5 ++---
 swh/graphql/resolvers/snapshot.py                 |  7 ++-----
 swh/graphql/resolvers/snapshot_branch.py          |  5 ++---
 swh/graphql/resolvers/visit.py                    |  7 +++----
 swh/graphql/resolvers/visit_status.py             |  7 ++-----
 swh/graphql/tests/functional/test_content.py      | 12 ++++++++++++
 swh/graphql/tests/functional/test_directory.py    | 12 ++++++++++++
 swh/graphql/tests/functional/test_release_node.py | 14 +++++++++++++-
 swh/graphql/tests/functional/test_revision.py     | 12 ++++++++++++
 swh/graphql/tests/functional/utils.py             |  1 +
 swh/graphql/tests/unit/backends/test_archive.py   |  2 +-
 19 files changed, 78 insertions(+), 44 deletions(-)
Changes applied before test
commit 62920c3258abc86712329a9330f94f367d1952c0
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Wed Sep 7 11:34:10 2022 +0200

    tests: Add some missing unknown object tests
    
    Add tests when querying an unknown content, directory, release or
    revision through a valid SWHID.
    
    Also simplify code for getting a release or revision by id.

commit 0fc26f83a2a1a4e501ca51675c398601ebb4be62
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Sep 6 17:25:30 2022 +0200

    resolvers: Initialize backends in base classes for node and connection
    
    It enables to save a couple of import instructions and make code simpler.

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

This revision is now accepted and ready to land.Sep 8 2022, 2:48 PM