[ARVADOS] created: 2.1.0-2449-g66ef73b96
Git user
git at public.arvados.org
Wed May 11 13:44:58 UTC 2022
at 66ef73b96e38c87a84ae64bd19385d5d5e9e07ed (commit)
commit 66ef73b96e38c87a84ae64bd19385d5d5e9e07ed
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Tue May 10 15:34:07 2022 -0400
19109: Add test case for discovering & uploading secondary files
Correctly find secondary files in the optional "File?" case
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/.licenseignore b/.licenseignore
index 387aeda94..203c378bd 100644
--- a/.licenseignore
+++ b/.licenseignore
@@ -50,6 +50,7 @@ docker/jobs/1078ECD7.key
*/script/rails
sdk/cwl/tests/input/blorp.txt
sdk/cwl/tests/tool/blub.txt
+sdk/cwl/tests/19109-upload-secondary/*
sdk/cwl/tests/federation/data/*
sdk/cwl/tests/fake-keep-mount/fake_collection_dir/.arvados#collection
sdk/go/manifest/testdata/*_manifest
diff --git a/sdk/cwl/arvados_cwl/runner.py b/sdk/cwl/arvados_cwl/runner.py
index 7d4310b0e..f2517f919 100644
--- a/sdk/cwl/arvados_cwl/runner.py
+++ b/sdk/cwl/arvados_cwl/runner.py
@@ -128,6 +128,9 @@ def set_secondary(fsaccess, builder, inputschema, secondaryspec, primary, discov
set_secondary(fsaccess, builder, i, secondaryspec, primary, discovered)
return
+ if inputschema == "File":
+ inputschema = {"type": "File"}
+
if isinstance(inputschema, basestring):
sd = search_schemadef(inputschema, reversed(builder.hints+builder.requirements))
if sd:
diff --git a/sdk/cwl/tests/19109-upload-secondary.cwl b/sdk/cwl/tests/19109-upload-secondary.cwl
new file mode 100644
index 000000000..cf5855ab1
--- /dev/null
+++ b/sdk/cwl/tests/19109-upload-secondary.cwl
@@ -0,0 +1,22 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+cwlVersion: v1.2
+class: Workflow
+inputs:
+ file1:
+ type: File?
+ secondaryFiles:
+ - pattern: .tbi
+ required: true
+outputs:
+ out:
+ type: File
+ outputSource: cat/out
+steps:
+ cat:
+ in:
+ inp: file1
+ run: cat2.cwl
+ out: [out]
diff --git a/sdk/cwl/tests/19109-upload-secondary.yml b/sdk/cwl/tests/19109-upload-secondary.yml
new file mode 100644
index 000000000..c97850019
--- /dev/null
+++ b/sdk/cwl/tests/19109-upload-secondary.yml
@@ -0,0 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+file1:
+ class: File
+ location: 19109-upload-secondary/file1.txt
diff --git a/sdk/cwl/tests/19109-upload-secondary/file1.txt b/sdk/cwl/tests/19109-upload-secondary/file1.txt
new file mode 100644
index 000000000..41549dbf8
--- /dev/null
+++ b/sdk/cwl/tests/19109-upload-secondary/file1.txt
@@ -0,0 +1 @@
+strawberry
diff --git a/sdk/cwl/tests/19109-upload-secondary/file1.txt.tbi b/sdk/cwl/tests/19109-upload-secondary/file1.txt.tbi
new file mode 100644
index 000000000..c9438bd23
--- /dev/null
+++ b/sdk/cwl/tests/19109-upload-secondary/file1.txt.tbi
@@ -0,0 +1 @@
+blueberry
\ No newline at end of file
diff --git a/sdk/cwl/tests/arvados-tests.yml b/sdk/cwl/tests/arvados-tests.yml
index 9e691bdba..836e66700 100644
--- a/sdk/cwl/tests/arvados-tests.yml
+++ b/sdk/cwl/tests/arvados-tests.yml
@@ -449,3 +449,16 @@
output: {}
tool: 18994-basename/wf_ren.cwl
doc: "Test issue 18994 - correctly stage file with modified basename"
+
+- job: 19109-upload-secondary.yml
+ output: {
+ "out": {
+ "basename": "catted",
+ "class": "File",
+ "location": "catted",
+ "size": 20,
+ "checksum": "sha1$c4cead17cebdd829f38c48e18a28f1da72339ef7"
+ }
+ }
+ tool: 19109-upload-secondary.cwl
+ doc: "Test issue 19109 - correctly discover & upload secondary files"
diff --git a/sdk/cwl/tests/cat2.cwl b/sdk/cwl/tests/cat2.cwl
new file mode 100644
index 000000000..f8cd57822
--- /dev/null
+++ b/sdk/cwl/tests/cat2.cwl
@@ -0,0 +1,17 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+cwlVersion: v1.2
+class: CommandLineTool
+inputs:
+ - id: inp
+ type: File
+ secondaryFiles:
+ - pattern: .tbi
+ required: true
+stdout: catted
+outputs:
+ out:
+ type: stdout
+arguments: [cat, '$(inputs.inp.path)', '$(inputs.inp.secondaryFiles[0].path)']
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list