Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a single test failing with permission denied when running in docker as a "pliers" user #349

Open
yarikoptic opened this issue May 10, 2019 · 0 comments

Comments

@yarikoptic
Copy link
Contributor

on top of #347 decided to add running tests while building docker image from within WORKDIR... the only one failing is

=================================== FAILURES ===================================
________________________ test_load_from_standard_paths _________________________

    def test_load_from_standard_paths():

        # Verify defaults
        reset_options(update_from_file=False)
        assert pliers.config._settings == pliers.config._default_settings

        # Verify that PLIERS_CONFIG and local dir take precedence
        env_config = {"n_jobs": 200, "log_transformations": False}
        cwd_config = {"log_transformations": True, "parallelize": True}

        handle, f = tempfile.mkstemp(suffix='.json')
        json.dump(env_config, open(f, 'w'))
        os.environ['PLIERS_CONFIG'] = f

        target = 'pliers_config.json'
        if os.path.exists(target):
            pytest.skip("Cannot test pliers config because the default config file"
                        " (pliers_config.json) already exists in the current "
                        "working directory. Skipping test to avoid overwriting.")
>       json.dump(cwd_config, open(target, 'w'))
E       PermissionError: [Errno 13] Permission denied: 'pliers_config.json'

/opt/pliers/pliers/tests/test_config.py:28: PermissionError
=============================== warnings summary ===============================

shouldn't it just skip the test then?
or ideally never write in the current directory. also it would fail now if config exists but a broken symlink (annexed file) -- use lexists not just exists for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant