2
2
# pylint: disable=redefined-outer-name
3
3
# pylint: disable=too-many-arguments
4
4
import asyncio
5
+ import importlib
5
6
import inspect
6
7
import json
7
8
from collections import deque
@@ -178,7 +179,12 @@ async def _assert_incoming_data_logs(
178
179
return (sidecar_logs , tasks_logs , progress_logs )
179
180
180
181
181
- @pytest .fixture
182
+ @pytest .fixture (
183
+ params = [
184
+ "node_ports" ,
185
+ "node_ports_v2" ,
186
+ ]
187
+ )
182
188
async def pipeline (
183
189
sidecar_config : None ,
184
190
postgres_host_config : Dict [str , str ],
@@ -189,16 +195,18 @@ async def pipeline(
189
195
pipeline_cfg : Dict ,
190
196
mock_dir : Path ,
191
197
user_id : int ,
198
+ request ,
192
199
) -> ComputationalPipeline :
193
200
"""creates a full pipeline.
194
201
NOTE: 'pipeline', defined as parametrization
195
202
"""
196
- from simcore_sdk import node_ports_v2
197
203
198
204
tasks = {key : osparc_service for key in pipeline_cfg }
199
205
dag = {key : pipeline_cfg [key ]["next" ] for key in pipeline_cfg }
200
206
inputs = {key : pipeline_cfg [key ]["inputs" ] for key in pipeline_cfg }
201
207
208
+ np = importlib .import_module (f".{ request .param } " , package = "simcore_sdk" )
209
+
202
210
async def _create (
203
211
tasks : Dict [str , Any ],
204
212
dag : Dict [str , List [str ]],
@@ -233,15 +241,15 @@ async def _create(
233
241
):
234
242
# update the files in mock_dir to S3
235
243
# FIXME: node_ports config shall not global! here making a hack so it works
236
- node_ports_v2 .node_config .USER_ID = user_id
237
- node_ports_v2 .node_config .PROJECT_ID = project_id
238
- node_ports_v2 .node_config .NODE_UUID = node_uuid
244
+ np .node_config .USER_ID = user_id
245
+ np .node_config .PROJECT_ID = project_id
246
+ np .node_config .NODE_UUID = node_uuid
239
247
240
248
print ("--" * 10 )
241
- print_module_variables (module = node_ports_v2 .node_config )
249
+ print_module_variables (module = np .node_config )
242
250
print ("--" * 10 )
243
251
244
- PORTS = await node_ports_v2 .ports ()
252
+ PORTS = await np .ports ()
245
253
await (await PORTS .inputs )[input_key ].set (
246
254
mock_dir / node_inputs [input_key ]["path" ]
247
255
)
@@ -254,29 +262,50 @@ async def _create(
254
262
"itisfoundation/sleeper" ,
255
263
"1.0.0" ,
256
264
{
257
- "node_1" : {
258
- "next" : ["node_2" , "node_3" ],
265
+ "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" : {
266
+ "next" : [
267
+ "28bf052a-5fb8-4935-9c97-2b15109632b9" ,
268
+ "dfdc165b-a10d-4049-bf4e-555bf5e7d557" ,
269
+ ],
259
270
"inputs" : {},
260
271
},
261
- "node_2 " : {
262
- "next" : ["node_4 " ],
272
+ "28bf052a-5fb8-4935-9c97-2b15109632b9 " : {
273
+ "next" : ["54901e30-6cd2-417b-aaf9-b458022639d2 " ],
263
274
"inputs" : {
264
- "in_1" : {"nodeUuid" : "node_1" , "output" : "out_1" },
265
- "in_2" : {"nodeUuid" : "node_1" , "output" : "out_2" },
275
+ "in_1" : {
276
+ "nodeUuid" : "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" ,
277
+ "output" : "out_1" ,
278
+ },
279
+ "in_2" : {
280
+ "nodeUuid" : "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" ,
281
+ "output" : "out_2" ,
282
+ },
266
283
},
267
284
},
268
- "node_3 " : {
269
- "next" : ["node_4 " ],
285
+ "dfdc165b-a10d-4049-bf4e-555bf5e7d557 " : {
286
+ "next" : ["54901e30-6cd2-417b-aaf9-b458022639d2 " ],
270
287
"inputs" : {
271
- "in_1" : {"nodeUuid" : "node_1" , "output" : "out_1" },
272
- "in_2" : {"nodeUuid" : "node_1" , "output" : "out_2" },
288
+ "in_1" : {
289
+ "nodeUuid" : "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" ,
290
+ "output" : "out_1" ,
291
+ },
292
+ "in_2" : {
293
+ "nodeUuid" : "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" ,
294
+ "output" : "out_2" ,
295
+ },
273
296
},
274
297
},
275
- "node_4 " : {
298
+ "54901e30-6cd2-417b-aaf9-b458022639d2 " : {
276
299
"next" : [],
277
300
"inputs" : {
278
- "in_1" : {"nodeUuid" : "node_2" , "output" : "out_1" },
279
- "in_2" : {"nodeUuid" : "node_3" , "output" : "out_2" },
301
+ "in_1" : {
302
+ "nodeUuid" : "28bf052a-5fb8-4935-9c97-2b15109632b9" ,
303
+ "output" : "out_1" ,
304
+ },
305
+ "in_2" : {
306
+ "nodeUuid" : "dfdc165b-a10d-4049-bf4e-555bf5e7d557" ,
307
+ "output" : "out_2" ,
308
+ },
280
309
},
281
310
},
282
311
},
@@ -286,25 +315,28 @@ async def _create(
286
315
"itisfoundation/osparc-python-runner" ,
287
316
"1.0.0" ,
288
317
{
289
- "node_1" : {
290
- "next" : ["node_2" , "node_3" ],
318
+ "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" : {
319
+ "next" : [
320
+ "28bf052a-5fb8-4935-9c97-2b15109632b9" ,
321
+ "dfdc165b-a10d-4049-bf4e-555bf5e7d557" ,
322
+ ],
291
323
"inputs" : {
292
324
"input_1" : {"store" : SIMCORE_S3_ID , "path" : "osparc_python_sample.py" }
293
325
},
294
326
},
295
- "node_2 " : {
296
- "next" : ["node_4 " ],
327
+ "28bf052a-5fb8-4935-9c97-2b15109632b9 " : {
328
+ "next" : ["54901e30-6cd2-417b-aaf9-b458022639d2 " ],
297
329
"inputs" : {
298
330
"input_1" : {"store" : SIMCORE_S3_ID , "path" : "osparc_python_sample.py" }
299
331
},
300
332
},
301
- "node_3 " : {
302
- "next" : ["node_4 " ],
333
+ "dfdc165b-a10d-4049-bf4e-555bf5e7d557 " : {
334
+ "next" : ["54901e30-6cd2-417b-aaf9-b458022639d2 " ],
303
335
"inputs" : {
304
336
"input_1" : {"store" : SIMCORE_S3_ID , "path" : "osparc_python_sample.py" }
305
337
},
306
338
},
307
- "node_4 " : {
339
+ "54901e30-6cd2-417b-aaf9-b458022639d2 " : {
308
340
"next" : [],
309
341
"inputs" : {
310
342
"input_1" : {"store" : SIMCORE_S3_ID , "path" : "osparc_python_sample.py" }
@@ -319,18 +351,21 @@ async def _create(
319
351
"itisfoundation/osparc-python-runner" ,
320
352
"1.0.0" ,
321
353
{
322
- "node_1 " : {
354
+ "a13d197a-bf8c-4e11-8a15-44a9894cbbe8 " : {
323
355
"next" : [
324
- "node_2 " ,
356
+ "28bf052a-5fb8-4935-9c97-2b15109632b9 " ,
325
357
],
326
358
"inputs" : {
327
359
"input_1" : {"store" : SIMCORE_S3_ID , "path" : "osparc_python_factory.py" }
328
360
},
329
361
},
330
- "node_2 " : {
362
+ "28bf052a-5fb8-4935-9c97-2b15109632b9 " : {
331
363
"next" : [],
332
364
"inputs" : {
333
- "input_1" : {"nodeUuid" : "node_1" , "output" : "output_1" },
365
+ "input_1" : {
366
+ "nodeUuid" : "a13d197a-bf8c-4e11-8a15-44a9894cbbe8" ,
367
+ "output" : "output_1" ,
368
+ },
334
369
},
335
370
},
336
371
},
0 commit comments