Integration tests for SimStore StorableFunctions#985
Conversation
Parts of ensuring these can be used independently for testing.
Codecov Report
@@ Coverage Diff @@
## master #985 +/- ##
==========================================
+ Coverage 80.26% 80.28% +0.01%
==========================================
Files 136 136
Lines 14455 14468 +13
==========================================
+ Hits 11603 11616 +13
Misses 2852 2852
Continue to review full report at Codecov.
|
|
This is ready for review and comment. I will leave it open for at least 24 hours, merging no earlier than Mon 01 Mar 18:00 GMT (19:00 local). |
sroet
left a comment
There was a problem hiding this comment.
This LGTM, 1 leftover TODO, but please don't hang on that.
One question for my own understanding of the new behavior:
If a cv is connected to two storages and a new result is calculated, is it stored to the last, the first, or both connected handlers (or is this dependend on the storage.save being called)?
…integration.py Co-authored-by: Sander Roet <sanderroet@hotmail.com>
This depends on the
|
This PR adds some detailed integration tests for storable functions in SimStore. These tests are considerably more complicated than the existing unit tests, and are designed to ensure that storage, backend, and storable functions play together as desired. This also fixes some problems that have previously slipped through the cracks.
A few effects of this:
StorableFunctions didn't show up instorage.cvsMemoryStorageBackendandGeneralStoragethat are required to use them (instead of using the SQL backend and the OPS storage)EDIT: This also now adds support for a single storable function (CV) to connect to multiple storage backends (e.g., if it was loaded from one file, but it being used to save data into a second file -- want to be able to find disk-cached results in either). If a file is
closed, then it deregisters itself from all storable functions. If something goes wrong when trying to load from a registered file (e.g., if the user deleted the file in the meantime) a warning will be issued, but we'll fall back to re-evaluating the function if needed. Tests for these behaviors are included in the new test file.