File tree Expand file tree Collapse file tree 8 files changed +44
-5
lines changed Expand file tree Collapse file tree 8 files changed +44
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ include tests/tmp4/alpha/*
1010include tests/wf/*
1111include tests/wf/operation/*
1212include tests/override/*
13+ include tests/reloc/*.cwl
14+ include tests/reloc/dir1/*
15+ include tests/reloc/dir2/*
1316include tests/checker_wf/*
1417include tests/subgraph/*
1518include tests/trs/*
Original file line number Diff line number Diff line change @@ -354,11 +354,13 @@ def _collectDirEntries(
354354 yield from _collectDirEntries (sub_obj )
355355
356356 def _relocate (src : str , dst : str ) -> None :
357+ src = fs_access .realpath (src )
358+ dst = fs_access .realpath (dst )
359+
357360 if src == dst :
358361 return
359362
360363 # If the source is not contained in source_directories we're not allowed to delete it
361- src = fs_access .realpath (src )
362364 src_can_deleted = any (
363365 os .path .commonprefix ([p , src ]) == p for p in source_directories
364366 )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ requests>=2.4.3
22ruamel.yaml >= 0.15 ,< 0.17.17
33rdflib >= 4.2.2 ,< 6.1
44shellescape >= 3.4.1 ,< 3.9
5- schema-salad >= 8.2.20210914115719 ,< 9
5+ schema-salad >= 8.2.20211104054942 ,< 9
66prov == 1.5.1
77bagit == 1.8.1
88mypy-extensions
Original file line number Diff line number Diff line change 111111 "ruamel.yaml >= 0.15, < 0.17.17" ,
112112 "rdflib >= 4.2.2, < 6.1.0" ,
113113 "shellescape >= 3.4.1, < 3.9" ,
114- # 7.1.20210518142926 or later required due to
115- # https://github.com/common-workflow-language/schema_salad/issues/385
116- "schema-salad >= 8.2.20210914115719, < 9" ,
114+ "schema-salad >= 8.2.20211104054942, < 9" ,
117115 "mypy-extensions" ,
118116 "psutil >= 5.6.6" ,
119117 "prov == 1.5.1" ,
Original file line number Diff line number Diff line change 1+ dir1
Original file line number Diff line number Diff line change 1+ cwlVersion: v1.2
2+ class: CommandLineTool
3+ inputs :
4+ inp: Directory
5+ outputs :
6+ bar:
7+ type : File
8+ outputBinding :
9+ glob : dir2/foo
10+ requirements :
11+ InlineJavascriptRequirement: {}
12+ InitialWorkDirRequirement:
13+ listing :
14+ - $(inputs.inp)
15+ arguments : [ls, -l]
Original file line number Diff line number Diff line change 11import json
22import sys
33from pathlib import Path
4+ import tempfile
45
56from cwltool .main import main
7+ from cwltool .process import relocateOutputs
8+ from cwltool .stdfsaccess import StdFsAccess
9+ from cwltool .pathmapper import PathMapper
610
711from .util import get_data , needs_docker
812
@@ -33,3 +37,19 @@ def test_for_conflict_file_names(tmp_path: Path) -> None:
3337 out = json .loads (stream .getvalue ())
3438 assert out ["b1" ]["basename" ] == out ["b2" ]["basename" ]
3539 assert out ["b1" ]["location" ] != out ["b2" ]["location" ]
40+
41+
42+ def test_relocate_symlinks (tmp_path : Path ) -> None :
43+ assert (
44+ main (
45+ [
46+ "--debug" ,
47+ "--outdir" ,
48+ get_data ("tests/reloc" ) + "/dir2" ,
49+ get_data ("tests/reloc/test.cwl" ),
50+ "--inp" ,
51+ get_data ("tests/reloc" ) + "/dir2" ,
52+ ]
53+ )
54+ == 0
55+ )
You can’t perform that action at this time.
0 commit comments