@@ -91,8 +91,7 @@ class StorageSetup:
91
91
Place here what is needed for proper initialization
92
92
of each storage
93
93
94
- For shared storages
95
-
94
+ Abstracts storage space allocation from how user access it
96
95
'''
97
96
_instance = None
98
97
_aws_default_factory : BaseS3StorageFixtureFactory = None
@@ -180,6 +179,33 @@ def get_arctic_uri(cls, storage: Storage, storage_space: StorageSpace, add_to_pr
180
179
181
180
182
181
class TestLibraryManager :
182
+ """
183
+ This class provides thin isolation of tests from storage and from arctic.
184
+ This provides following benefits:
185
+
186
+ - Any changes in the structure of how things are stored would not reflect the test case.
187
+ - New types of storages can be added quickly and without impact for the test
188
+ - Same tests can quickly be executed against new types of storages, or just experiment
189
+ with new storages by simply changing storage type
190
+ - A test ca be executed in test mode through `set_test_more` until it reaches production
191
+ state. then simply removing this from the test makes it production. That isolates well
192
+ production data from test data
193
+
194
+ The class provides very limited set of functions which are more than enough to make any
195
+ end 2 end tests with ASV or other frameworks. The only thing it discourages is use of
196
+ Arctic directly. That is with single goal to protect shared storage from unintentional damage.
197
+ All work should be done through `get_library` function. There are methods for setting library options,
198
+ and additional `has_library` method that would eliminate the need of direct use of Arctic object
199
+
200
+ As there could be very few cases that could require use of Arctic object directly, such protected
201
+ methods do exist, but their use makes any test potentially either unsafe or one that should be
202
+ handled with extra care
203
+
204
+ The class provides additional 2 class methods which should be handled with care. As they create
205
+ always new connection any concurrent modifications with them and running tests would most
206
+ probably end with errors.
207
+
208
+ """
183
209
184
210
def __init__ (self , storage : Storage , name_benchmark : str , library_options : LibraryOptions = None ) :
185
211
"""
@@ -189,7 +215,6 @@ def __init__(self, storage: Storage, name_benchmark: str, library_options: Libra
189
215
self .library_options : LibraryOptions = library_options
190
216
self .name_benchmark : str = name_benchmark
191
217
self ._test_mode = False
192
- self ._uris_cache : List [str ] = []
193
218
self ._ac_cache = {}
194
219
StorageSetup ()
195
220
@@ -576,6 +601,10 @@ def get_next_timestamp_number(self, sequence_df_list: List[pd.DataFrame], freq:
576
601
return next
577
602
578
603
class TestsForTestLibraryManager :
604
+ """
605
+ This class contains tests for the framework. All changes to the framework
606
+ should be done with running those tests at the end
607
+ """
579
608
580
609
@classmethod
581
610
def test_test_mode (cls ):
0 commit comments