Skip to content

Commit ef6d5fc

Browse files
authored
Merge branch 'master' into accept-v1.1
2 parents 46e3830 + f207d16 commit ef6d5fc

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

cwltool/builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ def _capture_files(f):
313313
else:
314314
sf_required = True
315315

316+
316317
if "$(" in sf["pattern"] or "${" in sf["pattern"]:
317318
sfpath = self.do_eval(sf["pattern"], context=datum)
318319
else:

cwltool/update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def update_secondaryFiles(t):
5050
if isinstance(t, MutableSequence):
5151
return [{"pattern": p} for p in t]
5252
else:
53-
return t
53+
return {"pattern": t}
5454

5555
def fix_inputBinding(t):
5656
for i in t["inputs"]:

tests/secondary-files-string-v1.cwl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
cwlVersion: v1.0
2+
class: CommandLineTool
3+
baseCommand:
4+
- touch
5+
- 2.fastq
6+
requirements:
7+
- class: InitialWorkDirRequirement
8+
listing:
9+
- $(inputs.fasta_path)
10+
inputs:
11+
fasta_path:
12+
type: File
13+
secondaryFiles: ^.fastq
14+
outputs:
15+
fasta:
16+
type: File
17+
secondaryFiles: ^.fastq
18+
outputBinding:
19+
glob: $(inputs.fasta_path.basename)

tests/test_examples.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def test_cid_file_w_prefix(tmpdir):
790790

791791
@needs_docker
792792
class TestSecondaryFiles():
793-
def test_secondary_files(self):
793+
def test_secondary_files_v1_1(self):
794794
test_file = "secondary-files.cwl"
795795
test_job_file = "secondary-files-job.yml"
796796
try:
@@ -805,6 +805,23 @@ def test_secondary_files(self):
805805
assert "completed success" in stderr
806806
assert error_code == 0
807807

808+
def test_secondary_files_v1_0(self):
809+
test_file = "secondary-files-string-v1.cwl"
810+
test_job_file = "secondary-files-job.yml"
811+
try:
812+
old_umask = os.umask(stat.S_IWOTH) # test run with umask 002
813+
error_code, _, stderr = get_main_output(
814+
[
815+
get_data(os.path.join("tests", test_file)),
816+
get_data(os.path.join("tests", test_job_file))
817+
]
818+
)
819+
finally:
820+
assert stat.S_IMODE(os.stat('lsout').st_mode) == 436 # 664 in octal, '-rw-rw-r--'
821+
os.umask(old_umask) # revert back to original umask
822+
assert "completed success" in stderr
823+
assert error_code == 0
824+
808825

809826
@needs_docker
810827
class TestCache():

0 commit comments

Comments
 (0)