From 2de7e27c7510e7ccc401db2e3b9476faf9e00231 Mon Sep 17 00:00:00 2001 From: tefirman Date: Tue, 14 Jan 2025 16:35:22 -0800 Subject: [PATCH 1/2] Adding initial version of nonstandard outputs WDL unit test --- nonstandardOutputs/README | 85 +++++++++++++++++++++++ nonstandardOutputs/nonstandardOutputs.wdl | 48 +++++++++++++ nonstandardOutputs/options.json | 5 ++ 3 files changed, 138 insertions(+) create mode 100644 nonstandardOutputs/README create mode 100644 nonstandardOutputs/nonstandardOutputs.wdl create mode 100644 nonstandardOutputs/options.json diff --git a/nonstandardOutputs/README b/nonstandardOutputs/README new file mode 100644 index 0000000..6022de5 --- /dev/null +++ b/nonstandardOutputs/README @@ -0,0 +1,85 @@ +# Unit test for Nonstandard Outputs + +## Overview +The test_nonstandard_outputs workflow is a unit test designed to validate and demonstrate handling of various non-standard output file scenarios in WDL (Workflow Description Language). It tests the workflow engine's ability to handle: + +- Files with special characters in names +- Files without extensions +- Files in nested directories +- Symbolic links +- Pattern-based file globbing + +## Purpose +This workflow serves as a comprehensive test case for: +- Special character handling in file names +- Path handling for files without extensions +- Nested directory structure handling +- Symbolic link resolution +- Glob pattern file collection +- File system operations +- Output file declaration patterns +- Docker container file system interaction + +## Workflow Components + +### Workflow: `test_nonstandard_outputs` +The main workflow demonstrates various non-standard output file handling capabilities. + +**Outputs:** +- `special_chars`: File - Output file containing special characters in name +- `no_extension`: File - Output file without a file extension +- `nested_output`: File - Output file from a nested directory structure +- `symlink_file`: File - Symbolic link to another file +- `glob_files`: Array[File] - Collection of files matching a pattern + +### Tasks + +#### Task: `generate_diverse_outputs` +Creates various types of output files to test the workflow engine's handling capabilities. + +**Operations:** +- Creates a file with special characters (@, #) in the name +- Generates a file without an extension +- Creates a nested directory structure with files +- Creates and manages symbolic links +- Generates multiple files matching a pattern + +**Runtime Requirements:** +- Docker: ubuntu:noble-20241118.1 + +## Usage +```bash +# Execute with cromwell +java -jar cromwell.jar run nonstandardOutputs.wdl + +# Execute with miniwdl +miniwdl run nonstandardOutputs.wdl +``` + +No input parameters are required for this workflow. + +Expected outputs: +``` +outputs/ +├── special_chars # File named "test@file#1.txt" +├── no_extension # File named "datafile" +├── nested_output # File from nested/dir/test.txt +├── symlink_file # Symbolic link "link.txt" +└── glob_files/ # Directory containing pattern_*.out files + ├── pattern_1.out + ├── pattern_2.out + └── pattern_3.out +``` + +## Version +WDL 1.0 + +## Additional Notes +- Tests workflow engine's ability to handle non-standard file names +- Verifies proper handling of nested directory structures +- Validates symbolic link resolution +- Demonstrates glob pattern functionality +- Tests Docker container file system interactions +- Useful for validating output handling in different execution environments +- Helps identify potential file system compatibility issues +- Verifies proper path resolution and file access patterns diff --git a/nonstandardOutputs/nonstandardOutputs.wdl b/nonstandardOutputs/nonstandardOutputs.wdl new file mode 100644 index 0000000..203875e --- /dev/null +++ b/nonstandardOutputs/nonstandardOutputs.wdl @@ -0,0 +1,48 @@ +version 1.0 + +workflow test_nonstandard_outputs { + call generate_diverse_outputs + + output { + File special_chars = generate_diverse_outputs.file_special_chars + File no_extension = generate_diverse_outputs.file_no_extension + File nested_output = generate_diverse_outputs.nested_file + File symlink_file = generate_diverse_outputs.symlink_output + Array[File] glob_files = generate_diverse_outputs.pattern_files + } +} + +task generate_diverse_outputs { + command <<< + # File with special characters + echo "test content" > "test@file#1.txt" + + # File without extension + echo "no extension" > datafile + + # Nested directory output + mkdir -p nested/dir + echo "nested content" > nested/dir/test.txt + + # Create a symlink + echo "original" > original.txt + ln -s original.txt link.txt + + # Multiple pattern files + for i in {1..3}; do + echo "pattern $i" > "pattern_$i.out" + done + >>> + + output { + File file_special_chars = "test@file#1.txt" + File file_no_extension = "datafile" + File nested_file = "nested/dir/test.txt" + File symlink_output = "link.txt" + Array[File] pattern_files = glob("pattern_*.out") + } + + runtime { + docker: "ubuntu:noble-20241118.1@sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6734ab" + } +} diff --git a/nonstandardOutputs/options.json b/nonstandardOutputs/options.json new file mode 100644 index 0000000..1d043b8 --- /dev/null +++ b/nonstandardOutputs/options.json @@ -0,0 +1,5 @@ +{ + "workflow_failure_mode": "ContinueWhilePossible", + "write_to_cache": false, + "read_from_cache": false +} From 947f64be8e89dd816adeb839ade3531a68c0440f Mon Sep 17 00:00:00 2001 From: tefirman Date: Wed, 15 Jan 2025 15:31:53 -0800 Subject: [PATCH 2/2] Removing sha tag from ubuntu Docker image --- nonstandardOutputs/nonstandardOutputs.wdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonstandardOutputs/nonstandardOutputs.wdl b/nonstandardOutputs/nonstandardOutputs.wdl index 203875e..9e5d9a9 100644 --- a/nonstandardOutputs/nonstandardOutputs.wdl +++ b/nonstandardOutputs/nonstandardOutputs.wdl @@ -43,6 +43,6 @@ task generate_diverse_outputs { } runtime { - docker: "ubuntu:noble-20241118.1@sha256:80dd3c3b9c6cecb9f1667e9290b3bc61b78c2678c02cbdae5f0fea92cc6734ab" + docker: "ubuntu:noble-20241118.1" } }