openva / rs-machine

Richmond Sunlight's scrapers, parsers, etc.
MIT License
0 stars 1 forks source link

Set up a test framework #11

Open waldoj opened 6 years ago

waldoj commented 6 years ago

Since it's all about processing data, this is going to necessitate an alternate database. It's not clear to me whether that should be done on a local MySQL instance, or an alternate database on RDS. (I feel better, in terms of not risking touching live data, using a local instance.) Anyway, figure out what that setup looks up, and document it.

waldoj commented 6 years ago

Oh, wait—yes, obviously a local instance, so that it can run virtualized on e.g. Travis CI.

So I think I need to take bills.csv, history.csv, and vote.csv, and pare them down carefully, so that I have, like, 10 bills, the histories for those bills, and all votes around those bills. And then run that through the whole process. Then I can test that the resulting summaries are right, that the full text is right, that the statuses are right, that the vote totals are right, etc. One test for each.

Seems pretty straightforward. I think the tests will wind up unduly sensitive to tiny changes (e.g., if one day I replace all instances of -- in bill summaries with , that'll lead to failures), but that's not so terrible.

waldoj commented 6 years ago

I think a --test switch on the update script can be used to prompt the use of a corpus of testing files, instead of downloading files from the legislature.

I'm dubious that it makes sense to run every update script here. Some of them only update the latest information—they have no applicability to our test data.