mardi 23 juin 2020

Testing environment which reads data from (but doesn't write to) production

I work with a code base of ~100,000 lines of mostly MATLAB. This code runs in production on a Windows machine, and reads from and writes to a mounted data directory. A global manager object is used to create path names to the relevant locations in the data directory: e.g.

manager.directories.data.historical = "..\data\historical"  
manager.directories.data.raw = "..\data\raw"

And so on.

I have a local copy of the code, and access the data on production through a VPN. I achieve this by altering the paths in my local version of the manager object:

manager.directories.data.historical = "\\192.168.2.1\...\data\historical"  
manager.directories.data.raw = "\\192.168.2.1\...\data\raw"

I manually ensure my local version of the code never writes anything to these directories.

At present we no real systematic version control, and my goal is to implement this using git. As a part of this, I would like to create a testing and development environment which can read from the data drive on production, but never writes to that drive. It should instead write to a local copy of the directory structure so the results can be validated etc.

What are the options for solving this problem in a sensible way? I imagine I can't avoid changing a lot of "write" statements in the code in some way, but need a good plan before I do so.

Aucun commentaire:

Enregistrer un commentaire