Skip to content

Test Errors on a readonly file system #1916

Closed
@satra

Description

@satra

Summary

When running nipype tests in a singularity container it fails because the tests try to create files in a read only file system.

Actual behavior

============================================= FAILURES ==============================================
____________________________ [doctest] nipype.interfaces.dcm2nii.Dcm2nii ____________________________
069 
070     Examples
071     ========
072 
073     >>> from nipype.interfaces.dcm2nii import Dcm2nii
074     >>> converter = Dcm2nii()
075     >>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
076     >>> converter.inputs.gzip_output = True
077     >>> converter.inputs.output_dir = '.'
078     >>> converter.cmdline # doctest: +ALLOW_UNICODE
UNEXPECTED EXCEPTION: OSError(30, 'Read-only file system')
Traceback (most recent call last):

  File "/opt/conda/lib/python3.5/doctest.py", line 1321, in __run
    compileflags, 1), test.globs)

  File "<doctest nipype.interfaces.dcm2nii.Dcm2nii[5]>", line 1, in <module>

  File "/opt/conda/lib/python3.5/site-packages/nipype/interfaces/base.py", line 1678, in cmdline
    allargs = self._parse_inputs()

  File "/opt/conda/lib/python3.5/site-packages/nipype/interfaces/base.py", line 1911, in _parse_inputs
    value = self._gen_filename(name)

  File "/opt/conda/lib/python3.5/site-packages/nipype/interfaces/dcm2nii.py", line 198, in _gen_filename
    with open(config_file, "w") as f:

OSError: [Errno 30] Read-only file system: 'config.ini'

/opt/conda/lib/python3.5/site-packages/nipype/interfaces/dcm2nii.py:78: UnexpectedException
_________________________________________ test_level1design _________________________________________

    def test_level1design():
        l = Level1Design()
        runinfo = dict(cond=[{'name': 'test_condition', 'onset': [0, 10],
                              'duration':[10, 10]}],regress=[])
        runidx = 0
        contrasts = Undefined
        do_tempfilter = False
        orthogonalization = {}
        basic_ev_parameters = {'temporalderiv':False}
        convolution_variants = [
            ('custom', 7, {'temporalderiv':False, 'bfcustompath':'/some/path'}),
            ('hrf', 3, basic_ev_parameters),
            ('dgamma', 3, basic_ev_parameters),
            ('gamma', 2, basic_ev_parameters),
            ('none', 0, basic_ev_parameters)
            ]
        for key, val, ev_parameters in convolution_variants:
            output_num, output_txt = Level1Design._create_ev_files(l, os.getcwd(),
                                                                   runinfo, runidx,
                                                                   ev_parameters,
                                                                   orthogonalization,
                                                                   contrasts,
                                                                   do_tempfilter,
>                                                                  key)

../../interfaces/fsl/tests/test_Level1Design_functions.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../interfaces/fsl/model.py:227: in _create_ev_files
    self._create_ev_file(evfname, evinfo)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <nipype.interfaces.fsl.model.Level1Design object at 0x2aab14958470>
evfname = '/opt/conda/lib/python3.5/site-packages/nipype/testing/data/ev_test_condition_0_1.txt'
evinfo = [[0, 10, 1], [10, 10, 1]]

    def _create_ev_file(self, evfname, evinfo):
>       f = open(evfname, 'wt')
E       OSError: [Errno 30] Read-only file system: '/opt/conda/lib/python3.5/site-packages/nipype/testing/data/ev_test_condition_0_1.txt'

../../interfaces/fsl/model.py:124: OSError
================== 2 failed, 2483 passed, 25 skipped, 7 xfailed in 317.66 seconds ===================

Expected behavior

Tests pass

How to replicate the behavior

pytest --doctest-modules -p no:cacheprovider /opt/conda/lib/python3.5/site-packages/nipype

Platform details:

please paste the output of: python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"

$ python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"
{'traits_version': '4.6.0', 'sys_version': '3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:53:06) \n[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]', 'commit_source': 'archive substitution', 'sys_platform': 'linux', 'nibabel_version': '2.1.0', 'scipy_version': '0.19.0', 'pkg_path': '/opt/conda/lib/python3.5/site-packages/nipype', 'numpy_version': '1.11.3', 'nipype_version': '0.13.0-dev', 'networkx_version': '1.11', 'commit_hash': '%h', 'sys_executable': '/opt/conda/bin/python'}
0.13.0-dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions