openactive-archive / conformance-services

Harvests and normalises OpenActive Opportunity feeds to a common representation
MIT License
0 stars 0 forks source link

Database for tests #99

Open rhiaro opened 4 years ago

rhiaro commented 4 years ago

I keep forgetting to change the db when I run tests which affect the database, so I end up dropping my local database and it's a bit inconvenient to have to re-download loads of raw data again for development.

Can we add a postgres URL to settings for a test database, and use that by default in all the tests to avoid this happening?

odscjames commented 4 years ago

We can add something to settings, but then we'd have to be able to detect we were in tests somehow and switch to using the test URL instead of the real one. I don't know if mocha has anything that would help with that, I'd have to look.

rhiaro commented 4 years ago

I think it would be fine in the tests to pass something when initiating the db connection rather than having it detect it by itself, I'm just not sure what to pass to where at the moment