Page MenuHomeSoftware Heritage

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

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

Details

Summary

by moving import statements in functions.

Related to T2575.

Diff Detail

Unit TestsFailed

TimeTest
252 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.cli.test_client::test_metadata_validation
sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00bq*Q\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1some c...kins/pytest-0/test_metadata_validation0/tmpx62u1f3_', 'length': 128, 'md5sum': '8c3a2f3d2c0a076fbdfeefbaeec631ae', ...} mocker = <pytest_mock.plugin.MockerFixture object at 0x7f6b1685eac8> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6b1685ec50>
352 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.cli.test_client::test_single_deposit_slug_generation
sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00cq*Q\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1some c...ytest-0/test_single_deposit_slug_gener0/tmp7jg8xsy3', 'length': 128, 'md5sum': '9e8c110bb111a333f165f8a95d534d8b', ...} mocker = <pytest_mock.plugin.MockerFixture object at 0x7f6b16421c18> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6b16421668>
351 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.cli.test_client::test_single_minimal_deposit
sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00bq*Q\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1some c...s/pytest-0/test_single_minimal_deposit0/tmpsflfj53q', 'length': 128, 'md5sum': '8c3a2f3d2c0a076fbdfeefbaeec631ae', ...} mocker = <pytest_mock.plugin.MockerFixture object at 0x7f6b15a4ec18> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6b15a4eb00>
349 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_converters::test_convert_status_detail
349 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_converters::test_convert_status_detail_2
View Full Test Results (3 Failed · 138 Passed)

Event Timeline

Build has FAILED

Patch application report for D3909 (id=13768)

Rebasing onto 7c5c84b595...

Current branch diff-target is up to date.
Changes applied before test
commit f8d9a8404572abed76bd8a1dcb7cb11a6c455d9f
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed Sep 9 18:22:50 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/DDEP/job/tests-on-diff/62/
See console output for more information: https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/62/console

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

fix test_cli

broken by (moved) mocked objects.

Build is green

Patch application report for D3909 (id=13789)

Rebasing onto 7c5c84b595...

Current branch diff-target is up to date.
Changes applied before test
commit de0ab7f6f21fb26fb0e59c16eeb5117d22ada2fd
Author: David Douard <david.douard@sdfa3.org>
Date:   Wed Sep 9 18:22:50 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/DDEP/job/tests-on-diff/63/ for more details.