This is the web front end for the MIDAS sample metadata repository, funded by the Human Innovation Challenge Fund. The website is a Catalyst application, backed by a relational database (we use MySQL).
git clone https://github.com/sanger-pathogens/MIDAS.git
The webapp requires, at a minimum, the following Perl modules:
- Catalyst::Runtime
- DBIx::Class
- Template
- Bio::Metadata::Validator
- Bio::HICF::Schema
For now there is no definitive list of lesser dependencies. Start the app and enjoy a game of whack-a-mole with CPAN.
We use several nodejs-based build tools, coordinated by Grunt. You'll need to install several dependencies:
Start with node/npm and install the rest using
npm install -g grunt
and similar. For OS X, the easiest way to install way to install node is using Homebrew.
The checkout contains a package.json
package list, which can be
handed to npm
:
cd MIDAS
npm install
(before running npm install
you need to configure proxies:
export http_proxy=http://<proxy host>:<proxy port>
export https_proxy=http://<proxy host>:<proxy port>
otherwise downloading packages through the firewall fails.)
You may also need to install grunt-cli
as a global package:
npm install -g grunt-cli
There are two sets of tests. There are Perl tests that exercise the webapp and its integration with the DB, and JS tests that test the front-end.
The perl tests check the page contents and API:
CATALYST_DEBUG=0 DBIC_TRACE=0 prove -lr t
You can turn on catalyst debugging and DBIC query logging by adding environment variables to the command line:
CATALYST_DEBUG=1 DBIC_TRACE=1 prove -lr t
The output will be significantly more verbose.
The front-end tests use the Mocha testing framework and the ChaiJS assertion library. We use CasperJS, a headless WebKit browser, to test the front-end javascript. The interaction between Mocha and CasperJS is coordinated by mocha-casperjs.
The Perl tests start a headless server and use that, but the front-end
tests need a server to be running already. Start it using the
run_test_server.sh
script:
cd MIDAS/app
sh run_test_server.sh
Run the tests themselves like:
cd MIDAS/test
mocha-casperjs 01_summary.js