Details
- Reviewers
douardda - Group Reviewers
Reviewers - Maniphest Tasks
- T2483: tests: Make check-snapshot utility test function recursively check targetted object exists
- Commits
- rDLDBASE72590f998088: check_snapshot: Allow to check using both Snapshot and dict
tox
Diff Detail
- Repository
- rDLDBASE Generic VCS/Package Loader
- Branch
- refactor-check
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 13537 Build 20718: Phabricator diff pipeline on jenkins Jenkins console · Jenkins Build 20717: arc lint + arc unit
Event Timeline
Build is green
Patch application report for D3473 (id=12283)
Could not rebase; Attempt merge onto 6dc3da1580...
Updating 6dc3da1..a73a211 Fast-forward swh/loader/tests/__init__.py | 53 +++++++++++++++++--------- swh/loader/tests/test_init.py | 89 ++++++++++++++++++++++--------------------- 2 files changed, 81 insertions(+), 61 deletions(-)
Changes applied before test
commit a73a21159f3e4749b9adb690b1235805124fd5a4 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 17:36:21 2020 +0200 check_snapshot: Allow to check using both Snapshot and dict So we can smoothly transition to stop using snapshot as dict. Related to T2483 commit 39ffcde65768aec5bbeda09fc50bf5fb2bf76574 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 16:42:31 2020 +0200 test_init: Use swh_storage fixture Related to T2481
See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/120/ for more details.
swh/loader/tests/__init__.py | ||
---|---|---|
120 | oh i wanted to avoid the isinstance call initially but i recall i can't in the end (mypy)... |
swh/loader/tests/__init__.py | ||
---|---|---|
143 | Inverted the order to match what we do in other loaders. |
Build was aborted
Patch application report for D3473 (id=12300)
Rebasing onto 39ffcde657...
Current branch diff-target is up to date.
Changes applied before test
commit 294465ac998a44edb5f9029fbaa59def6367a8db Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 17:36:21 2020 +0200 check_snapshot: Allow to check using both Snapshot and dict So we can smoothly transition to stop using snapshot as dict. Related to T2483
Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/121/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/121/console
Build was aborted
Patch application report for D3473 (id=12305)
Rebasing onto 39ffcde657...
Current branch diff-target is up to date.
Changes applied before test
commit 5d02595567ba777aa081a740b86db956e0e8ca2d Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 17:36:21 2020 +0200 check_snapshot: Allow to check using both Snapshot and dict So we can smoothly transition to stop using snapshot as dict. Related to T2483
Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/122/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/122/console
Build is green
Patch application report for D3473 (id=12316)
Rebasing onto ed4e0b38c1...
Current branch diff-target is up to date.
Changes applied before test
commit b5ccfd7ae14ad8f415417281e4e135779a839a61 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 17:36:21 2020 +0200 check_snapshot: Allow to check using both Snapshot and dict So we can smoothly transition to stop using snapshot as dict. Related to T2483
See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/125/ for more details.
swh/loader/tests/__init__.py | ||
---|---|---|
112 | expected_snapshot or snapshot ? | |
121 | Since we try to go full "model object everywhere", why not use the Snapshot within this test rather than the dict form? | |
124–125 | I think this is unnecessary (the else case). This is testing code, if something incorrect is given, it will fail anyway. |
swh/loader/tests/__init__.py | ||
---|---|---|
112 | It's the expected_snapshot but i renamed it so it can reuse the name internally without mypy annoying me with its type. I forgot to rename the docstring, i'll fix that. | |
121 | Because I went with the existing code which already manipulated the dict. | |
124–125 | might as well be explicit? |
swh/loader/tests/__init__.py | ||
---|---|---|
121 | And it means more code, for example, i'd need to code the symmetric encode_target here so i can Snapshot.from_dict the all thing. |
swh/loader/tests/__init__.py | ||
---|---|---|
121 | And then convert the snapshot dict returned from the storage endpoint... |
swh/loader/tests/__init__.py | ||
---|---|---|
121 | context: trying to do as you proposed. Even though unfinished, i found the result quite unreadable in terms of error message... |
Build is green
Patch application report for D3473 (id=12346)
Rebasing onto ed4e0b38c1...
Current branch diff-target is up to date.
Changes applied before test
commit cb9647085a1d5f41024255089d2282de5ecbe11b Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Fri Jul 10 12:21:27 2020 +0200 Rework according to remarks commit b5ccfd7ae14ad8f415417281e4e135779a839a61 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 17:36:21 2020 +0200 check_snapshot: Allow to check using both Snapshot and dict So we can smoothly transition to stop using snapshot as dict. Related to T2483
See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/129/ for more details.
Build is green
Patch application report for D3473 (id=12348)
Rebasing onto ed4e0b38c1...
Current branch diff-target is up to date.
Changes applied before test
commit 72590f99808881c8f0beaececad944e070a3de9f Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Wed Jul 8 17:36:21 2020 +0200 check_snapshot: Allow to check using both Snapshot and dict So we can smoothly transition to stop using snapshot as dict. Related to T2483
See https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/130/ for more details.
As agreed on irc, i'll keep the snapshot dict conversion for now.
When done with the initial goal D3478, i'll migrate the tests
so they stop using dict and start using Snasphot objects instead.