microbiomedata / nmdc-schema

National Microbiome Data Collaborative (NMDC) unified data model
https://microbiomedata.github.io/nmdc-schema/
Creative Commons Zero v1.0 Universal
26 stars 8 forks source link

Migrations: Make it easier to test migrators against a Mongo database #2067

Open eecavanna opened 2 weeks ago

eecavanna commented 2 weeks ago

Today, there are several ways that people can test a migrator.

First, they can run the doctests in the migrator. That does not involve a Mongo database.

Second, they can use the "migration recursion" script that exists somewhere in this repo. That, too, does not involve a Mongo database.

Finally, they can create a python notebook (or any arbitrary Python script) and, within that script, import the migrator module, instantiate the migrator and the relevant adapter, set up a Mongo server, load original data into the database, and run the migrator. They could try and replicate the production notebooks in the nmdc-runtime repo in order to do this. As a result, they would be testing the migrator with a real Mongo database.

A team member asked me, today, how I recommend she test a specific migrator if she wanted to test it with a Mongo database.

As I was describing something like the third option above, I realized I haven't set things up to facilitate that type of testing yet. I do that type of testing often, but it is in an ad hoc way.

I'm creating this ticket to represent the task of simplifying the process by which team members can test migrators with a real Mongo database.