diff --git a/tests/conf/run_cwl_test.conf b/tests/conf/run_cwl_test.conf new file mode 100644 index 0000000..1deda1e --- /dev/null +++ b/tests/conf/run_cwl_test.conf @@ -0,0 +1,2 @@ +order: +- ./cwl/python.cwl diff --git a/tests/cwl/python.cwl b/tests/cwl/python.cwl new file mode 100644 index 0000000..ec89dd9 --- /dev/null +++ b/tests/cwl/python.cwl @@ -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 diff --git a/tests/inputs/toy.py b/tests/inputs/toy.py new file mode 100644 index 0000000..4e61b5c --- /dev/null +++ b/tests/inputs/toy.py @@ -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}") diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 522eb4b..3f5d24c 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -16,8 +16,6 @@ test cases: - --quiet - --verbose - -c cwl.conf - - */ #[test] @@ -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; @@ -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() @@ -223,4 +219,3 @@ fn can_run_cwl() { assert_eq!(output_records, expected_output_records); } -*/ diff --git a/tests/outputs/expected_output_run_cwl.csv b/tests/outputs/expected_output_run_cwl.csv new file mode 100644 index 0000000..d643b7d --- /dev/null +++ b/tests/outputs/expected_output_run_cwl.csv @@ -0,0 +1,3 @@ +File Path,Edam ID,Label +./inputs/toy.py,http://edamontology.org/format_3996,Python script +./inputs/toy.fa,,