@@ -1232,6 +1232,121 @@ def test_secondary_files_v1_0(tmp_path: Path, factor: str) -> None:
1232
1232
assert "completed success" in stderr
1233
1233
assert error_code == 0
1234
1234
1235
+
1236
+ @needs_docker
1237
+ @pytest .mark .parametrize ("factor" , test_factors )
1238
+ def test_wf_without_container (tmp_path : Path , factor : str ) -> None :
1239
+ """Confirm that we can run a workflow without a container."""
1240
+ test_file = "hello-workflow.cwl"
1241
+ cache_dir = str (tmp_path / "cwltool_cache" )
1242
+ commands = factor .split ()
1243
+ commands .extend (
1244
+ [
1245
+ "--cachedir" ,
1246
+ cache_dir ,
1247
+ "--outdir" ,
1248
+ str (tmp_path / "outdir" ),
1249
+ get_data ("tests/wf/" + test_file ),
1250
+ "--usermessage" ,
1251
+ "hello" ,
1252
+ ]
1253
+ )
1254
+ error_code , _ , stderr = get_main_output (commands )
1255
+
1256
+ stderr = re .sub (r"\s\s+" , " " , stderr )
1257
+ assert "completed success" in stderr
1258
+ assert error_code == 0
1259
+
1260
+
1261
+ @needs_docker
1262
+ @pytest .mark .parametrize ("factor" , test_factors )
1263
+ def test_issue_740_fixed (tmp_path : Path , factor : str ) -> None :
1264
+ """Confirm that re-running a particular workflow with caching succeeds."""
1265
+ test_file = "cache_test_workflow.cwl"
1266
+ cache_dir = str (tmp_path / "cwltool_cache" )
1267
+ commands = factor .split ()
1268
+ commands .extend (["--cachedir" , cache_dir , get_data ("tests/wf/" + test_file )])
1269
+ error_code , _ , stderr = get_main_output (commands )
1270
+
1271
+ stderr = re .sub (r"\s\s+" , " " , stderr )
1272
+ assert "completed success" in stderr
1273
+ assert error_code == 0
1274
+
1275
+ commands = factor .split ()
1276
+ commands .extend (["--cachedir" , cache_dir , get_data ("tests/wf/" + test_file )])
1277
+ error_code , _ , stderr = get_main_output (commands )
1278
+
1279
+ stderr = re .sub (r"\s\s+" , " " , stderr )
1280
+ assert "Output of job will be cached in" not in stderr
1281
+ assert error_code == 0 , stderr
1282
+
1283
+
1284
+ @needs_docker
1285
+ @pytest .mark .parametrize ("factor" , test_factors )
1286
+ def test_cache_relative_paths (tmp_path : Path , factor : str ) -> None :
1287
+ """Confirm that re-running a particular workflow with caching succeeds."""
1288
+ test_file = "secondary-files.cwl"
1289
+ test_job_file = "secondary-files-job.yml"
1290
+ cache_dir = str (tmp_path / "cwltool_cache" )
1291
+ commands = factor .split ()
1292
+ commands .extend (
1293
+ [
1294
+ "--out" ,
1295
+ str (tmp_path / "out" ),
1296
+ "--cachedir" ,
1297
+ cache_dir ,
1298
+ get_data (f"tests/{ test_file } " ),
1299
+ get_data (f"tests/{ test_job_file } " ),
1300
+ ]
1301
+ )
1302
+ error_code , _ , stderr = get_main_output (commands )
1303
+
1304
+ stderr = re .sub (r"\s\s+" , " " , stderr )
1305
+ assert "completed success" in stderr
1306
+ assert error_code == 0
1307
+
1308
+ commands = factor .split ()
1309
+ commands .extend (
1310
+ [
1311
+ "--out" ,
1312
+ str (tmp_path / "out2" ),
1313
+ "--cachedir" ,
1314
+ cache_dir ,
1315
+ get_data (f"tests/{ test_file } " ),
1316
+ get_data (f"tests/{ test_job_file } " ),
1317
+ ]
1318
+ )
1319
+ error_code , _ , stderr = get_main_output (commands )
1320
+
1321
+ stderr = re .sub (r"\s\s+" , " " , stderr )
1322
+ assert "Output of job will be cached in" not in stderr
1323
+ assert error_code == 0 , stderr
1324
+
1325
+ assert (tmp_path / "cwltool_cache" / "27903451fc1ee10c148a0bdeb845b2cf" ).exists ()
1326
+
1327
+
1328
+ @pytest .mark .parametrize ("factor" , test_factors )
1329
+ def test_cache_default_literal_file (tmp_path : Path , factor : str ) -> None :
1330
+ """Confirm that running a CLT with a default literal file with caching succeeds."""
1331
+ test_file = "tests/wf/extract_region_specs.cwl"
1332
+ cache_dir = str (tmp_path / "cwltool_cache" )
1333
+ commands = factor .split ()
1334
+ commands .extend (
1335
+ [
1336
+ "--out" ,
1337
+ str (tmp_path / "out" ),
1338
+ "--cachedir" ,
1339
+ cache_dir ,
1340
+ get_data (test_file ),
1341
+ ]
1342
+ )
1343
+ error_code , _ , stderr = get_main_output (commands )
1344
+
1345
+ stderr = re .sub (r"\s\s+" , " " , stderr )
1346
+ assert "completed success" in stderr
1347
+ assert error_code == 0
1348
+
1349
+
1235
1350
@pytest .mark .parametrize ("factor" , test_factors )
1236
1351
def test_cache_environment_variable (tmp_path : Path , factor : str ) -> None :
1237
1352
"""Ensure that changing the environment variables will result in different cache keys"""
@@ -1246,7 +1361,7 @@ def test_cache_environment_variable(tmp_path: Path, factor: str) -> None:
1246
1361
"--outdir" ,
1247
1362
str (tmp_path / "outdir" ),
1248
1363
get_data ("tests/" + test_file ),
1249
- get_data (f"tests/{ test_job_file } " )
1364
+ get_data (f"tests/{ test_job_file } " ),
1250
1365
]
1251
1366
)
1252
1367
error_code , _ , stderr = get_main_output (commands )
@@ -1268,7 +1383,7 @@ def test_cache_environment_variable(tmp_path: Path, factor: str) -> None:
1268
1383
"--outdir" ,
1269
1384
str (tmp_path / "outdir" ),
1270
1385
get_data ("tests/" + test_file ),
1271
- get_data (f"tests/{ test_job_file } " )
1386
+ get_data (f"tests/{ test_job_file } " ),
1272
1387
]
1273
1388
)
1274
1389
@@ -1278,6 +1393,7 @@ def test_cache_environment_variable(tmp_path: Path, factor: str) -> None:
1278
1393
assert "Output of job will be cached in" in stderr
1279
1394
assert error_code == 0 , stderr
1280
1395
1396
+
1281
1397
def test_write_summary (tmp_path : Path ) -> None :
1282
1398
"""Test --write-summary."""
1283
1399
commands = [
0 commit comments