Wdltest is python3 package to test wdl workflows.
- Java (version at least 8)
- Python3 (>= 3.7)
pip3 install --upgrade wdltest==1.15.0
wdltest -t test.json
It is possible to use environment variables in scripts using ${var_name}
notation
wdl
- path to wdl filethreads
- number of threads to utilizetests
- array of test configurations
name
- name of testbcoCheck
- flag (true/false) informing whether to check if bco.json is generatedtsdoutCheck
- flag (true/false) informing whether to check if stdout is generatedexpecterror
- flag (true/false) informing if the test should end with fail (conditions can be set as emptyy array then)inputs
- inputs for wdl executionconditions
- array of conditions to be met for test to be passed
file
- name of outputindex
- optional index if output is array. Default:0
name
- name of unit test to be printeserror_message
- error message in case of test failurecommand
- test command. Status0
gives succeed status.
{
"wdl":"${ROOTDIR}/src/main/wdl/modules/panel-hpo/panel-hpo.wdl",
"threads": 1,
"tests": [
{
"name":"Primary test",
"bcoCheck": true,
"stdoutCheck": true,
"inputs": {
"panel_hpo.hpo_terms": "HP:0001679, HP:0007018. HP:0000722, HP:0000256",
"panel_hpo.genes": "HTT",
"panel_hpo.diseases": "Osteogenesis imperfecta, Ehlers-Danlos",
"panel_hpo.sample_id": "test",
"panel_hpo.panel_names": ["ACMG_Incidental_Findings", "COVID-19_research", "Cancer_Germline", "Cardiovascular_disorders"],
"panel_hpo.phenotypes_description": "Increased height, disproportionately long limbs and digits, anterior chest deformity, mild to moderate joint laxity, vertebral column deformity (scoliosis and thoracic lordosis), and a narrow, highly arched palate with crowding of the teeth are frequent skeletal features"
},
"conditions": [
]
},
{
"name":"Error test",
"expecterror": true
"inputs": {
"panel_hpo.hpo_terms": "HP:0001679, HP:0007018. HP:0000722, HP:0000256",
"panel_hpo.genes": "HTT",
"panel_hpo.diseases": "Osteogenesis imperfecta, Ehlers-Danlos",
"panel_hpo.sample_id": "test",
"panel_hpo.panel_names": ["ACMG_Incidental_Findings", "COVID-19'_research", "Cancer_Germline", "Cardiovascular_disorders"],
"panel_hpo.phenotypes_description": "Increased height, disproportionately long limbs and digits, anterior chest deformity, mild to moderate joint laxity, vertebral column deformity (scoliosis and thoracic lordosis), and a narrow, highly arched palate with crowding of the teeth are frequent skeletal features"
},
"conditions": [
]
},
{
"name":"Primary test",
"inputs": {
"panel_hpo.hpo_terms": "HP:0001679, HP:0007018. HP:0000722, HP:0000256",
"panel_hpo.genes": "HTT",
"panel_hpo.diseases": "Osteogenesis imperfecta, Ehlers-Danlos",
"panel_hpo.sample_id": "test",
"panel_hpo.panel_names": ["ACMG_Incidental_Findings", "COVID-19_research", "Cancer_Germline", "Cardiovascular_disorders"],
"panel_hpo.phenotypes_description": "Increased height, disproportionately long limbs and digits, anterior chest deformity, mild to moderate joint laxity, vertebral column deformity (scoliosis and thoracic lordosis), and a narrow, highly arched palate with crowding of the teeth are frequent skeletal features"
},
"conditions": [
{
"file":"bco",
"name":"Bco exists",
"error_message":"Bco does not exist",
"command":"echo $file"
},
{
"file":"bco",
"name":"Provenance domain exists and is not empty",
"error_message":"Provenance domain not found in bco or is empty",
"command":"grep -q -m1 provenance_domain $file && jq -e 'if (.provenance_domain | length) == 0 then false else true end' $file"
},
{
"file":"bco",
"name":"Execution domain exists and is not empty",
"error_message":"Execution domain not found in bco or is empty",
"command":"grep -q -m1 execution_domain $file && jq -e 'if (.execution_domain | length) == 0 then false else true end' $file"
},
{
"file":"bco",
"name":"Parametric domain exists and is not empty",
"error_message":"Parametric domain not found in bco or is empty",
"command":"grep -q -m1 parametric_domain $file && jq -e 'if (.parametric_domain | length) == 0 then false else true end' $file"
},
{
"file":"bco",
"name":"Description domain exists and is not empty",
"warning":"true",
"command":"grep -q -m1 descripcion_domain $file && jq -e 'if (.description_domain | length) == 0 then false else true end' $file"
},
{
"file":"stdout_log",
"name":"Stdout exits",
"command":"test -f $file"
},
{
"file":"stdout_log",
"name":"Stdout exits",
"command":"test -f r$file"
}
]
}
]
}
ROOTDIR=$(pwd) python3 setup.py nosetests -s
python3 setup.py sdist bdist_wheel
twine upload --repository testpypi dist/wdltest-1.0.0*
twine upload --repository pypi dist/wdltest-1.0.0*
pip3 install --upgrade --no-deps wdltest==1.0.6
ps aux | grep Dweb | cut -d " " -f 2 | xargs kill -9
ps aux | grep Dweb
Resolved bug with Array outputs