gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Test of Insert files to DB issue #512

Closed orelgueta closed 1 year ago

orelgueta commented 1 year ago

I need some input on how to deal with the current DB issue since it requires taking a decision. First I will describe the test:

The issue is the following:

Possible solutions:

Thoughts @GernotMaier, @VictorBarbosaMartins?

orelgueta commented 1 year ago

OK there's one more solution which is actually the best I think. We create a special sandbox DB for each pytest instance and empty it after the run. I thought it stays there forever until we manually remove it but apparently MongoDB drops an empty DB automatically. If this indeed works then #513 will close this issue.

GernotMaier commented 1 year ago

Really difficult.

The cleanest would be using the mock feature - as we want to test our code and not the database. But I see the disadvantage (having to learn how it works, another dependency).

I agree that your second point would be best. But I also see that #513 is working, so I stop answering...

orelgueta commented 1 year ago

Yes, tests worked, let's merge and keep an eye for the future. Glad I tested this random idea I had before implementing something more complicated...