Skip to content

Commit 66ff06d

Browse files
bshifawbshifaw
and
bshifaw
authored
Minor updates to validation command (#273)
* Added validation section to README.md, error logic if womtool and miniwdl are disabled * Clearer error message, added assert_can_communicate_with_server function --------- Co-authored-by: bshifaw <[email protected]>
1 parent 3797733 commit 66ff06d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ Cromshell is a CLI for submitting workflows to a Cromwell server and monitoring/
113113
* `-c/--color` Color outliers in task level cost results.
114114
* `-d/--detailed` Get the cost for a workflow at the task level.
115115

116+
#### Validate WDL
117+
* `validate [wdl] [input json] --dependencies-zip [wdl_zip_file]`
118+
* Validate a WDL file.
119+
* Runs both miniwdl and womtool validation by default, but can be configured to run only one or the other.
120+
* Womtool validation via Cromwell server API does not support validation of imported files, however miniwdl does.
121+
* `--dependencies-zip` MiniWDL option: ZIP file or directory containing workflow source files that are used to resolve local imports.
122+
116123
## Features:
117124
* Running `submit` will create a new folder in the `~/.cromshell/${CROMWELL_URL}/` directory named with the cromwell job id of the newly submitted job.
118125
It will copy your wdl and json inputs into the folder for reproducibility.

src/cromshell/validate/command.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import click
55

6+
import cromshell.utilities.http_utils as http_utils
67
import cromshell.utilities.miniwdl_utils as miniwdl
78
import cromshell.utilities.womtool_utils as womtool
89

@@ -80,11 +81,23 @@ def main(
8081

8182
return_code = 0
8283

84+
if no_womtool and no_miniwdl:
85+
LOGGER.error(
86+
"Both `--no-womtool` and `--no-miniwdl` options were used but"
87+
"at least one validation tool must be enabled."
88+
)
89+
raise MissingArgumentError(
90+
"Both `--no-womtool` and `--no-miniwdl` options were used but "
91+
"at least one validation tool must be enabled."
92+
)
93+
8394
if not no_womtool:
8495
if not wdl_json:
8596
LOGGER.error("WDL JSON file is required.")
8697
raise MissingArgumentError("WDL JSON file is required.")
8798

99+
http_utils.assert_can_communicate_with_server(config)
100+
88101
womtool.womtool_validate_wdl_and_json(
89102
wdl=str(wdl), wdl_json=str(wdl_json), config=config
90103
)

0 commit comments

Comments
 (0)