Change approach to fake test data #835
Labels
enhancement
Impact - something should be added to or changed about Parsons that isn't causing a current breakage
medium priority
Priority - this doesn't need to be addressed immediately, but will broadly impact Parsons users
needs discussion
needs community input and/or maintainer discussion
Currently, our connector tests involve large amounts of fake data, usually in JSON format (but occasionally stored as Python dicts, csvs, or other formats). Sometimes this data is incorporated into the tests themselves, making them hard to read. Sometimes they're put in separate files, which is better, but it's still not ideal to have, say, a 400 line test data file to test just one connector.
Are there other approaches that might be more readable, easier to maintain, and easier to write? (I know generating the test data is often the most annoying part of writing tests for connectors.)
I'm aware of tools like Factory Boy but that's for Python objects, not really for data. There's Faker which seems more promising.
Another option might be making use of Json Schemas although "validate the schema" isn't a huge part of the tests we're doing.
(I don't love that any of these approaches would involve adding another dependency - maybe it's time to separate out the handful of dev dependencies, like we do the docs dependencies?)
Whatever we do, we should make sure to document it really well so that it makes the lives of people writing Parsons tests easier rather than harder and more confusing.
What do folks think?
The text was updated successfully, but these errors were encountered: