Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WorkflowStepInput.valueFrom: if self is type Directory, then `self.… #750

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions v1.0/conformance_test_v1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1862,3 +1862,18 @@
inputs are not present in the input object used to run the tool.
should_fail: true
tags: [ required, workflow ]

- job: v1.0/dir3-job.yml
tool: v1.0/single_file_from_dir.cwl
label: step_input_directory_listing
id: 133
doc: >
WorkflowStepInput.valueFrom: if self is type `Directory`, then
`self.listing` should be present
output:
output:
class: File
basename: output
size: 24
checksum: sha1$dd0a4c4c49ba43004d6611771972b6cf969c1c01
tags: [ step_input, workflow ]
28 changes: 28 additions & 0 deletions v1.0/v1.0/single_file_from_dir.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow

requirements:
StepInputExpressionRequirement: {}

inputs:
inf: File # tarfile
outputs:
output:
type: File
outputSource: second/output

steps:
first:
run: dir3.cwl
in:
inf: inf
out: [ outdir ]
second:
run: cat-tool.cwl
in:
file1:
source: first/outdir
valueFrom: $(self.listing[0])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you access the file by a name? The index might not be very reliable or desired.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not as easily as one would have to filter on basename - but this test only needs to verify that self.listing is populated and so [0] should be present.

out: [ output ]