Skip to content

Commit

Permalink
Added commands to generate lcov data; #20
Browse files Browse the repository at this point in the history
- bin/setupTestDatabases.sh - Added commands to install NPM modules so
  that istanbul can generate the coverage data needed by Code Climate
  • Loading branch information
msnyon committed Jan 30, 2016
1 parent 41616de commit 2b9bcf5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/setupTestDatabases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
cp config/config.json.tmpl config/config.json # Copy template file to template
sed -i -- 's/"_INSERT USERNAME_"/"postgres"/g' config/config.json # change username for db
sed -i -- 's/"_INSERT PASSWORD_"/""/g' config/config.json # change password for db

# Drop and create the test database
if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS drywall-test;' -U postgres; fi
if [ '$DB' = 'pgsql' ]; then psql -c 'create database drywall-test;' -U postgres; fi
# set up Codeclimate to be run on the codebase
CODECLIMATE_REPO_TOKEN=d59a2529d82564323b652ad2e84bfc4b477270f97207045fd7cd03d38d50ef22 codeclimate-test-reporter < coverage/lcov.info

# Run the code test coverage script. Install istanbul & mocha to run
# the script to create the lcov files.
npm install -g istanbul
npm install -g mocha
npm install -g codeclimate-test-reporter
istanbul cover test.js
codeclimate-test-reporter < lcov.info

0 comments on commit 2b9bcf5

Please sign in to comment.