Page MenuHomeSoftware Heritage

test_cassandra: Fix failing tests since swh-model update
ClosedPublic

Authored by anlambert on Dec 7 2021, 1:38 PM.

Details

Summary

Directory entries are now checked for name duplicates in swh-model
so we must ensure the CrashyEntry class is properly initialized.

Closes T3776

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25434
Build 39760: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 39759: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D6768 (id=24562)

Rebasing onto 850a7553b6...

Current branch diff-target is up to date.
Changes applied before test
commit 615fb99eb70818fa16e7f65e07c8db540a750115
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Dec 7 13:36:28 2021 +0100

    test_cassandra: Fix failing tests since swh-model update
    
    Directory entries are now checked for name duplicates in swh-model
    so we must ensure the CrashyEntry class is properly initialized.
    
    Closes T3776

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

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/storage/tests/test_cassandra.py
543

FYI I think you should be able to do this, but no big deal

This revision is now accepted and ready to land.Dec 7 2021, 1:53 PM
swh/storage/tests/test_cassandra.py
543

Computer says no:

self = <[TypeError("a bytes-like object is required, not '_Nothing'") raised in repr()] CrashyEntry object at 0x7f7aa159d5e0>

    def __init__(self):
>       super().__init__(**directory.entries[0].to_dict(), name=b"crash")
E       TypeError: swh.model.model.DirectoryEntry.__init__() got multiple values for keyword argument 'name'

swh/storage/tests/test_cassandra.py:543: TypeError