Page MenuHomeSoftware Heritage

test_storage: Make swh_contents fixture generate content model objects
ClosedPublic

Authored by ardumont on Jul 20 2020, 11:10 AM.

Details

Summary

Note that this will be improved upon after the storage migration. We can take a
look at the swh.model.tests.generate_testdata.gen_contents and make it generate
BaseContent objects directly if it's possible. This was not done here so the
impacts is limited to storage.

Related to T2494

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

You should do the same for swh_origins

You should do the same for swh_origins

Yes, and I will in another diff ;)
I'm keeping diff small and easier to review.

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

Build has FAILED

Patch application report for D3559 (id=12545)

Could not rebase; Attempt merge onto 7131dcb9cf...

Updating 7131dcb9..1a2b85fa
Fast-forward
 swh/storage/tests/conftest.py           |  12 ++-
 swh/storage/tests/generate_data_test.py |  49 -----------
 swh/storage/tests/storage_data.py       |   2 +-
 swh/storage/tests/test_storage.py       | 144 ++++++++++++++------------------
 4 files changed, 71 insertions(+), 136 deletions(-)
 delete mode 100644 swh/storage/tests/generate_data_test.py
Changes applied before test
commit 1a2b85fa1eeb690d675828d83611cfb87f34ff7f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 20 11:09:08 2020 +0200

    test_storage: Make swh_contents fixture generate content model objects
    
    Note that this will be improved upon after the storage migration. We can take a
    look at the swh.model.tests.generate_testdata.gen_contents and make it generate
    BaseContent objects directly if it's possible. This was not done here so the
    impacts is limited to storage.
    
    Related to T2494

commit 99a28ad30b14ec72b8458ecd9503b22b7898e323
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 20 10:41:02 2020 +0200

    tests.generate_data_test: Remove dead code
    
    The storage fixtures now uses the swh.model.tests.generate_data_test instead
    
    Related to T2494

commit 03e17c3600f340e077d835f19cba05893d114612
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 20 10:12:13 2020 +0200

    test_storage: skipped_content/content_missing: Use data model object
    
    Related to T2494

Link to build: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/485/
See console output for more information: https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/485/console

Build is green

Patch application report for D3559 (id=12545)

Rebasing onto 99a28ad30b...

Current branch diff-target is up to date.
Changes applied before test
commit 1a2b85fa1eeb690d675828d83611cfb87f34ff7f
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Mon Jul 20 11:09:08 2020 +0200

    test_storage: Make swh_contents fixture generate content model objects
    
    Note that this will be improved upon after the storage migration. We can take a
    look at the swh.model.tests.generate_testdata.gen_contents and make it generate
    BaseContent objects directly if it's possible. This was not done here so the
    impacts is limited to storage.
    
    Related to T2494

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