Skip to content

Commit

Permalink
Cherry-picked carrot files from lb_carrot.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbergelson authored and cmnbroad committed Feb 3, 2025
1 parent 638fb11 commit fd4e834
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .carrot/carrot_eval.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version 1.0

task compare {
input {
String result
String image_to_use
}
command {
echo "Checking the result from previous test:"
echo "~{result}"
}
runtime {
docker: image_to_use
}
output {
File comparison_result = stdout()
}
}

workflow eval_workflow {
input {
String result
String image_to_use
}
call compare {
input:
result = result,
image_to_use = image_to_use
}
output {
File comparison_result = compare.comparison_result
}
}
35 changes: 35 additions & 0 deletions .carrot/carrot_test.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version 1.0

task test_htsjdk {
input {
File input_file
String image_to_use
}
command {
echo "pretending to run test on ~{input_file}"
}
runtime {
docker: image_to_use
}

output {
String result = stdout()
}
}

workflow test_workflow {
input {
File input_file
String image_to_use
}
call test_htsjdk {
input:
input_file = input_file,
image_to_use = image_to_use
}
output {
String result = test_htsjdk.result
}
}


4 changes: 4 additions & 0 deletions .carrot/eval.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"eval_workflow.result": "test_output:test_workflow.result"
}

4 changes: 4 additions & 0 deletions .carrot/eval_defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"eval_workflow.image_to_use": "ubuntu:latest"
}

1 change: 1 addition & 0 deletions .carrot/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3.10 -m carrot_cli test run --test_input test.json --eval_input eval.json 36d33423-15a5-4d8b-aa5d-cb04eb6f6017
4 changes: 4 additions & 0 deletions .carrot/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"test_workflow.image_to_use": "ubuntu:latest"
}

3 changes: 3 additions & 0 deletions .carrot/test_defaults.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"test_workflow.input_file": "gs://hellbender/test/resources/nio/big.txt"
}
1 change: 1 addition & 0 deletions .carrot/update_wdls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3.10 -m carrot_cli template update 03ff49e8-40ee-411e-b16f-f43b377cb6e9 --test_wdl carrot_test.wdl --eval_wdl carrot_eval.wdl
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This docker build is here to enable Carrot tests
# It's not intended for any other purpose
FROM eclipse-temurin:17

COPY . .
RUN ./gradlew compileTestJava
ENTRYPOINT bash

0 comments on commit fd4e834

Please sign in to comment.