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/*
10
10
include tests/wf/*
11
11
include tests/wf/operation/*
12
12
include tests/override/*
13
+ include tests/reloc/*.cwl
14
+ include tests/reloc/dir1/*
15
+ include tests/reloc/dir2/*
13
16
include tests/checker_wf/*
14
17
include tests/subgraph/*
15
18
include tests/trs/*
Original file line number Diff line number Diff line change @@ -354,11 +354,13 @@ def _collectDirEntries(
354
354
yield from _collectDirEntries (sub_obj )
355
355
356
356
def _relocate (src : str , dst : str ) -> None :
357
+ src = fs_access .realpath (src )
358
+ dst = fs_access .realpath (dst )
359
+
357
360
if src == dst :
358
361
return
359
362
360
363
# If the source is not contained in source_directories we're not allowed to delete it
361
- src = fs_access .realpath (src )
362
364
src_can_deleted = any (
363
365
os .path .commonprefix ([p , src ]) == p for p in source_directories
364
366
)
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ requests>=2.4.3
2
2
ruamel.yaml >= 0.15 ,< 0.17.17
3
3
rdflib >= 4.2.2 ,< 6.1
4
4
shellescape >= 3.4.1 ,< 3.9
5
- schema-salad >= 8.2.20210914115719 ,< 9
5
+ schema-salad >= 8.2.20211104054942 ,< 9
6
6
prov == 1.5.1
7
7
bagit == 1.8.1
8
8
mypy-extensions
Original file line number Diff line number Diff line change 111
111
"ruamel.yaml >= 0.15, < 0.17.17" ,
112
112
"rdflib >= 4.2.2, < 6.1.0" ,
113
113
"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" ,
117
115
"mypy-extensions" ,
118
116
"psutil >= 5.6.6" ,
119
117
"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 1
1
import json
2
2
import sys
3
3
from pathlib import Path
4
+ import tempfile
4
5
5
6
from cwltool .main import main
7
+ from cwltool .process import relocateOutputs
8
+ from cwltool .stdfsaccess import StdFsAccess
9
+ from cwltool .pathmapper import PathMapper
6
10
7
11
from .util import get_data , needs_docker
8
12
@@ -33,3 +37,19 @@ def test_for_conflict_file_names(tmp_path: Path) -> None:
33
37
out = json .loads (stream .getvalue ())
34
38
assert out ["b1" ]["basename" ] == out ["b2" ]["basename" ]
35
39
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