Skip to content

Commit

Permalink
Add test configuration and files for CWL extension mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaccha committed Mar 13, 2024
1 parent 8d9a50e commit 8a37292
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
2 changes: 2 additions & 0 deletions tests/conf/run_cwl_test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
order:
- ./cwl/python.cwl
25 changes: 25 additions & 0 deletions tests/cwl/python.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cwlVersion: v1.2
class: CommandLineTool

requirements:
DockerRequirement:
dockerPull: python:3.11.8-alpine3.19
InlineJavascriptRequirement: {}

baseCommand: ["python"]

successCodes: [0, 139]

inputs:
input_file:
type: File
inputBinding:
position: 1

outputs: {}

$namespaces:
tataki: https://github.com/sapporo-wes/tataki

tataki:edam_id: http://edamontology.org/format_3996
tataki:label: Python script
7 changes: 7 additions & 0 deletions tests/inputs/toy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def create_list_w_list_comprehension(start, end):
return [x for x in range(start, end + 1)]

if __name__ == "__main__":
start, end = 1, 10
result = create_list_w_list_comprehension(start, end)
print(f"{result}")
11 changes: 3 additions & 8 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ test cases:
- --quiet
- --verbose
- -c cwl.conf
*/

#[test]
Expand Down Expand Up @@ -196,13 +194,11 @@ fn can_be_verbose() {
assert!(stderr.contains("DEBUG"));
}

// TODO
/*
#[test]
fn can_run_cwl() {
let out = tataki(
&["./inputs/toy.bam", "./inputs/toy.fa"],
&["-c", "./inputs/cwl.conf"],
&["./inputs/toy.py", "./inputs/toy.fa"],
&["-c", "./conf/run_cwl_test.conf"],
);

let stdout = out.stdout;
Expand All @@ -214,7 +210,7 @@ fn can_run_cwl() {
.expect("Failed to parse the output as CSV");

let mut expected_output_rdr =
csv::Reader::from_path(Path::new("tests/outputs/expected_output_cwl.csv"))
csv::Reader::from_path(Path::new("tests/outputs/expected_output_run_cwl.csv"))
.expect("Failed to read the expected output file");
let expected_output_records = expected_output_rdr
.records()
Expand All @@ -223,4 +219,3 @@ fn can_run_cwl() {

assert_eq!(output_records, expected_output_records);
}
*/
3 changes: 3 additions & 0 deletions tests/outputs/expected_output_run_cwl.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
File Path,Edam ID,Label
./inputs/toy.py,http://edamontology.org/format_3996,Python script
./inputs/toy.fa,,

0 comments on commit 8a37292

Please sign in to comment.