Page MenuHomeSoftware Heritage

Add a model object based version of the journal writer test objects
ClosedPublic

Authored by olasd on Apr 10 2020, 12:58 PM.

Details

Summary

This refactors the various conversions happening in the journal writer tests in
a single place.

When developing this, I noticed that the journal writer would let Content data
go through; Make sure we do not let it do that.

Depends on D3003.

Test Plan

updated tox tests to use the new fixture

Diff Detail

Repository
rDJNL Journal infrastructure
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D3004 (id=10666)

Could not rebase; Attempt merge onto 750d4c6c5b...

Updating 750d4c6..9f0cd74
Fast-forward
 swh/journal/tests/conftest.py          | 29 +++++++++++++++---
 swh/journal/tests/test_kafka_writer.py | 55 +++++++++++++---------------------
 swh/journal/tests/test_replay.py       | 42 ++++++++++++++------------
 swh/journal/writer/kafka.py            |  2 ++
 4 files changed, 70 insertions(+), 58 deletions(-)
Changes applied before test
commit 9f0cd745d07e7e379446eb82bcfd25e88e6d1d4a
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Apr 10 11:41:54 2020 +0200

    Add a model object based version of the journal writer test objects
    
    This refactors the various conversions happening in the journal writer tests in
    a single place.
    
    When developing this, I noticed that the journal writer would let Content data
    go through; Make sure we do not let it do that.

commit 1c9ccb29eea3b974ea0d3613d61a65cd4e83037b
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Thu Apr 9 18:50:18 2020 +0200

    Rename OBJECT_TYPE_KEYS to TEST_OBJECT_DICTS

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

This revision is now accepted and ready to land.Apr 10 2020, 3:54 PM