@@ -1369,8 +1369,8 @@ def test_artifact_setter(self):
1369
1369
1370
1370
# here we can test that we can properly create a workflow but we are
1371
1371
# going to add lot more steps to make it more complex by adding a
1372
- # couple of new scenarios
1373
- # 1/2 . adds a new path that should be kept separate all the way; this
1372
+ # few more scenarios
1373
+ # 1/4 . adds a new path that should be kept separate all the way; this
1374
1374
# is to emulate what happens with different trimming (different
1375
1375
# default parameter) and deblur (same for each of the previous
1376
1376
# steps)
@@ -1385,7 +1385,7 @@ def test_artifact_setter(self):
1385
1385
default_workflow_edge_id, parent_output_id, child_input_id)
1386
1386
VALUES (4, 1, 3)"""
1387
1387
qdb .sql_connection .perform_as_transaction (sql )
1388
- # 2/2 . adds a new path that should be kept together and then separate;
1388
+ # 2/4 . adds a new path that should be kept together and then separate;
1389
1389
# this is to simulate what happens with MTX/WGS processing, one
1390
1390
# single QC step (together) and 2 separete profilers
1391
1391
sql = """
@@ -1407,15 +1407,36 @@ def test_artifact_setter(self):
1407
1407
VALUES (5, 1, 3)
1408
1408
"""
1409
1409
qdb .sql_connection .perform_as_transaction (sql )
1410
- # Finally, we need to "activate" the merging scheme values of the
1410
+ # 3/4. we need to "activate" the merging scheme values of the
1411
1411
# commands so they are actually different:
1412
1412
# 31->'Pick closed-reference OTUs', 6->'Split libraries FASTQ'
1413
1413
sql = """
1414
1414
UPDATE qiita.command_parameter
1415
1415
SET check_biom_merge = true
1416
1416
WHERE command_parameter_id IN (31, 6)"""
1417
1417
qdb .sql_connection .perform_as_transaction (sql )
1418
+ # 4/4. update so we check the prep info file for a valid value
1419
+ sql = """
1420
+ UPDATE qiita.default_workflow
1421
+ SET parameters = '
1422
+ {"sample": {"scientific_name": "1118232"},
1423
+ "prep": {"center_name": "ANL - 1"}}'::JSONB
1424
+ WHERE default_workflow_id = 1"""
1425
+ qdb .sql_connection .perform_as_transaction (sql )
1426
+
1427
+ # let's check that nothing is found due to the parameters, in specific
1428
+ # "prep": {"center_name": "ANL - 1"}
1429
+ with self .assertRaisesRegex (ValueError , 'This preparation data type: '
1430
+ '"16S" and/or artifact type "FASTQ" does '
1431
+ 'not have valid workflows; this could be '
1432
+ 'due to required parameters, please check '
1433
+ 'the available workflows.' ):
1434
+ pt .
add_default_workflow (
qdb .
user .
User (
'[email protected] ' ))
1418
1435
1436
+ # now, let's replace the parameters for something fine
1437
+ qdb .software .DefaultWorkflow (1 ).parameters = {
1438
+ "sample" : {"scientific_name" : "1118232" },
1439
+ "prep" : {"center_name" : "ANL" }}
1419
1440
wk = pt .
add_default_workflow (
qdb .
user .
User (
'[email protected] ' ))
1420
1441
self .assertEqual (len (wk .graph .nodes ), 5 )
1421
1442
self .assertEqual (len (wk .graph .edges ), 3 )
@@ -1427,7 +1448,7 @@ def test_artifact_setter(self):
1427
1448
'Pick closed-reference OTUs' ])
1428
1449
1429
1450
# now let's try to generate again and it should fail cause the jobs
1430
- # are alrady created
1451
+ # are already created
1431
1452
with self .assertRaisesRegex (ValueError , "Cannot create job because "
1432
1453
"the parameters are the same as jobs" ):
1433
1454
pt .
add_default_workflow (
qdb .
user .
User (
'[email protected] ' ))
0 commit comments