-
Notifications
You must be signed in to change notification settings - Fork 5
Running Tests
To run the test suite, simply run:
rspec
or with verbose output:
rspec -f d
To view the coverage report, open
coverage/index.html
rubocop -D
Teaspoon is used for Javascript testing and coverage. It runs Jasmine for unit and integration tests and Istanbul for test coverage.
First install Istanbul:
npm install -g istanbul
To run Teaspoon for unit tests, run:
bundle exec teaspoon
To include Istanbul coverage tests, run:
bundle exec teaspoon --coverage=default
To view interactive report of test coverage, open:
coverage/default/index.html
Trying to use this JShint gem, per its docs:
Add gem jshint
to the Gemfile under group :development, :test
Run bundle
to install, then run bundle exec rake jshint
to run test. Currently this is running the linter then causing a rake error, which appears to be an ongoing issue with this gem.
cd to the folder hubzone-data-etl/test/sql
run sh run_sql_tests.sh
--> all tests should come back passed. If not, then some data import is missing.
If you have a lot of tests failing for missing tables (like the qnmc tables prior to 2016) you will need to run the qnmc historical im
port.
- Copy the contents of
db/imports_all_qnmc_historic.csv
intodb/imports.csv
and re-runrake hz:import
. This will import all the
legacy qnmc tables. - Revert
db/imports.csv
to its original state. - If you re-run your tests now, they should all be passing. These historical files do not appear on the map, but are needed for histor
ical search and for the disaster areas calculations.
For basic linting for syntax errors in ETL SQL files
sqlint ./*/*.sql