Skip to content

Commit

Permalink
Merge branch 'main' into helloDockerHostname-update-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
tefirman committed Jan 16, 2025
2 parents 59322b8 + aadcb4c commit 69108a8
Show file tree
Hide file tree
Showing 34 changed files with 506 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ New unit test suggestions are tracked as GitHub issues. When creating a unit tes
4. Ensure your proposed WDL runs locally via `miniwdl run` or `java -jar cromwell-86.jar run`
5. If you are user of PROOF, please also make sure to test that the WDL unit test runs via PROOF.
- If your WDL succeeds locally but fails in PROOF, please report the issue in the [proof-api repo](https://github.com/FredHutch/proof-api/issues).
6. Add the WDL to a subdirectory by the same name, i.e. `coolUnitTest/coolUnitTest.wdl`
6. Add the WDL to a subdirectory by the same name, i.e. `coolUnitTest/coolUnitTest.wdl`. If the WDL is expected to fail WOMtool the subdirectory AND the WDL file name must start with `badVal`. If the WDL is expected to fail both WOMtool and a Cromwell run, then the subdirectory AND the WDL file name must start with `badRun`.
7. Make sure to include an `inputs.json` and `options.json` if required and make sure that any other. input files referenced in `inputs.json` are provided in the same directory.
8. Add a README to the WDL's subdirectory describing the unit test's functionality and purpose.
9. Commit and push your proposed changes to GitHub.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ jobs:
- name: Set up Python
run: uv python install 3.13

- name: Install dependencies
run: uv sync --all-extras

- name: Run tests
env:
PROOF_API_TOKEN_DEV: ${{ secrets.PROOF_API_TOKEN_DEV }}
run: uv run pytest tests/cromwell-api/ --verbose
run: uv run pytest tests/cromwellapi/ --verbose
8 changes: 4 additions & 4 deletions arrayOperations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ miniwdl run arrayOperations.wdl \
additional_strings='["foo", "bar"]' \
nested_arrays='[["nested1", "nested2"], ["nested3", "nested4"]]' \
numbers='[1, 2, 3, 4, 5]' \
input_files='["test1.txt", "test2.txt"]'
input_files='["data/test1.txt", "data/test2.txt"]'
```

Example inputs.json:
Expand All @@ -101,9 +101,9 @@ Example inputs.json:
],
"ArrayOperations.numbers": [1, 2, 3, 4, 5],
"ArrayOperations.input_files": [
"test1.txt",
"test2.txt",
"test3.txt"
"data/test1.txt",
"data/test2.txt",
"data/test3.txt"
]
}
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions arrayOperations/inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
],
"ArrayOperations.numbers": [1, 2, 3, 4, 5],
"ArrayOperations.input_files": [
"arrayOperations/test1.txt",
"arrayOperations/test2.txt",
"arrayOperations/test3.txt"
"arrayOperations/data/test1.txt",
"arrayOperations/data/test2.txt",
"arrayOperations/data/test3.txt"
]
}
15 changes: 15 additions & 0 deletions badRunParseBatchFile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# parseBatchFile WDL Workflow

## Overview
xxx

## Workflow Components

### Workflow: `parseBatchFile`
xxx

## Purpose
To check Cromwell failures behavior

## Version
WDL 1.0
46 changes: 46 additions & 0 deletions badRunParseBatchFile/badRunParseBatchFile.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version 1.0
# This workflow takes a tab separated file where each row is a set of data to be used in each
# of the independent scattered task series that you have as your workflow process. This file
# will, for example, have column names `sampleName`, `bamLocation`, and `bedlocation`. This
# allows you to know that regardless of the order of the columns in your batch file, the correct
# inputs will be used for the tasks you define.
workflow parseBatchFile {
input {
File batchFile
}
Array[Object] batchInfo = read_objects(batchFile)
scatter (job in batchInfo){
String sampleName = job.sampleName
File bamFile = job.bamLocation
File bedFile = job.bedLocation

## INSERT YOUR WORKFLOW TO RUN PER LINE IN YOUR BATCH FILE HERE!!!!
call test {
input: in1=sampleName, in2=bamFile, in3=bedFile
}

} # End Scatter over the batch file
# Outputs that will be retained when execution is complete
output {
Array[File] outputArray = test.item_out
}
# End workflow
}

#### TASK DEFINITIONS
# echo some text to stdout, treats files as strings just to echo them as a dummy example
task test {
input {
String in1
String in2
String in3
}
command {
echo ~{in1}
echo ~{in2}
echo ~{in3}
}
output {
File item_out = stdout()
}
}
10 changes: 10 additions & 0 deletions badValMissingValue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# badValMissingValue WDL Workflow

## Overview
A test workflow that demonstrates an invalid WDL.

### Expected error

```
Cannot lookup value 'docker_image', it is never declared. Available values are: ['str']
```
File renamed without changes.
71 changes: 0 additions & 71 deletions tests/cromwell-api/cromwell.py

This file was deleted.

19 changes: 0 additions & 19 deletions tests/cromwell-api/test-metadata.py

This file was deleted.

8 changes: 0 additions & 8 deletions tests/cromwell-api/test-submit.py

This file was deleted.

10 changes: 0 additions & 10 deletions tests/cromwell-api/utils.py

This file was deleted.

10 changes: 8 additions & 2 deletions tests/cromwell-api/conftest.py → tests/cromwellapi/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

import pytest

from cromwell import CromwellApi
from proof import ProofApi

Expand All @@ -13,7 +14,7 @@ def cromwell_api():
return CromwellApi(url=cromwell_url)


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(scope="session")
def submit_wdls(cromwell_api):
"""
This fixture runs automatically before any tests.
Expand All @@ -25,7 +26,12 @@ def submit_wdls(cromwell_api):

print(f"Submitting {len(wdl_paths)} wdls ...")

out = [cromwell_api.submit_workflow(wdl_path=path) for path in wdl_paths]
out = []
for path in wdl_paths:
opts_path = path.parent / "options.json"
opts_path = opts_path if opts_path.exists() else None
res = cromwell_api.submit_workflow(wdl_path=path, options=opts_path)
out.append(res)

# Yield to let tests run
yield out
Expand Down
Loading

0 comments on commit 69108a8

Please sign in to comment.