Manually installing a Data Manager & running its tests

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Manually installing a Data Manager & running its tests

Peter Cock
Hi all,

I'm currently trying to manually install Dan's example Data Manager
for the NCBI BLAST databases - but without using the Tool Shed:
http://testtoolshed.g2.bx.psu.edu/view/blankenberg/data_manager_example_blastdb_ncbi_update_blastdb

To be precise, I'm currently using a slightly modified version which
we've moved into the Galaxy BLAST+ wrapper repository (thus far,
only slight changes to folder names have been made from Dan's original):
https://github.com/peterjc/galaxy_blast/tree/master/data_managers/ncbi_blastdb
https://github.com/peterjc/galaxy_blast/commit/21d7cff3e8dca13c4bd0f716a79a9f00c59f0b5c

My goal is to be able to run the functional tests,

$ ./run_functional_tests.sh -id data_manager_blast_db

As with any other manually installed tool, I have added this
data-manager to my tool_conf.xml.sample file (and for local
testing via the GUI, the tool_conf.xml file as well):

    <tool file="ncbi_blastdb/blastdb.xml" />

Specific to data-managers, I have manually incorporated
the additions to the central data_manager_conf.xml file
(this would normally be merged at runtime if installed from
the ToolShed):

$ more data_manager_conf.xml
<?xml version="1.0"?>
<data_managers>
    <data_manager tool_file="ncbi_blastdb/blastdb.xml"
id="data_manager_blast_db">
        <data_table name="blastdb">
            <output>
                <column name="value" />
                <column name="name" />
                <column name="path" output_ref="out_file" >
                    <move type="directory">
                        <target
base="${GALAXY_DATA_MANAGER_DATA_PATH}">blastdb/${path}</target>
                    </move>

<value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/blastdb/${path}/${nucleotide_alias_name}</value_translation>
                    <value_translation
type="function">abspath</value_translation>
                </column>
            </output>
        </data_table>
    </data_manager>
</data_managers>

Note the tool_file setting points correctly at the relative path
within the tools
folder, and the tool does define a test:

$ more tools/ncbi_blastdb/blastdb.xml
<tool id="data_manager_blast_db" name="Blast DB" version="0.0.2"
tool_type="manage_data">
    <description>Downloader</description>
...
    <tests>
        <test>
            <param name="blastdb_name" value="est"/>
            <param name="advanced_selector" value="basic"/>
            <output name="out_file" file="est_out.json"/>
        </test>
    </tests>
...

$ ./run_functional_tests.sh -list | grep manager
data_manager_blast_db                            Blast DB

$ ./run_functional_tests.sh -id data_manager_blast_db
...
galaxy.tools DEBUG 2014-04-11 15:59:00,780 Loaded tool id:
data_manager_blast_db, version: 0.0.2 into tool panel.
...
galaxy.tools.data_manager.manager DEBUG 2014-04-11 15:59:00,864 Loaded
Data Manager: data_manager_blast_db
...
Failure: ValueError (No such test TestForTool_data_manager_blast_db) ... ERROR

======================================================================
ERROR: Failure: ValueError (No such test TestForTool_data_manager_blast_db)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/galaxy/galaxy-central/eggs/nose-0.11.1-py2.6.egg/nose/failure.py",
line 39, in runTest
    raise self.exc_class(self.exc_val)
ValueError: No such test TestForTool_data_manager_blast_db

----------------------------------------------------------------------

I get the same error via TravisCI, e.g.
https://travis-ci.org/peterjc/galaxy_blast/builds/22782979

(This suggests using Twill vs the API does not matter)

Am I missing something simple here?

Thanks,

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Manually installing a Data Manager & running its tests

Daniel Blankenberg
Hi Peter,

Looks like you are missing the -data_managers flag, try this:

run_functional_tests.sh -data_managers -id data_manager_blast_db

Let us know if you encounter more issues.

Thanks,

Dan


On Apr 11, 2014, at 12:15 PM, Peter Cock <[hidden email]> wrote:

Hi all,

I'm currently trying to manually install Dan's example Data Manager
for the NCBI BLAST databases - but without using the Tool Shed:
http://testtoolshed.g2.bx.psu.edu/view/blankenberg/data_manager_example_blastdb_ncbi_update_blastdb

To be precise, I'm currently using a slightly modified version which
we've moved into the Galaxy BLAST+ wrapper repository (thus far,
only slight changes to folder names have been made from Dan's original):
https://github.com/peterjc/galaxy_blast/tree/master/data_managers/ncbi_blastdb
https://github.com/peterjc/galaxy_blast/commit/21d7cff3e8dca13c4bd0f716a79a9f00c59f0b5c

My goal is to be able to run the functional tests,

$ ./run_functional_tests.sh -id data_manager_blast_db

As with any other manually installed tool, I have added this
data-manager to my tool_conf.xml.sample file (and for local
testing via the GUI, the tool_conf.xml file as well):

   <tool file="ncbi_blastdb/blastdb.xml" />

Specific to data-managers, I have manually incorporated
the additions to the central data_manager_conf.xml file
(this would normally be merged at runtime if installed from
the ToolShed):

$ more data_manager_conf.xml
<?xml version="1.0"?>
<data_managers>
   <data_manager tool_file="ncbi_blastdb/blastdb.xml"
id="data_manager_blast_db">
       <data_table name="blastdb">
           <output>
               <column name="value" />
               <column name="name" />
               <column name="path" output_ref="out_file" >
                   <move type="directory">
                       <target
base="${GALAXY_DATA_MANAGER_DATA_PATH}">blastdb/${path}</target>
                   </move>

<value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/blastdb/${path}/${nucleotide_alias_name}</value_translation>
                   <value_translation
type="function">abspath</value_translation>
               </column>
           </output>
       </data_table>
   </data_manager>
</data_managers>

Note the tool_file setting points correctly at the relative path
within the tools
folder, and the tool does define a test:

$ more tools/ncbi_blastdb/blastdb.xml
<tool id="data_manager_blast_db" name="Blast DB" version="0.0.2"
tool_type="manage_data">
   <description>Downloader</description>
...
   <tests>
       <test>
           <param name="blastdb_name" value="est"/>
           <param name="advanced_selector" value="basic"/>
           <output name="out_file" file="est_out.json"/>
       </test>
   </tests>
...

$ ./run_functional_tests.sh -list | grep manager
data_manager_blast_db                            Blast DB

$ ./run_functional_tests.sh -id data_manager_blast_db
...
galaxy.tools DEBUG 2014-04-11 15:59:00,780 Loaded tool id:
data_manager_blast_db, version: 0.0.2 into tool panel.
...
galaxy.tools.data_manager.manager DEBUG 2014-04-11 15:59:00,864 Loaded
Data Manager: data_manager_blast_db
...
Failure: ValueError (No such test TestForTool_data_manager_blast_db) ... ERROR

======================================================================
ERROR: Failure: ValueError (No such test TestForTool_data_manager_blast_db)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "/mnt/galaxy/galaxy-central/eggs/nose-0.11.1-py2.6.egg/nose/failure.py",
line 39, in runTest
   raise self.exc_class(self.exc_val)
ValueError: No such test TestForTool_data_manager_blast_db

----------------------------------------------------------------------

I get the same error via TravisCI, e.g.
https://travis-ci.org/peterjc/galaxy_blast/builds/22782979

(This suggests using Twill vs the API does not matter)

Am I missing something simple here?

Thanks,

Peter


___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Manually installing a Data Manager & running its tests

Peter Cock
On Fri, Apr 11, 2014 at 5:29 PM, Daniel Blankenberg <[hidden email]> wrote:

> Hi Peter,
>
> Looks like you are missing the -data_managers flag, try this:
>
> run_functional_tests.sh -data_managers -id data_manager_blast_db
>
> Let us know if you encounter more issues.
>
> Thanks,
>
> Dan

Thank you! That was my silly mistake, it was clearly stated here:
https://wiki.galaxyproject.org/Admin/Tools/DataManagers/Testing

However, adding the switch seems to prevent testing traditional
tools at the same time - is that deliberate? e.g.
https://travis-ci.org/peterjc/galaxy_blast/builds/22788397

Also note the test fails which I suspect is due to the database
changing slightly? Mike is proposing to switch to a regex based
test out the output JSON files for this tool...

$ ./run_functional_tests.sh -data_managers -id data_manager_blast_db
...
base.twilltestcase: DEBUG: Files diff for
'/mnt/galaxy/galaxy-central/test-data/est_out.json' vs
'/tmp/tmpIk35vy/tmpTNneBG/new_files_path_Q3kSF9/tmpl9xH_Qest_out.json'
base.twilltestcase: INFO: ## files diff on
/mnt/galaxy/galaxy-central/test-data/est_out.json and
/tmp/tmpIk35vy/tmpTNneBG/new_files_path_Q3kSF9/tmpl9xH_Qest_out.json
lines_diff=0, found diff = 2
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 24.030s

FAILED (failures=1)
...


Thanks,

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/
Reply | Threaded
Open this post in threaded view
|

Re: Manually installing a Data Manager & running its tests

Peter Cock
On Fri, Apr 11, 2014 at 6:06 PM, Peter Cock <[hidden email]> wrote:

> On Fri, Apr 11, 2014 at 5:29 PM, Daniel Blankenberg <[hidden email]> wrote:
>> Hi Peter,
>>
>> Looks like you are missing the -data_managers flag, try this:
>>
>> run_functional_tests.sh -data_managers -id data_manager_blast_db
>>
>> Let us know if you encounter more issues.
>>
>> Thanks,
>>
>> Dan
>
> Thank you! That was my silly mistake, it was clearly stated here:
> https://wiki.galaxyproject.org/Admin/Tools/DataManagers/Testing
>
> However, adding the switch seems to prevent testing traditional
> tools at the same time - is that deliberate? e.g.
> https://travis-ci.org/peterjc/galaxy_blast/builds/22788397
>
> Also note the test fails which I suspect is due to the database
> changing slightly? Mike is proposing to switch to a regex based
> test out the output JSON files for this tool...
>
> $ ./run_functional_tests.sh -data_managers -id data_manager_blast_db
> ...
> base.twilltestcase: DEBUG: Files diff for
> '/mnt/galaxy/galaxy-central/test-data/est_out.json' vs
> '/tmp/tmpIk35vy/tmpTNneBG/new_files_path_Q3kSF9/tmpl9xH_Qest_out.json'
> base.twilltestcase: INFO: ## files diff on
> /mnt/galaxy/galaxy-central/test-data/est_out.json and
> /tmp/tmpIk35vy/tmpTNneBG/new_files_path_Q3kSF9/tmpl9xH_Qest_out.json
> lines_diff=0, found diff = 2
> --------------------- >> end captured logging << ---------------------
>
> ----------------------------------------------------------------------
> Ran 1 test in 24.030s
>
> FAILED (failures=1)
> ...

After a few missteps, I got this to run under TravisCI.

This time the twill based test failed to download the est database
(perhaps just a network glitch), but more interestingly this appears
to show a bug with the API based testing (Hi John!):

https://travis-ci.org/peterjc/galaxy_blast/builds/22938945

Running this locally,

$ export GALAXY_TEST_DB_TEMPLATE=https://github.com/jmchilton/galaxy-downloads/raw/master/db_gx_rev_0117.sqlite
$ export GALAXY_TEST_DEFAULT_INTERACTOR=api
$ ./run_functional_tests.sh -data_managers -id data_manager_blast_db
...
galaxy.jobs.handler DEBUG 2014-04-14 12:19:39,558 (1) Dispatching to
local runner
ERROR

======================================================================
ERROR: Blast DB ( data_manager_blast_db ) > Test-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/galaxy/galaxy-central/test/functional/test_data_managers.py",
line 99, in test_tool
    self.do_it( td )
  File "/mnt/galaxy/galaxy-central/test/functional/test_data_managers.py",
line 34, in do_it
    for assoc in reversed( test_history.user.data_manager_histories ):
AttributeError: 'unicode' object has no attribute 'user'
-------------------- >> begin captured logging << --------------------
galaxy.web.framework: INFO: Session authenticated using Galaxy master api key
galaxy.web.framework: INFO: Session authenticated using Galaxy master api key
galaxy.web.framework: INFO: Session authenticated using Galaxy master api key
galaxy.jobs: DEBUG: (1) Working directory for job is:
/tmp/tmpE6lJPe/tmpNq68Jz/job_working_directory_5lfI0i/000/1
galaxy.jobs.handler: DEBUG: (1) Dispatching to local runner
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 3.060s

FAILED (errors=1)
...
galaxy.jobs.handler ERROR 2014-04-14 12:19:39,895 Exception in monitor_step
Traceback (most recent call last):
  File "/mnt/galaxy/galaxy-central/lib/galaxy/jobs/handler.py", line
154, in __monitor
    self.__monitor_step()
  File "/mnt/galaxy/galaxy-central/lib/galaxy/jobs/handler.py", line
264, in __monitor_step
    log.exception( "failure running job %d" % job.id )
...
  File "/mnt/galaxy/galaxy-central/eggs/SQLAlchemy-0.7.9-py2.6-linux-x86_64-ucs4.egg/sqlalchemy/engine/default.py",
line 281, in connect
    return self.dbapi.connect(*cargs, **cparams)
OperationalError: (OperationalError) unable to open database file None None
...


Regards,

Peter
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/