2.1 years ago by
Netherlands
Hi plindenbaum,
I am not entirely sure if I understand what you're asking but I'll give it a shot.
First of all planemo is indeed the tool used for testing.
Let's say we have the following tool:
<tool id="test" name="test" version="1.0.0">
<command><![CDATA[
echo "\$HELLO_WORLD" > '$out' ;
]]></command>
<inputs>
</inputs>
<outputs>
<data format="txt" name="out" />
</outputs>
<tests>
<test>
<output name="out" file="out.txt"/>
</test>
</tests>
</tool>
We can load the env-var into a galaxy tool by simply running: export HELLO_WORLD='....'; planemo test tool.xml
.
First planemo is checking the database version of the galaxy instance. If you have not specified a custom galaxy instance, it will use the one that has been installed with planemo which is usually fairly up to date and should not migrate too much. I've also had situations where I get a migration list starting from the beginning once in a while, probably my galaxy version was not configured properly, way out of date or newer than the one shipped with planemo. I don't know the precise scenarios when this is happening, but it is actually incrementally upgrading the galaxy database. If everything goes well it starts at version 120+ or so.
Planemo shall start galaxy and do some magic to simulate a real galaxy environment. Galaxy is running its jobs as child processes, so environment variables shall be passed through. I don't know what you mean with using config/local_envs.sh. If you would like to configure server-wide environment variables that should automatically be loaded during startup of Galaxy, you can configure this in {$galaxy_root}/config/job_conf.xml.
If you would use the following:
<?xml version="1.0"?>
<!-- A sample job config that explicitly configures job running the way it is configured by default (if there is no explicit config). -->
<job_conf>
<plugins>
<plugin id="local" type="runner" load="galaxy.jobs.runners.local:LocalJobRunner" workers="4"/>
</plugins>
<handlers>
<handler id="main"/>
</handlers>
<destinations>
<destination id="local" runner="local">
<env id="HELLO_WORLD_VIA_LOCAL_ENV">via-job-conf.xml</env>
</destination>
</destinations>
</job_conf>
Galaxy shall do the following for you: export HELLO_WORLD_VIA_LOCAL_ENV='via-job-conf.xml'
. You only need to make sure planemo shall use this configuration file. You can do this by configuring a proper galaxy instance in ~/.planemo.yml
and updating the job_conf in the corresponding $galaxy_root/config directory, or run planemo test --job_config_file ....job_conf.xml
. I tested this with the following tool:
<tool id="test" name="test" version="1.0.0">
<command><![CDATA[
echo "\$HELLO_WORLD" > '$out' ;
echo "\$HELLO_WORLD_VIA_LOCAL_ENV" >> '$out' ;
]]></command>
<inputs>
</inputs>
<outputs>
<data format="txt" name="out" />
</outputs>
<tests>
<test>
<output name="out" file="out.txt"/>
</test>
</tests>
</tool>
And I was able to show both environment variables running planemo test --job_config_file ....job_conf.xml test.xml
Let's see if this gets you started. All best,
Youri