Page MenuHomeSoftware Heritage

cli: speedup the `swh` cli command startup time
ClosedPublic

Authored by douardda on Sep 10 2020, 4:14 PM.

Details

Summary

by moving import statements in functions.

Related to T2575.

Diff Detail

Unit TestsFailed

TimeTest
1,386 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.indexer.tests.test_cli::test_journal_client
storage = <swh.storage.in_memory.InMemoryStorage object at 0x7f1d08eba828> indexer_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f1d08de0c88> kafka_prefix = 'cnujhmnpib', kafka_server = '127.0.0.1:37811'
823 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.indexer.tests.test_cli::test_mapping_list
indexer_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f1d0bf99f98> def test_mapping_list(indexer_scheduler):
351 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.indexer.tests.test_cli::test_mapping_list_terms
indexer_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f1d0c385c50> def test_mapping_list_terms(indexer_scheduler):
351 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.indexer.tests.test_cli::test_mapping_list_terms_exclude
indexer_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f1d0c09a1d0> def test_mapping_list_terms_exclude(indexer_scheduler):
367 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.indexer.tests.test_cli::test_origin_metadata_reindex_divisor
indexer_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f1d08e7bb70> idx_storage = <swh.indexer.storage.in_memory.IndexerStorage object at 0x7f1d08e7b668> storage = <swh.storage.in_memory.InMemoryStorage object at 0x7f1d08ea9860>
View Full Test Results (11 Failed · 308 Passed · 15 Skipped)

Event Timeline

Build has FAILED

Patch application report for D3913 (id=13772)

Rebasing onto c231873d56...

Current branch diff-target is up to date.
Changes applied before test
commit 939cb934e0794caf1278e3e63c4b013e0045f44d
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 09:26:22 2020 +0200

    cli: speedup the `swh` cli command startup time
    
    by moving import statements in functions.
    
    Related to T2575.

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

This revision is now accepted and ready to land.Sep 10 2020, 4:38 PM

fix test_cli

mock needed being updated

Build is green

Patch application report for D3913 (id=13839)

Rebasing onto c231873d56...

Current branch diff-target is up to date.
Changes applied before test
commit 2ef7177bc2e2916f32171269751485a230828355
Author: David Douard <david.douard@sdfa3.org>
Date:   Thu Sep 10 09:26:22 2020 +0200

    cli: speedup the `swh` cli command startup time
    
    by moving import statements in functions.
    
    Related to T2575.

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