Page MenuHomeSoftware Heritage

Add test for routing key calculation
ClosedPublic

Authored by aeviso on Nov 29 2021, 2:47 PM.

Details

Summary

Depends on D6697.

Diff Detail

Event Timeline

Build is green

Patch application report for D6705 (id=24361)

Could not rebase; Attempt merge onto 579c3bd35e...

Updating 579c3bd..9043294
Fast-forward
 .gitignore                                       |   4 +-
 docs/storage/remote.rst                          | 720 +++++++++++++++++++++++
 mypy.ini                                         |   3 +
 pytest.ini                                       |   2 +
 requirements-test.txt                            |   1 +
 requirements.txt                                 |   1 +
 swh/provenance/__init__.py                       |   8 +
 swh/provenance/api/client.py                     | 466 +++++++++++++++
 swh/provenance/api/server.py                     | 666 ++++++++++++++++++++-
 swh/provenance/cli.py                            |  31 +-
 swh/provenance/tests/conftest.py                 |  24 +-
 swh/provenance/tests/test_conflict_resolution.py | 158 +++++
 swh/provenance/tests/test_routing_keys.py        |  78 +++
 swh/provenance/util.py                           |   5 +
 tox.ini                                          |   3 +-
 15 files changed, 2156 insertions(+), 14 deletions(-)
 create mode 100644 docs/storage/remote.rst
 create mode 100644 swh/provenance/tests/test_conflict_resolution.py
 create mode 100644 swh/provenance/tests/test_routing_keys.py
Changes applied before test
commit 904329450ffd5fa9c6ddb5d4c9192b572656ab5e
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Mon Nov 29 14:41:28 2021 +0100

    Add test for routing key calculation

commit e4d097695294def8d809fbce6455b3c8712735dc
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Tue Sep 28 10:01:43 2021 +0200

    Add tests for conflict resolution functions

commit 4eecec5edb9139e945912ff39c7d0f412d3c9977
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Tue Sep 21 16:13:53 2021 +0200

    Add support for remote backend on existing storage tests

commit f8411a522e937b961d7fc8270c653d83039268fd
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Fri Aug 20 12:21:27 2021 +0200

    Add new RabbitMQ-based client/server API
    
    Write methods in the `ProvenanceStorageInterface` are called through a server that
    guarantees conflict-free writings to the underlying database.
    
    Read methods are called directly from the client to avoid RCP overhead for reads.
    
    The server spawns multiple sub-processes to handle independent requests concurrently.

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

Build is green

Patch application report for D6705 (id=24369)

Could not rebase; Attempt merge onto 579c3bd35e...

Updating 579c3bd..21abd91
Fast-forward
 .gitignore                                       |   4 +-
 docs/storage/remote.rst                          | 724 +++++++++++++++++++++++
 mypy.ini                                         |   3 +
 pytest.ini                                       |   2 +
 requirements-test.txt                            |   1 +
 requirements.txt                                 |   1 +
 swh/provenance/__init__.py                       |   8 +
 swh/provenance/api/client.py                     | 466 +++++++++++++++
 swh/provenance/api/server.py                     | 666 ++++++++++++++++++++-
 swh/provenance/cli.py                            |  31 +-
 swh/provenance/tests/conftest.py                 |  24 +-
 swh/provenance/tests/test_conflict_resolution.py | 158 +++++
 swh/provenance/tests/test_routing_keys.py        |  78 +++
 swh/provenance/util.py                           |   5 +
 tox.ini                                          |  38 +-
 15 files changed, 2195 insertions(+), 14 deletions(-)
 create mode 100644 docs/storage/remote.rst
 create mode 100644 swh/provenance/tests/test_conflict_resolution.py
 create mode 100644 swh/provenance/tests/test_routing_keys.py
Changes applied before test
commit 21abd9134e5fa0bca687cffa530a3f73be6a7c0c
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Mon Nov 29 14:41:28 2021 +0100

    Add test for routing key calculation

commit 6306b44896c1775aef49b8840464efd80df9e648
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Tue Sep 28 10:01:43 2021 +0200

    Add tests for conflict resolution functions

commit e649205e258980cafbeb1db7d18f9c6efb1a8e76
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Tue Sep 21 16:13:53 2021 +0200

    Add support for remote backend on existing storage tests

commit a6cc3e4daf228ce9c124712b93c4749b16e65ce1
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Fri Aug 20 12:21:27 2021 +0200

    Add new RabbitMQ-based client/server API
    
    Write methods in the `ProvenanceStorageInterface` are called through a server that
    guarantees conflict-free writings to the underlying database.
    
    Read methods are called directly from the client to avoid RCP overhead for reads.
    
    The server spawns multiple sub-processes to handle independent requests concurrently.

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

vlorentz added a subscriber: vlorentz.

You don't need parametrization for test_routing_keys and test_routing_key_error, the code is very short; you can write the assertions directly

This revision is now accepted and ready to land.Dec 1 2021, 12:31 PM

You don't need parametrization for test_routing_keys and test_routing_key_error, the code is very short; you can write the assertions directly

swh/provenance/tests/test_routing_keys.py
62

Could you use a more specific exception class here?

(oops, looks like I sent the review too fast)

This revision now requires changes to proceed.Dec 1 2021, 12:32 PM
swh/provenance/tests/test_routing_keys.py
62

There is a simple assert inside the function. What should be the mode specific exception in that case?

swh/provenance/tests/test_routing_keys.py
62

pytest.raises(AssertionError)

Removed parameter and replace BaseException for AssertionError

Build is green

Patch application report for D6705 (id=24390)

Rebasing onto 6306b44896...

Current branch diff-target is up to date.
Changes applied before test
commit 247574bec84d471a6e78721d02b115b6017d2f9d
Author: Andres Ezequiel Viso <aeviso@softwareheritage.org>
Date:   Mon Nov 29 14:41:28 2021 +0100

    Add test for routing key calculation

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

This revision is now accepted and ready to land.Dec 1 2021, 5:08 PM
This revision was automatically updated to reflect the committed changes.