Page MenuHomeSoftware Heritage

tests: Drop deprecated storage.origin_add_one use
ClosedPublic

Authored by ardumont on Jul 20 2020, 1:48 PM.

Details

Summary

This is no longer used anywhere.

$ grep -r "origin_add_one" $SWH_ENVIRONMENT_HOME/**/swh/*
swh-storage/swh/storage/cassandra/storage.py:            self._cql_runner.origin_add_one(origin)
swh-storage/swh/storage/cassandra/cql.py:    def origin_add_one(self, origin: Origin, *, statement) -> None:
swh-storage/swh/storage/in_memory.py:                self.origin_add_one(origin)
swh-storage/swh/storage/in_memory.py:    def origin_add_one(self, origin: Origin) -> str:

Note: those left are implementation details within the storage (it's no longer exposed through the storage interface)

Motivation:

  • no longer used
  • less to maintain
  • no longer high number of logs about deprecated endpoints in console output
  • and currently that means less things to migrate to data model objects use

Related to T2494

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

Build is green

Patch application report for D3567 (id=12565)

Could not rebase; Attempt merge onto a17c4128d8...

Updating a17c4128..bbdd7ed4
Fast-forward
 swh/storage/cassandra/storage.py         |  15 --
 swh/storage/in_memory.py                 |   3 -
 swh/storage/interface.py                 |  19 ---
 swh/storage/retry.py                     |   5 -
 swh/storage/storage.py                   |   8 --
 swh/storage/tests/algos/test_origin.py   |   2 +-
 swh/storage/tests/algos/test_snapshot.py |   4 +-
 swh/storage/tests/test_kafka_writer.py   |   2 +-
 swh/storage/tests/test_retry.py          |  75 +---------
 swh/storage/tests/test_storage.py        | 227 +++++++++++++++----------------
 swh/storage/validate.py                  |   6 -
 11 files changed, 116 insertions(+), 250 deletions(-)
Changes applied before test
commit bbdd7ed48db96c02317788d509ec3abba2b3a243
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 20 13:42:45 2020 +0200

    tests: Drop deprecated storage.origin_add_one use
    
    This is no longer used anywhere.
    
    Related to T2494

commit 4971c25b772894a793165ebeceead44879df03c1
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 20 13:20:59 2020 +0200

    test_storage: release: Use data model object
    
    Related to T2494

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

This revision is now accepted and ready to land.Jul 20 2020, 1:57 PM