ganga icon indicating copy to clipboard operation
ganga copied to clipboard

udocker installation test is failing

Open egede opened this issue 2 years ago • 0 comments

The udocker installation test is failing. This is actually due to a bug in the code which does not deal correctly with a tarball not downloading.

(ganga) [laptop] ~/programming/ganga/ganga develop % pytest ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationInstallUDocker.py
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.8.14, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /home/egede/programming/ganga/bin/python
cachedir: .pytest_cache
rootdir: /home/egede/programming/ganga/ganga, configfile: setup.cfg
plugins: pylint-0.18.0, mock-3.6.1, cov-2.12.1
collected 2 items                                                                                                                                                                                                                            

ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationInstallUDocker.py::TestInstallUDocker::test_installUDocker_download_fail PASSED                                                                                           [ 50%]
ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationInstallUDocker.py::TestInstallUDocker::test_installUDocker_success FAILED                                                                                                 [100%]

================================================================================================================== FAILURES ==================================================================================================================
_______________________________________________________________________________________________ TestInstallUDocker.test_installUDocker_success _______________________________________________________________________________________________

self = <TestUtilitiesVirtualizationInstallUDocker.TestInstallUDocker testMethod=test_installUDocker_success>, mock_subprocess_call = <MagicMock name='call' id='139888939321424'>

    @patch('subprocess.call')
    def test_installUDocker_success(self, mock_subprocess_call):
        mock_subprocess_call.side_effect = [0, 0]
        with tempfile.TemporaryDirectory() as dir:
>           installUdocker(dir)

ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationInstallUDocker.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ganga/GangaCore/Utility/Virtualization.py:101: in installUdocker
    returnCode = subprocess.call([os.path.join(location, "udocker", "udocker"), "install"])
/usr/lib64/python3.8/unittest/mock.py:1081: in __call__
    return self._mock_call(*args, **kwargs)
/usr/lib64/python3.8/unittest/mock.py:1085: in _mock_call
    return self._execute_mock_call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <MagicMock name='call' id='139888939321424'>, args = (['/tmp/tmpsr0uln4l/udocker/udocker', 'install'],), kwargs = {}, effect = <list_iterator object at 0x7f3a6ec91820>

    def _execute_mock_call(self, /, *args, **kwargs):
        # separate from _increment_mock_call so that awaited functions are
        # executed separately from their call, also AsyncMock overrides this method
    
        effect = self.side_effect
        if effect is not None:
            if _is_exception(effect):
                raise effect
            elif not _callable(effect):
>               result = next(effect)
E               StopIteration

/usr/lib64/python3.8/unittest/mock.py:1142: StopIteration
========================================================================================================== short test summary info ===========================================================================================================
FAILED ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationInstallUDocker.py::TestInstallUDocker::test_installUDocker_success - StopIteration

egede avatar Oct 20 '22 00:10 egede