Skip to content

Commit dc75a78

Browse files
committed
Merge branch 'prov_secondary_files' of https://github.com/common-workflow-language/cwltool into prov_secondary_files
2 parents bbda85a + 7fbacf5 commit dc75a78

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

cwltool/provenance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ def declare_file(self, value):
539539
value["checksum"] = "%s$%s" % (SHA1, checksum)
540540

541541

542-
if not entity and 'content' in value:
542+
if not entity and 'contents' in value:
543543
# Anonymous file, add content as string
544-
entity,checksum = self.declare_string(value["content"])
544+
entity,checksum = self.declare_string(value["contents"])
545545

546546
# By here one of them should have worked!
547547
if not entity:

tests/test_provenance.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ def test_secondary_files_explicit(self):
135135
self.check_provenance(secondary_files=True)
136136
self.check_secondary_files()
137137

138+
def test_secondary_files_output(self):
139+
# secondary will be picked up by .idx
140+
self.cwltool(get_data('tests/wf/sec-wf-out.cwl'))
141+
self.check_provenance(secondary_files=True)
142+
# Skipped, not the same secondary files as above
143+
#self.check_secondary_files()
144+
138145
def test_directory_workflow(self):
139146
dir2 = os.path.join(tempfile.mkdtemp("test_directory_workflow"),
140147
"dir2")
@@ -503,7 +510,6 @@ def check_prov(self, nested=False, single_tool=False, directory=False,
503510
prim_basename = set(g.objects(prim, CWLPROV.basename)).pop()
504511
prim_nameroot = set(g.objects(prim, CWLPROV.nameroot)).pop()
505512
prim_nameext = set(g.objects(prim, CWLPROV.nameext)).pop()
506-
self.assertEquals(sec_nameroot, prim_basename)
507513
self.assertEquals(str(prim_basename), "%s%s" % (prim_nameroot, prim_nameext))
508514

509515

tests/wf/sec-wf-out.cwl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
class: Workflow
2+
cwlVersion: v1.0
3+
inputs: []
4+
outputs:
5+
file1:
6+
type: File
7+
outputSource: step1/file1
8+
9+
10+
steps:
11+
step1:
12+
in: []
13+
out:
14+
- file1
15+
- file1csv
16+
run:
17+
class: CommandLineTool
18+
requirements:
19+
- class: ShellCommandRequirement
20+
arguments:
21+
- shellQuote: false
22+
valueFrom: >
23+
echo "abc" > f.txt;
24+
echo "3" > f.txt.size;
25+
echo "a" > f.txt.firstletter;
26+
echo "a,b,c" > f.csv;
27+
echo "1,2,3" > f.csv.columns;
28+
echo "ignored" > f.txt.ignoreme;
29+
inputs: []
30+
outputs:
31+
file1:
32+
type: File
33+
outputBinding:
34+
glob: "f.txt"
35+
secondaryFiles:
36+
- ".size"
37+
- ".firstletter"
38+
- "^.csv"
39+
file1csv:
40+
type: File
41+
outputBinding:
42+
glob: "f.csv"
43+
secondaryFiles:
44+
- ".columns"

0 commit comments

Comments
 (0)