Skip to content
Closed
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: python
python:
- "2.7"

install:
- sudo apt-get update
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a

- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
- source activate test-environment
- conda config --add channels conda-forge
- conda config --add channels bioconda
- conda config --add channels anaconda
- conda config --add channels workflowconversion

# - git clone https://github.com/WorkflowConversion/CTDopts $HOME/CTDopts
- git clone -b topic/empty_numeric_defaults https://github.com/bernt-matthias/CTDopts $HOME/CTDopts
- cd $HOME/CTDopts
- python setup.py install
- conda install -c conda-forge lxml
- conda install -c conda-forge ruamel.yaml
- conda install libxml2
- cd $TRAVIS_BUILD_DIR
- python setup.py install

- conda install coverage green codecov

script:
- python setup.py test

after_script:
- python -m codecov
Empty file added tests/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions tests/test-data/bool.ctd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<tool ctdVersion="1.7" version="2.3.0" name="echo BoolTest" docurl="http://docs.are/unavailable.html" category="Bool Test" >
<description><![CDATA[Bool parameter tests]]></description>
<manual><![CDATA[Bool parameter tests.]]></manual>
<PARAMETERS version="1.6.2" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/OpenMS/OpenMS/develop/share/OpenMS/SCHEMAS/Param_1_6_2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NODE name="BoolTest" description="Bool test.">
<ITEM name="version" value="2.3.0" type="string" description="Version of the tool that generated this parameters file." required="false" advanced="true" />
<NODE name="1" description="Instance &apos;1&apos; section for &apos;BoolTest&apos;">
<!-- note bool parameters seem to be always required false -->
<ITEM name="true_optional_unrestricted" value="true" type="string" description="bool" required="false" advanced="false" restrictions="true,false"/>
<ITEM name="false_optional_unrestricted" value="false" type="string" description="bool" required="false" advanced="false" restrictions="true,false"/>
<ITEM name="true_optional_unrestricted_adv" value="true" type="string" description="bool" required="false" advanced="true" restrictions="true,false"/>
<ITEM name="false_optional_unrestricted_adv" value="false" type="string" description="bool" required="false" advanced="true" restrictions="true,false"/>
</NODE>
</NODE>
</PARAMETERS>
</tool>
62 changes: 62 additions & 0 deletions tests/test-data/bool.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--This is a configuration file for the integration of a tools into Galaxy (https://galaxyproject.org/). This file was automatically generated using CTDConverter.-->
<!--Proposed Tool Section: [Bool Test]-->
<tool id="echo BoolTest" name="echo BoolTest" version="2.3.0">
<description>Bool parameter tests</description>
<macros>
<token name="@EXECUTABLE@">echo BoolTest</token>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<expand macro="stdio"/>
<expand macro="references"/>
<command>echo BoolTest

#if $param_true_optional_unrestricted:
-true_optional_unrestricted
#if " " in str($param_true_optional_unrestricted):
"$param_true_optional_unrestricted"
#else
$param_true_optional_unrestricted
#end if
#end if
#if $param_false_optional_unrestricted:
-false_optional_unrestricted
#end if
#if $adv_opts.adv_opts_selector=='advanced':
#if $adv_opts.param_true_optional_unrestricted_adv:
-true_optional_unrestricted_adv
#if " " in str($adv_opts.param_true_optional_unrestricted_adv):
"$adv_opts.param_true_optional_unrestricted_adv"
#else
$adv_opts.param_true_optional_unrestricted_adv
#end if
#end if
#if $adv_opts.param_false_optional_unrestricted_adv:
-false_optional_unrestricted_adv
#end if
#end if
&gt; $param_stdout
</command>
<inputs>
<param name="param_true_optional_unrestricted" display="radio" type="select" optional="False" value="true" label="bool" help="(-true_optional_unrestricted) ">
<option value="true" selected="true">true</option>
<option value="false">false</option>
</param>
<param name="param_false_optional_unrestricted" display="radio" type="boolean" truevalue="-false_optional_unrestricted" falsevalue="" checked="false" optional="True" label="bool" help="(-false_optional_unrestricted) "/>
<expand macro="advanced_options">
<param name="param_true_optional_unrestricted_adv" display="radio" type="select" optional="False" value="true" label="bool" help="(-true_optional_unrestricted_adv) ">
<option value="true" selected="true">true</option>
<option value="false">false</option>
</param>
<param name="param_false_optional_unrestricted_adv" display="radio" type="boolean" truevalue="-false_optional_unrestricted_adv" falsevalue="" checked="false" optional="True" label="bool" help="(-false_optional_unrestricted_adv) "/>
</expand>
</inputs>
<outputs>
<data name="param_stdout" format="txt" label="Output from stdout"/>
</outputs>
<help>Bool parameter tests.


For more information, visit http://docs.are/unavailable.html</help>
</tool>
12 changes: 12 additions & 0 deletions tests/test-data/empty.ctd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<tool ctdVersion="1.7" version="2.3.0" name="echo StringTest" docurl="http://docs.are/unavailable.html" category="String Test" >
<description><![CDATA[String parameter tests]]></description>
<manual><![CDATA[String parameter tests.]]></manual>
<PARAMETERS version="1.6.2" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/OpenMS/OpenMS/develop/share/OpenMS/SCHEMAS/Param_1_6_2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NODE name="StringTest" description="String test.">
<ITEM name="version" value="2.3.0" type="string" description="Version of the tool that generated this parameters file." required="false" advanced="true" />
<NODE name="1" description="Instance &apos;1&apos; section for &apos;StringTest&apos;">
</NODE>
</NODE>
</PARAMETERS>
</tool>
25 changes: 25 additions & 0 deletions tests/test-data/empty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--This is a configuration file for the integration of a tools into Galaxy (https://galaxyproject.org/). This file was automatically generated using CTDConverter.-->
<!--Proposed Tool Section: [String Test]-->
<tool id="echo StringTest" name="echo StringTest" version="2.3.0">
<description>String parameter tests</description>
<macros>
<token name="@EXECUTABLE@">echo StringTest</token>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<expand macro="stdio"/>
<expand macro="references"/>
<command>echo StringTest

&gt; $param_stdout
</command>
<inputs/>
<outputs>
<data name="param_stdout" format="txt" label="Output from stdout"/>
</outputs>
<help>String parameter tests.


For more information, visit http://docs.are/unavailable.html</help>
</tool>
4 changes: 4 additions & 0 deletions tests/test-data/filetypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CTD type # Galaxy type # Long Galaxy data type # Mimetype
ext txt galaxy.datatypes.data:Text
eyt txt galaxy.datatypes.data:Text
ezt txt galaxy.datatypes.data:Text
47 changes: 47 additions & 0 deletions tests/test-data/float.ctd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<tool ctdVersion="1.7" version="2.3.0" name="echo FloatTest" docurl="http://docs.are/unavailable.html" category="String Test" >
<description><![CDATA[Floateger parameter tests]]></description>
<manual><![CDATA[Floateger parameter tests.]]></manual>
<PARAMETERS version="1.6.2" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/OpenMS/OpenMS/develop/share/OpenMS/SCHEMAS/Param_1_6_2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NODE name="FloategerTest" description="Float test.">
<ITEM name="version" value="2.3.0" type="string" description="Version of the tool that generated this parameters file." required="false" advanced="true" />
<NODE name="1" description="Instance &apos;1&apos; section for &apos;FloategerTest&apos;">
<ITEM name="param_wodefault_mandatory_unrestricted" value="" type="double" description="float" required="true" advanced="false" />
<ITEM name="param_default_mandatory_unrestricted" value="0.0" type="double" description="float" required="true" advanced="false" />
<ITEM name="param_wodefault_optional_unrestricted" value="" type="double" description="float" required="false" advanced="false" />
<ITEM name="param_default_optional_unrestricted" value="0.0" type="double" description="float" required="false" advanced="false" />
<ITEM name="param_wodefault_mandatory_unrestricted_adv" value="" type="double" description="float" required="true" advanced="true" />
<ITEM name="param_default_mandatory_unrestricted_adv" value="0.0" type="double" description="float" required="true" advanced="true" />
<ITEM name="param_wodefault_optional_unrestricted_adv" value="" type="double" description="float" required="false" advanced="true" />
<ITEM name="param_default_optional_unrestricted_adv" value="0.0" type="double" description="float" required="false" advanced="true" />

<ITEM name="param_wodefault_mandatory_unrestricted_min" value="" type="double" description="float" required="true" advanced="false" restrictions="0.0:"/>
<ITEM name="param_default_mandatory_unrestricted_min" value="0.0" type="double" description="float" required="true" advanced="false" restrictions="0.0:"/>
<ITEM name="param_wodefault_optional_unrestricted_min" value="" type="double" description="float" required="false" advanced="false" restrictions="0.0:"/>
<ITEM name="param_default_optional_unrestricted_min" value="0.0" type="double" description="float" required="false" advanced="false" restrictions="0.0:"/>
<ITEM name="param_wodefault_mandatory_unrestricted_adv_min" value="" type="double" description="float" required="true" advanced="true" restrictions="0.0:"/>
<ITEM name="param_default_mandatory_unrestricted_adv_min" value="0.0" type="double" description="float" required="true" advanced="true" restrictions="0.0:"/>
<ITEM name="param_wodefault_optional_unrestricted_adv_min" value="" type="double" description="float" required="false" advanced="true" restrictions="0.0:"/>
<ITEM name="param_default_optional_unrestricted_adv_min" value="0.0" type="double" description="float" required="false" advanced="true" restrictions="0.0:"/>

<ITEM name="param_wodefault_mandatory_unrestricted_max" value="" type="double" description="float" required="true" advanced="false" restrictions=":100.0"/>
<ITEM name="param_default_mandatory_unrestricted_max" value="0.0" type="double" description="float" required="true" advanced="false" restrictions=":100.0"/>
<ITEM name="param_wodefault_optional_unrestricted_max" value="" type="double" description="float" required="false" advanced="false" restrictions=":100.0"/>
<ITEM name="param_default_optional_unrestricted_max" value="0.0" type="double" description="float" required="false" advanced="false" restrictions=":100.0"/>
<ITEM name="param_wodefault_mandatory_unrestricted_adv_max" value="" type="double" description="float" required="true" advanced="true" restrictions=":100.0"/>
<ITEM name="param_default_mandatory_unrestricted_adv_max" value="0.0" type="double" description="float" required="true" advanced="true" restrictions=":100.0"/>
<ITEM name="param_wodefault_optional_unrestricted_adv_max" value="" type="double" description="float" required="false" advanced="true" restrictions=":100.0"/>
<ITEM name="param_default_optional_unrestricted_adv_max" value="0.0" type="double" description="float" required="false" advanced="true" restrictions=":100.0"/>

<ITEM name="param_wodefault_mandatory_unrestricted_minmax" value="" type="double" description="float" required="true" advanced="false" restrictions="0.0:100.0"/>
<ITEM name="param_default_mandatory_unrestricted_minmax" value="0.0" type="double" description="float" required="true" advanced="false" restrictions="0.0:100.0"/>
<ITEM name="param_wodefault_optional_unrestricted_minmax" value="" type="double" description="float" required="false" advanced="false" restrictions="0.0:100.0"/>
<ITEM name="param_default_optional_unrestricted_minmax" value="0.0" type="double" description="float" required="false" advanced="false" restrictions="0.0:100.0"/>
<ITEM name="param_wodefault_mandatory_unrestricted_adv_minmax" value="" type="double" description="float" required="true" advanced="true" restrictions="0.0:100.0"/>
<ITEM name="param_default_mandatory_unrestricted_adv_minmax" value="0.0" type="double" description="float" required="true" advanced="true" restrictions="0.0:100.0"/>
<ITEM name="param_wodefault_optional_unrestricted_adv_minmax" value="" type="double" description="float" required="false" advanced="true" restrictions="0.0:100.0"/>
<ITEM name="param_default_optional_unrestricted_adv_minmax" value="0.0" type="double" description="float" required="false" advanced="true" restrictions="0.0:100.0"/>
</NODE>
</NODE>
</PARAMETERS>
</tool>
Loading