- clients crash when they call the API with an iterator
- some backend implementations violate the contract by assuming the argument is a sequence (eg. by iterating twice on it, and assuming the elements are the same)
- no matter what we do, the endpoints will always get a list as argument in practice, because they go through the RPC framework
- there is no concrete (ha!) advantage in taking an Iterable rather than a List.
Details
Diff Detail
- Repository
- rDSTO Storage manager
- Branch
- no-iterables
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 14026 Build 21530: Phabricator diff pipeline on jenkins Jenkins console · Jenkins Build 21529: arc lint + arc unit
Time | Test | |
---|---|---|
1,472 ms | Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_api_client.TestStorage::test_types self = <swh.storage.tests.test_api_client.TestStorage object at 0x7f424a3a1cc0>
swh_storage_backend_config = {'cls': 'local', 'db': 'postgresql://postgres@127.0.0.1:17590/tests', 'journal_writer': {'cls': 'memory'}, 'objstorage': {'args': {}, 'cls': 'memory'}}
| |
712 ms | Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_cassandra.TestCassandraStorage::test_directory_add_from_generator self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f42000960f0>
swh_storage = <swh.storage.cassandra.storage.CassandraStorage object at 0x7f42001c5e10>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f42002873c8>
| |
467 ms | Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_cassandra.TestCassandraStorage::test_revision_add_from_generator self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f4200350b38>
swh_storage = <swh.storage.cassandra.storage.CassandraStorage object at 0x7f41d85d9198>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f42402a6780>
| |
569 ms | Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_cassandra.TestCassandraStorage::test_snapshot_add_many_from_generator self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f4178361390>
swh_storage = <swh.storage.cassandra.storage.CassandraStorage object at 0x7f41787bf898>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f415813eac8>
| |
623 ms | Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_cassandra.TestCassandraStorage::test_types self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7f42480e60b8>
swh_storage_backend_config = {'cls': 'cassandra', 'hosts': ['127.0.0.1'], 'journal_writer': {'cls': 'memory'}, 'keyspace': '556281b376b5123338bc', ...}
| |
View Full Test Results (10 Failed · 750 Passed · 17 Skipped) |
Event Timeline
Build has FAILED
Patch application report for D3636 (id=12796)
Rebasing onto 77960ca4b5...
Current branch diff-target is up to date.
Changes applied before test
commit c56616b4f39fb783a83516c01e3c744c7a0cfbd9 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jul 29 10:26:32 2020 +0200 Make API endpoints take Lists instead of Iterables as arguments 1. clients crash when they call the API with an iterator 2. some backend implementations violate the contract by assuming the argument is a sequence (eg. by iterating twice on it, and assuming the elements are the same) 3. no matter what we do, the endpoints will always get a list as argument in practice, because they go through the RPC framework 4. there is no concrete (ha!) advantage in taking an Iterable rather than a List.
Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/586/
See console output for more information: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/586/console
Build is green
Patch application report for D3636 (id=12815)
Rebasing onto 643ebc6e7e...
First, rewinding head to replay your work on top of it... Applying: Make API endpoints take Lists instead of Iterables as arguments
Changes applied before test
commit 29ce125987aae2b5f08419d979c66a95cc5e3512 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jul 29 10:26:32 2020 +0200 Make API endpoints take Lists instead of Iterables as arguments 1. clients crash when they call the API with an iterator 2. some backend implementations violate the contract by assuming the argument is a sequence (eg. by iterating twice on it, and assuming the elements are the same) 3. no matter what we do, the endpoints will always get a list as argument in practice, because they go through the RPC framework 4. there is no concrete (ha!) advantage in taking an Iterable rather than a List.
See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/598/ for more details.
no matter what we do, the endpoints will always get a list as argument in practice, because they go through the RPC framework
I was unsure about this but it seems it's the case (looking at the swh-site repository configuration, it seems we always pass by the remote storage at the end of the configuration).
I was unsure about this but it seems it's the case
It has to be. If they didn't, we would have got errors
Build is green
Patch application report for D3636 (id=12822)
Rebasing onto 21b77304a0...
First, rewinding head to replay your work on top of it... Applying: Make API endpoints take Lists instead of Iterables as arguments Applying: Fix upcoming type warning with swh.core > v0.1.2.
Changes applied before test
commit 1764aa111ea6aaee54ce4cb427ce12833a998e2b Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jul 29 10:30:45 2020 +0200 Fix upcoming type warning with swh.core > v0.1.2. origin_visit_status_get_latest expects an int, not Optional[int]; but this error wasn't detected so far because mypy couldn't detect the type of the function. The next release of swh.core fixes that issue, so this fix is now needed to not trigger a mypy error. commit 556d649e51837d92fceb5cd5a918dac63c40a226 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jul 29 10:26:32 2020 +0200 Make API endpoints take Lists instead of Iterables as arguments 1. clients crash when they call the API with an iterator 2. some backend implementations violate the contract by assuming the argument is a sequence (eg. by iterating twice on it, and assuming the elements are the same) 3. no matter what we do, the endpoints will always get a list as argument in practice, because they go through the RPC framework 4. there is no concrete (ha!) advantage in taking an Iterable rather than a List.
See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/601/ for more details.