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 bunch of tests for new linting logic. #638

Merged
merged 1 commit into from
Feb 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ virtualenv
lxml
gxformat2>=0.1.1
ephemeris>=0.2.0
galaxy-lib>=17.5.0
galaxy-lib>=17.5.1
html5lib>=0.9999999,!=0.99999999,!=0.999999999,!=1.0b10,!=1.0b09 ; python_version == '2.7'
cwltool==1.0.20160726135535 ; python_version == '2.7'
30 changes: 30 additions & 0 deletions tests/data/tools/fail_bad_profile_1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<tool id="fail_bad_profile_1" name="fail_bad_profile_1" version="1.0" profile="16.01.">
<description>select param</description>
<command><![CDATA[
echo "$select_opt" > $output
]]></command>
<inputs>
<param name="select_opt" type="select" label="Option">
<option value="moo">Cow</option>
</param>
</inputs>
<outputs>
<data name="output" format="txt"/>
</outputs>
<tests>
<test>
<param name="select_opt" value="Hello World!" />
<output name="output">
<assert_contents>
<has_line line="Hello World!" />
</assert_contents>
</output>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
30 changes: 30 additions & 0 deletions tests/data/tools/fail_bad_profile_2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<tool id="fail_bad_profile_2" name="fail_bad_profile_2" version="1.0" profile="04.12">
<description>select param</description>
<command><![CDATA[
echo "$select_opt" > $output
]]></command>
<inputs>
<param name="select_opt" type="select" label="Option">
<option value="moo">Cow</option>
</param>
</inputs>
<outputs>
<data name="output" format="txt"/>
</outputs>
<tests>
<test>
<param name="select_opt" value="Hello World!" />
<output name="output">
<assert_contents>
<has_line line="Hello World!" />
</assert_contents>
</output>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
30 changes: 30 additions & 0 deletions tests/data/tools/fail_bad_profile_3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<tool id="fail_bad_profile_3" name="fail_bad_profile_3" version="1.0" profile="16.34">
<description>select param</description>
<command><![CDATA[
echo "$select_opt" > $output
]]></command>
<inputs>
<param name="select_opt" type="select" label="Option">
<option value="moo">Cow</option>
</param>
</inputs>
<outputs>
<data name="output" format="txt"/>
</outputs>
<tests>
<test>
<param name="select_opt" value="Hello World!" />
<output name="output">
<assert_contents>
<has_line line="Hello World!" />
</assert_contents>
</output>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
31 changes: 31 additions & 0 deletions tests/data/tools/fail_data_name.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<tool id="fail_data_name" name="fail_data_name" version="1.0">
<description>select param</description>
<command><![CDATA[
echo "$select_opt" > $output
]]>
</command>
<inputs>
<param name="select_opt" type="select" label="Option">
<option value="moo">Cow</option>
</param>
</inputs>
<outputs>
<data name="output" format="txt"/>
</outputs>
<tests>
<test>
<param name="select_opt" value="Hello World!" />
<output>
<assert_contents>
<has_line line="Hello World!" />
</assert_contents>
</output>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
30 changes: 30 additions & 0 deletions tests/data/tools/fail_name_mismatch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<tool id="fail_name_mismatch" name="fail_name_mismatch" version="1.0">
<description>select param</description>
<command><![CDATA[
echo "$select_opt" > $output
]]></command>
<inputs>
<param name="select_opt" type="select" label="Option">
<option value="moo">Cow</option>
</param>
</inputs>
<outputs>
<data name="output" format="txt"/>
</outputs>
<tests>
<test>
<param name="select_opt" value="Hello World!" />
<output name="output1">
<assert_contents>
<has_line line="Hello World!" />
</assert_contents>
</output>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
36 changes: 36 additions & 0 deletions tests/data/tools/fail_output_collection_name_mismatch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<tool id="fail_output_collection_name_mismatch" name="fail_output_collection_name_mismatch" version="1.0.0">
<command><![CDATA[
mkdir outputs; cd outputs; awk '{ print \$2 > \$1 ".tabular" }' $input1
]]></command>
<inputs>
<param name="input1" type="data" label="Input Table" help="Table to split on first column" format="tabular" />
</inputs>
<outputs>
<collection name="split_output" type="list" label="Table split on first column">
<discover_datasets pattern="__name_and_ext__" directory="outputs" />
</collection>
</outputs>
<tests>
<test>
<param name="input1" value="tinywga.fam" />
<output_collection name="split_outputx" type="list">
<element name="101">
<assert_contents>
<has_text_matching expression="^1\n2\n3\n$" />
</assert_contents>
</element>
<element name="1334">
<assert_contents>
<has_text_matching expression="^1\n10\n11\n12\n13\n2\n$" />
</assert_contents>
</element>
</output_collection>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
36 changes: 36 additions & 0 deletions tests/data/tools/fail_output_collection_name_missing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<tool id="fail_output_collection_name_missing" name="fail_output_collection_name_missing" version="1.0.0">
<command><![CDATA[
mkdir outputs; cd outputs; awk '{ print \$2 > \$1 ".tabular" }' $input1
]]></command>
<inputs>
<param name="input1" type="data" label="Input Table" help="Table to split on first column" format="tabular" />
</inputs>
<outputs>
<collection name="split_output" type="list" label="Table split on first column">
<discover_datasets pattern="__name_and_ext__" directory="outputs" />
</collection>
</outputs>
<tests>
<test>
<param name="input1" value="tinywga.fam" />
<output_collection type="list">
<element name="101">
<assert_contents>
<has_text_matching expression="^1\n2\n3\n$" />
</assert_contents>
</element>
<element name="1334">
<assert_contents>
<has_text_matching expression="^1\n10\n11\n12\n13\n2\n$" />
</assert_contents>
</element>
</output_collection>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
4 changes: 2 additions & 2 deletions tests/data/tools/ok_select_param.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<tool id="ok_select_param" name="ok_select_param" version="1.0">
<description>select param</description>
<command>
<command><![CDATA[
echo "$select_opt" > $output
</command>
]]></command>
<inputs>
<param name="select_opt" type="select" label="Option">
<option value="moo">Cow</option>
Expand Down
26 changes: 26 additions & 0 deletions tests/data/tools/ok_test_assert_command.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<tool id="copy" name="Copy Dataset" version="1.0">
<description>copies a dataset</description>
<command>
cp $input $output
</command>
<inputs>
<param name="input1" type="data" format="txt" label="Concatenate Dataset"/>
</inputs>
<outputs>
<data name="output" format="txt"/>
</outputs>
<tests>
<test>
<param name="input1" value="1.bed"/>
<assert_command>
<has_text text="cp " />
</assert_command>
</test>
</tests>
<help>
Some Awesome Help!
</help>
<citations>
<citation type="doi">10.1101/014043</citation>
</citations>
</tool>
4 changes: 2 additions & 2 deletions tests/data/tools/ok_test_output_collections.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tool id="collection_split_on_column" name="collection_split_on_column" version="1.0.0">
<command>
<command><![CDATA[
mkdir outputs; cd outputs; awk '{ print \$2 > \$1 ".tabular" }' $input1
</command>
]]></command>
<inputs>
<param name="input1" type="data" label="Input Table" help="Table to split on first column" format="tabular" />
</inputs>
Expand Down