Page MenuHomeSoftware Heritage

loader/opam/tests: Do not run actual opam init command call
ClosedPublic

Authored by ardumont on Feb 25 2022, 10:09 AM.

Details

Summary

Instead, this fixes the pseudo fake opam root present in tests datadir folder to the
right structure and then installs it properly for the test to use.

Another benefit from this is now inhibiting any actual network happening during the opam
init cli call.

This also reverts the previous commit which added a --yes in the opam init cli.
This was not working and not the right solution in the end.

Related to T3973

Test Plan

tox

Diff Detail

Unit TestsFailed

TimeTest
2 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.package.opam.tests.test_opam::test_opam_loader_many_version
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fdd66f7e630> tmpdir = local('/tmp/pytest-of-jenkins/pytest-0/test_opam_loader_many_version0') datadir = '/var/lib/jenkins/workspace/DLDBASE/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/loader/package/opam/tests/data'
2 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.package.opam.tests.test_opam::test_opam_loader_one_version
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fdd6c226630> tmpdir = local('/tmp/pytest-of-jenkins/pytest-0/test_opam_loader_one_version0') datadir = '/var/lib/jenkins/workspace/DLDBASE/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/loader/package/opam/tests/data'
2 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.package.opam.tests.test_opam::test_opam_metadata
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fdd6c04a8d0> tmpdir = local('/tmp/pytest-of-jenkins/pytest-0/test_opam_metadata0') datadir = '/var/lib/jenkins/workspace/DLDBASE/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/loader/package/opam/tests/data'
2 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.package.opam.tests.test_opam::test_opam_release
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fdd66f95f28> tmpdir = local('/tmp/pytest-of-jenkins/pytest-0/test_opam_release0') datadir = '/var/lib/jenkins/workspace/DLDBASE/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/loader/package/opam/tests/data'
1 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.core.tests.test_converters::test_content_for_storage_data
View Full Test Results (4 Failed · 185 Passed)

Event Timeline

Build has FAILED

Patch application report for D7255 (id=26287)

Rebasing onto ec6591f6a9...

Current branch diff-target is up to date.
Changes applied before test
commit eff49575a690e13e553e3c827cdf60b4f0497404
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Feb 25 10:06:43 2022 +0100

    loader/opam/tests: Do not run actual opam init command call
    
    Instead, this fixes the pseudo fake opam root present in tests datadir folder to the
    right structure and then installs it properly for the test to use.
    
    Another benefit from this is now inhibiting any actual network happening during the opam
    init cli call.
    
    This also reverts the previous commit which added a --yes in the opam init cli.
    This was not working and not the right solution in the end.
    
    Related to T3973

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

Harbormaster returned this revision to the author for changes because remote builds failed.Feb 25 2022, 10:12 AM
Harbormaster failed remote builds in B27160: Diff 26287!

Build is green

Patch application report for D7255 (id=26288)

Rebasing onto ec6591f6a9...

Current branch diff-target is up to date.
Changes applied before test
commit 5c11fe2ef48b410edc8a0da890300118a87ffdfb
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Feb 25 10:06:43 2022 +0100

    loader/opam/tests: Do not run actual opam init command call
    
    Instead, this fixes the pseudo fake opam root present in tests datadir folder to the
    right structure and then installs it properly for the test to use.
    
    Another benefit from this is now inhibiting any actual network happening during the opam
    init cli call.
    
    This also reverts the previous commit which added a --yes in the opam init cli.
    This was not working and not the right solution in the end.
    
    Related to T3973

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

swh/loader/package/opam/loader.py
168

Revert previous commit D7248 (which did not work)

This revision was not accepted when it landed; it landed in state Needs Review.Feb 25 2022, 10:24 AM
This revision was automatically updated to reflect the committed changes.