urbanriskmap / cognicity-grasp

Geosocial Rapid Assessment Platform for CogniCity
GNU General Public License v3.0
1 stars 1 forks source link

Test report card with db #20

Closed abrahamq closed 7 years ago

abrahamq commented 7 years ago

This has a single test that ensures the issue card, insert report, and watch cards methods in ReportCard.js are working correctly with the database.

abrahamq commented 7 years ago

So I'm guessing that Travis doesn't have a DB that it's standing up so this test is failing to connect to the DB. I think the correct solution is to have travis/jenkins/ci stand up a real version of our DB (with the correct schemas, so on) so that we can test against it. What does our road map look like for getting something like this going?

matthewberryman commented 7 years ago

Done. I went to modify the ReportCard.js you had in the branch to force image_id to null when it's not specified, as otherwise postgresql 9.4 complains, whereas postgresql 9.5 is fine, and it's a pain in the neck to get postgresql 9.5 with postgis on travis without using non-containerised builds and a bunch of cruft in .travis.yml. This introduced merge conflicts, and I realised your code is behind master wrt ReportCard.js. Master has a better insertReport function so I went with that one, which also required a change to your test. I'm just about to add another commit with merged code from master plus modified test.

matthewberryman commented 7 years ago

Ok I'm now happy. This passes all the tests on Travis and has no merge conflicts with master. Check it out and if you're happy I'll leave it to you to close, @abrahamq

abrahamq commented 7 years ago

Awesome! Sorry my work was different master, started working on the test a while back but got distracted by more pressing things. I'll go ahead and close now. Thanks!