galaxyproject / planemo

Command-line utilities to assist in developing Galaxy and Common Workflow Language artifacts - including tools, workflows, and training materials.
https://planemo.readthedocs.io/
MIT License
90 stars 85 forks source link

Conda Testing #401

Closed jmchilton closed 2 years ago

jmchilton commented 8 years ago

There is a script https://github.com/galaxyproject/planemo/blob/master/tests/scripts/conda_test.sh that demonstrates running planemo around conda. This should be enhanced and included as part of planemo's CI testing.

There are currently no tests of --conda_dependency_resolution. I have been testing manually with project_templates/conda_testing. A test should be developed that exercises this functionality - it would serve as the test for both planemo and Galaxy.

lecorguille commented 8 years ago

Hi,

Because, I have some trouble to use planemo shed_test, I used to use planemo test after having sourced the env.sh of my tools installed through Galaxy and the ToolShed: https://github.com/galaxyproject/planemo/issues/424 But, according to @abretaud, conda may/will replace the tool_dependencies.xml system. It also promote by @mvdbeek. And I think that it's a good choose. So let's test it!

Since a couple of days, I'm testing this feature intensively. Thus I glad to annonce you that my test passed using planemo test --conda_dependency_resolution It work very well and is faster than shed_test since it don't need to install your dependencies each time you launch a test. https://github.com/workflow4metabolomics/xcms/tree/xcmsset_shed_test/galaxy/xcms_xcmsset

If you use planemo conda_init then planemo conda_install . and finally planemo test --install_galaxy --conda_dependency_resolution, it's work!

But concerning --conda_auto_install, when I launch planemo test --install_galaxy --galaxy_branch "dev" --conda_auto_init --conda_auto_install --conda_dependency_resolution --no_cleanup, I get this trace:

galaxy.jobs.runners: ERROR: (1) Failure preparing job
Traceback (most recent call last):
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/jobs/runners/__init__.py", line 166, in prepare_job
    job_wrapper.prepare()
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/jobs/__init__.py", line 893, in prepare
    self.dependency_shell_commands = self.tool.build_dependency_shell_commands(job_directory=self.working_directory)
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/__init__.py", line 1259, in build_dependency_shell_commands
    job_directory=job_directory,
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/deps/__init__.py", line 98, in dependency_shell_commands
    **kwds )
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/deps/__init__.py", line 117, in find_dep
    dependency = resolver.resolve( name, version, type, **kwds )
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/deps/resolvers/conda.py", line 117, in resolve
    install_conda_target(conda_target, conda_context=self.conda_context)
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/deps/conda_util.py", line 280, in install_conda_target
    conda_context.ensure_channels_configured()
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/deps/conda_util.py", line 92, in ensure_channels_configured
    self.save_condarc(conda_conf)
  File "/tmp/tmp8x2nfk/galaxy-dev/lib/galaxy/tools/deps/conda_util.py", line 120, in save_condarc
    raise Exception(message)
Exception: Failed to update write to path [/tmp/tmp8x2nfk/deps/_condarc] while attempting to update conda configuration, please update the configuration to override the condarc location or grant this application write to the parent directory.

If I tried to create this /tmp/tmpXXXXXX/deps quickly as soon as I get the temporary directory name, it's work ... ... almost! Because I get this ambiguous message (the HTML report is green-green-green):

All 1 test(s) executed passed.
abims_xcms_group[0]: failed

A PR about this issue would be sexy. I searched a little in both Galaxy and Planemo code and learned a lot but I guess you will fix this in 2s.

Anyway, so great job! :clap: