@@ -109,8 +109,13 @@ def test_local_import_splitfile(pg_repo_local):
109109 assert not OUTPUT .engine .table_exists (OUTPUT .to_schema (), "fruits" )
110110
111111
112- def test_advanced_splitfile (pg_repo_local ):
113- execute_commands (load_splitfile ("import_local_multiple_with_queries.splitfile" ), output = OUTPUT )
112+ @pytest .mark .parametrize ("use_writeable_lq" , [True , False ])
113+ def test_advanced_splitfile (pg_repo_local , use_writeable_lq ):
114+ execute_commands (
115+ load_splitfile ("import_local_multiple_with_queries.splitfile" ),
116+ output = OUTPUT ,
117+ use_writeable_lq = use_writeable_lq ,
118+ )
114119
115120 assert OUTPUT .engine .table_exists (OUTPUT .to_schema (), "my_fruits" )
116121 assert OUTPUT .engine .table_exists (OUTPUT .to_schema (), "vegetables" )
@@ -128,13 +133,22 @@ def test_advanced_splitfile(pg_repo_local):
128133 assert OUTPUT .run_sql ("SELECT * FROM my_fruits" ) == [(2 , "orange" )]
129134
130135
131- def test_splitfile_cached (pg_repo_local ):
136+ @pytest .mark .parametrize ("use_writeable_lq" , [True , False ])
137+ def test_splitfile_cached (pg_repo_local , use_writeable_lq ):
132138 # Check that no new commits/snaps are created if we rerun the same splitfile
133- execute_commands (load_splitfile ("import_local_multiple_with_queries.splitfile" ), output = OUTPUT )
139+ execute_commands (
140+ load_splitfile ("import_local_multiple_with_queries.splitfile" ),
141+ output = OUTPUT ,
142+ use_writeable_lq = use_writeable_lq ,
143+ )
134144 images = OUTPUT .images ()
135145 assert len (images ) == 4
136146
137- execute_commands (load_splitfile ("import_local_multiple_with_queries.splitfile" ), output = OUTPUT )
147+ execute_commands (
148+ load_splitfile ("import_local_multiple_with_queries.splitfile" ),
149+ output = OUTPUT ,
150+ use_writeable_lq = use_writeable_lq ,
151+ )
138152 new_images = OUTPUT .images ()
139153 assert new_images == images
140154
@@ -205,8 +219,14 @@ def test_import_updating_splitfile_with_uploading(
205219
206220
207221@pytest .mark .mounting
222+ @pytest .mark .parametrize ("use_writeable_lq" , [True , False ])
208223def test_splitfile_end_to_end_with_uploading (
209- local_engine_empty , remote_engine , pg_repo_remote_multitag , mg_repo_remote , clean_minio
224+ local_engine_empty ,
225+ remote_engine ,
226+ pg_repo_remote_multitag ,
227+ mg_repo_remote ,
228+ clean_minio ,
229+ use_writeable_lq ,
210230):
211231 # An end-to-end test:
212232 # * Create a derived dataset from some tables imported from the remote engine
@@ -217,7 +237,10 @@ def test_splitfile_end_to_end_with_uploading(
217237
218238 # Do the same setting up first and run the splitfile against the remote data.
219239 execute_commands (
220- load_splitfile ("import_remote_multiple.splitfile" ), params = {"TAG" : "v1" }, output = OUTPUT
240+ load_splitfile ("import_remote_multiple.splitfile" ),
241+ params = {"TAG" : "v1" },
242+ output = OUTPUT ,
243+ use_writeable_lq = use_writeable_lq ,
221244 )
222245
223246 remote_output = Repository (OUTPUT .namespace , OUTPUT .repository , remote_engine )
@@ -230,22 +253,31 @@ def test_splitfile_end_to_end_with_uploading(
230253 OUTPUT .objects .cleanup ()
231254
232255 stage_2 = R ("output_stage_2" )
233- execute_commands (load_splitfile ("import_from_preuploaded_remote.splitfile" ), output = stage_2 )
256+ execute_commands (
257+ load_splitfile ("import_from_preuploaded_remote.splitfile" ),
258+ output = stage_2 ,
259+ use_writeable_lq = use_writeable_lq ,
260+ )
234261
235262 assert stage_2 .run_sql ("SELECT id, name, fruit, vegetable FROM diet" ) == [
236263 (2 , "James" , "orange" , "carrot" )
237264 ]
238265
239266
240267@pytest .mark .mounting
241- def test_splitfile_schema_changes (pg_repo_local , mg_repo_local ):
242- execute_commands (load_splitfile ("schema_changes.splitfile" ), output = OUTPUT )
268+ @pytest .mark .parametrize ("use_writeable_lq" , [True , False ])
269+ def test_splitfile_schema_changes (pg_repo_local , mg_repo_local , use_writeable_lq ):
270+ execute_commands (
271+ load_splitfile ("schema_changes.splitfile" ), output = OUTPUT , use_writeable_lq = use_writeable_lq
272+ )
243273 old_output_head = OUTPUT .head
244274
245275 # Then, alter the dataset and rerun the splitfile.
246276 pg_repo_local .run_sql ("INSERT INTO fruits VALUES (12, 'mayonnaise')" )
247277 pg_repo_local .commit ()
248- execute_commands (load_splitfile ("schema_changes.splitfile" ), output = OUTPUT )
278+ execute_commands (
279+ load_splitfile ("schema_changes.splitfile" ), output = OUTPUT , use_writeable_lq = use_writeable_lq
280+ )
249281 new_output_head = OUTPUT .head
250282
251283 old_output_head .checkout ()
@@ -438,16 +470,16 @@ def test_splitfile_with_external_sql(readonly_pg_repo):
438470
439471
440472@pytest .mark .registry
441- def test_splitfile_inline_sql (readonly_pg_repo , pg_repo_local ):
473+ @pytest .mark .parametrize ("use_writeable_lq" , [True , False ])
474+ def test_splitfile_inline_sql (readonly_pg_repo , pg_repo_local , use_writeable_lq ):
442475 # Test SQL commands accessing repos directly -- join a remote repo with
443476 # some local data.
444477
445478 prepare_lq_repo (pg_repo_local , commit_after_every = False , include_pk = True )
446479 pg_repo_local .head .tag ("v2" )
447480
448481 execute_commands (
449- load_splitfile ("inline_sql.splitfile" ),
450- output = OUTPUT ,
482+ load_splitfile ("inline_sql.splitfile" ), output = OUTPUT , use_writeable_lq = use_writeable_lq
451483 )
452484
453485 new_head = OUTPUT .head
0 commit comments