Can mockaroo schemas be seeded so that they generate the same random data each time?

I’d like to be able to generate the same data from a schema every time I download it.

In Faker (for Python) the generator can be seeded, which enables the above.

Can this be done with Mockaroo?

Good question. I would also be interested in the answer… :slight_smile:

This isn’t possible at the moment. I’m interested in how you would use this. Can you tell me more about your use case? Maybe it’s something I can add.

I would also be interested in this.

Use case 1:

  • Mockaroo data is saved to a file
  • athe data is used to construct records for testing
  • Tests are built which depend on these records and would break if the data changes
  • As development continues, more columns need to be added to the schema

The simple option would be to re-export from Mockaroo, but this causes all data to change, and means all tests break. Instead we must manually combine the new Mockaroo generated columns with the existing data in excel/whatever. This is quite hard in XML, and impossible via mockaroo if the new columns are dependent on existing.

If there were a static seed, the re-export would generate the same data as the initial export, but with the extra columns too. This should effectively be a case of ensuring the random number generator(s) are primed with this seed, rather than something pseudo random each time.

If the developer wants new data, they would change the seed (or not send the same value).

Use case 2:

  • Test run consumes data directly from Mockaroo API call
  • Tests will fail on subsequent runs because the data changes each time. Instead we must cache the data locally to have a static test data set.

The incentive here for Mockaroo is reproducible API call / streamed data results; at present the lack of identical data between runs encourages Devs to cache the mock data locally instead. If API calls were known to produce consistent results with a seed then I think there would be more consumers - and hence more people interested in paying to upgrade too.