Page MenuHomeSoftware Heritage

Refactor pytest_plugins.assert_all_objects_consumed() to use model objects
ClosedPublic

Authored by douardda on Jul 6 2020, 1:01 PM.

Details

Summary

instead of dicts.

This is needed because we are beginning to use converters in swh.model,
so the dict used as input is not guaranteed to be the exact same one
as the one retrieved from the journal.

For this, wee need to include the data attribute in journal_data's
Content objects so we have "true" Content objects in tests.
Whic then requires a few adjustments in journal tests because the
Content's data is never sent to the journal.

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 D3427 (id=12139)

Rebasing onto f6ab436d39...

Current branch diff-target is up to date.
Changes applied before test
commit 99bf313cd275ed1160526d0bb2ba79e3dc2fb7d0
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Jul 3 17:06:32 2020 +0200

    Refactor pytest_plugins.assert_all_objects_consumed() to use model objects
    
    instead of dicts.
    
    This is needed because we are beginning to use converters in swh.model,
    so the dict used as input is not guaranteed to be the exact same one
    as the one retrieved from the journal.
    
    For this, wee need to include the data attribute in journal_data's
    Content objects so we have "true" Content objects in tests.
    Whic then requires a few adjustments in journal tests because the
    Content's data is never sent to the journal.

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

ardumont added a subscriber: ardumont.

ok

jsyk, noticed 2 typos in the commit message (and diff description):

  • "wee" -> "we"
  • "whic" -> "which"
This revision is now accepted and ready to land.Jul 6 2020, 1:15 PM

ok

jsyk, noticed 2 typos in the commit message (and diff description):

  • "wee" -> "we"
  • "whic" -> "which"

thx

Build is green

Patch application report for D3427 (id=12140)

Rebasing onto f6ab436d39...

Current branch diff-target is up to date.
Changes applied before test
commit bf35ea79d3cc97a97ea0e54352a7e6ee91d245c1
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Jul 3 17:06:32 2020 +0200

    Refactor pytest_plugins.assert_all_objects_consumed() to use model objects
    
    instead of dicts.
    
    This is needed because we are beginning to use converters in swh.model,
    so the dict used as input is not guaranteed to be the exact same one
    as the one retrieved from the journal.
    
    For this, we need to include the data attribute in journal_data's
    Content objects so we have "true" Content objects in tests.
    Which then requires a few adjustments in journal tests because the
    Content's data is never sent to the journal.

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