Page MenuHomeSoftware Heritage

Fix test_loader's "id" types for proper bytes
ClosedPublic

Authored by douardda on Jul 16 2020, 9:51 AM.

Details

Summary

instead of hex string representation.

Test Plan

This should pass with current swh.loader.core version as well as with D3501.

Diff Detail

Event Timeline

Build is green

Patch application report for D3516 (id=12426)

Rebasing onto eb613d754d...

Current branch diff-target is up to date.
Changes applied before test
commit fc82f956355c59770a0500468730e6982520aa5e
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Jul 16 09:50:03 2020 +0200

    Fix test_loader's "id" types for proper bytes
    
    instead of hex string representation.

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

ardumont added a subscriber: ardumont.

I'm not sure we still need the hex form now.

ok nonetheless ;)

This revision is now accepted and ready to land.Jul 16 2020, 9:57 AM

I'm not sure we still need the hex form now.

ok nonetheless ;)

It's easier to read :-)

I'm not sure we still need the hex form now.

ok nonetheless ;)

It's easier to read :-)

Yes sure, i meant it from:

"id": hash_to_bytes(expected_snapshot_id),

to:

"id: hash_to_bytes("d35668e02e2ba4321dc951cd308cf883786f918a"),

(and drop expected_snapshot_id if it's no longer used which i think it's the case now).

Yes sure, i meant it from:

"id": hash_to_bytes(expected_snapshot_id),

to:

"id: hash_to_bytes("d35668e02e2ba4321dc951cd308cf883786f918a"),

(and drop expected_snapshot_id if it's no longer used which i think it's the case now).

of course, i took the wrong path again... (i should have read back the code before answering sorry):

# because it's still used but we no longer need its hex form
expected_snapshot_id = hash_to_bytes("d35668e02e2ba4321dc951cd308cf883786f918a"),
...
"id: expected_snapshot_id,
...

ohh... it's unreadable, i'll target the diff instead... (sorry)

swh/loader/mercurial/tests/test_loader.py
137
expected_snapshot_id = hash_to_bytes("d35668e02e2ba4321dc951cd308cf883786f918a")
139
"id": expected_snapshot_id,
177
snapshot=expected_snapshot_id,

ohh... it's unreadable, i'll target the diff instead... (sorry)

done

(but do as you wish heh, i already accepted it :)

inline expected_snapshot_id

Build is green

Patch application report for D3516 (id=12432)

Rebasing onto eb613d754d...

Current branch diff-target is up to date.
Changes applied before test
commit 786f8caa37af4dec1826dd9a381307dc9b940a68
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Jul 16 09:50:03 2020 +0200

    Fix test_loader's "id" types for proper bytes
    
    instead of hex string representation.

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