cfpb / college-costs

⚠️ Deprecated: see note. ⚠️ A tool to help students weigh the costs and rewards of a college program.
https://www.consumerfinance.gov/paying-for-college2/understanding-your-financial-aid-offer/about-this-tool/
50 stars 27 forks source link

Support optional testing of other databases #314

Closed chosak closed 6 years ago

chosak commented 6 years ago

This change adds support for using the DATABASE_URL environment variable to specify Django's dev/test database, based on the dj-database-url package.

It lets you run tests against e.g. Postgres:

$ DATABASE_URL=postgres://user@localhost/db ./pytest.sh

(Note that this will require first creating a local database and pip installing psycopg2==2.7.3.2.)

It adds dj-database-url==0.4.2 to the dev/test requirements as that matches the current version in cfgov-refresh.

It also excludes the Django settings files from coverage because otherwise the new logic would reduce the coverage of this repo.

Notes

Checklist

chosak commented 6 years ago

Travis build seems to have failed for similar reason to #313. @sebworks could this be a Node version thing?

higs4281 commented 6 years ago

Travis build seems to have failed

The front-end build (setup.sh) uses node 6 and fails with 8.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 9d984624a5b9e95cab7db127db99e6f1e13f6d9e on test-other-dbs into 353aacb3d44a756ba755de4fc45486a4e42a27d5 on master.

chosak commented 6 years ago

Thanks for the review @higs4281!

Interesting, it fails even though the .travis.yml file specifies nodejs: 6.

I've addressed this before in regulations-site#847 by explicitly calling nvm use 6 in the Travis before_install step. I added that here in 9d98462 and that seems to have fixed the build.