diff --git a/src/ARCtrl/ARC.fs b/src/ARCtrl/ARC.fs index 53b4826a..4f8b4bc8 100644 --- a/src/ARCtrl/ARC.fs +++ b/src/ARCtrl/ARC.fs @@ -55,7 +55,7 @@ module ARCAux = |> FileSystem.create fs.Union(tree) - let updateFSByCWL (cwl : CWL.CWLProcessingUnits.CWLToolDescription option) (fs : FileSystem) = + let updateFSByCWL (cwl : unit option) (fs : FileSystem) = let workflows = FileSystemTree.createWorkflowsFolder [||] let runs = FileSystemTree.createRunsFolder [||] let tree = @@ -65,7 +65,7 @@ module ARCAux = [] -type ARC(?isa : ArcInvestigation, ?cwl : CWL.CWLProcessingUnits.CWLToolDescription, ?fs : FileSystem.FileSystem) = +type ARC(?isa : ArcInvestigation, ?cwl : unit, ?fs : FileSystem.FileSystem) = let mutable _isa = isa let mutable _cwl = cwl diff --git a/src/CWL/ARCtrl.CWL.fsproj b/src/CWL/ARCtrl.CWL.fsproj index 97dc3a7a..1a98eda5 100644 --- a/src/CWL/ARCtrl.CWL.fsproj +++ b/src/CWL/ARCtrl.CWL.fsproj @@ -17,9 +17,6 @@ - - - diff --git a/src/CWL/CWL.fs b/src/CWL/CWL.fs index 10205977..9d1b2a5c 100644 --- a/src/CWL/CWL.fs +++ b/src/CWL/CWL.fs @@ -1,5 +1,6 @@ -namespace ARCtrl.CWL +namespace ARCtrl +open ARCtrl.CWL open DynamicObj open CWLTypes open Requirements @@ -11,7 +12,7 @@ module CWLProcessingUnits = type CWLToolDescription ( cwlVersion: string, - cls: Class, + cls: CWLClass, outputs: Output [], ?baseCommand: string [], ?requirements: Requirement [], @@ -22,7 +23,7 @@ module CWLProcessingUnits = inherit DynamicObj () let mutable _cwlVersion: string = cwlVersion - let mutable _class: Class = cls + let mutable _class: CWLClass = cls let mutable _outputs: Output [] = outputs let mutable _baseCommand: string [] option = baseCommand let mutable _requirements: Requirement [] option = requirements @@ -64,7 +65,7 @@ module CWLProcessingUnits = type CWLWorkflowDescription( cwlVersion: string, - cls: Class, + cls: CWLClass, steps: WorkflowStep [], inputs: Input [], outputs: Output [], @@ -75,7 +76,7 @@ module CWLProcessingUnits = inherit DynamicObj() let mutable _cwlVersion: string = cwlVersion - let mutable _class: Class = cls + let mutable _class: CWLClass = cls let mutable _steps: WorkflowStep [] = steps let mutable _inputs: Input [] = inputs let mutable _outputs: Output [] = outputs diff --git a/src/CWL/CWLTypes.fs b/src/CWL/CWLTypes.fs index 7bb1cf40..7a40590c 100644 --- a/src/CWL/CWLTypes.fs +++ b/src/CWL/CWLTypes.fs @@ -31,7 +31,7 @@ module CWLTypes = | Null | Array of CWLType - type Class = + type CWLClass = | Workflow | CommandLineTool | ExpressionTool diff --git a/src/CWL/Decode.fs b/src/CWL/Decode.fs index daf30297..2e3dbd3c 100644 --- a/src/CWL/Decode.fs +++ b/src/CWL/Decode.fs @@ -1,5 +1,6 @@ namespace ARCtrl.CWL +open ARCtrl open YAMLicious open YAMLicious.YAMLiciousTypes open CWLTypes @@ -317,7 +318,7 @@ module Decode = let versionDecoder: (YAMLiciousTypes.YAMLElement -> string) = Decode.object (fun get -> get.Required.Field "cwlVersion" Decode.string) - let classDecoder: (YAMLiciousTypes.YAMLElement -> Class) = + let classDecoder: (YAMLiciousTypes.YAMLElement -> CWLClass) = Decode.object (fun get -> match get.Required.Field "class" Decode.string with | "Workflow" -> Workflow diff --git a/tests/CWL/ARCtrl.CWL.Tests.fsproj b/tests/CWL/ARCtrl.CWL.Tests.fsproj index 586424c8..495bc135 100644 --- a/tests/CWL/ARCtrl.CWL.Tests.fsproj +++ b/tests/CWL/ARCtrl.CWL.Tests.fsproj @@ -8,7 +8,6 @@ - diff --git a/tests/CWL/CWLObject.Tests.fs b/tests/CWL/CWLObject.Tests.fs index 197e24d4..5f472922 100644 --- a/tests/CWL/CWLObject.Tests.fs +++ b/tests/CWL/CWLObject.Tests.fs @@ -5,17 +5,22 @@ open ARCtrl.CWL.CWLTypes open ARCtrl.CWL.Requirements open ARCtrl.CWL.Inputs open ARCtrl.CWL.Outputs -open YAMLicious open TestingUtils +open DynamicObj let decodeCWLToolDescription = - TestObjects.CWL.CommandLineTool.cwl + TestObjects.CWL.CommandLineTool.cwlFile |> Decode.decodeCommandLineTool +let decodeCWLToolDescriptionMetadata = + TestObjects.CWL.CommandLineToolMetadata.cwlFile + |> Decode.decodeCommandLineTool + + let testCWLToolDescription = - testList "CWLToolDescription" [ + testList "Decode" [ testCase "Class" <| fun _ -> - let expected = Class.CommandLineTool + let expected = CWLClass.CommandLineTool let actual = decodeCWLToolDescription.Class Expect.isTrue (expected = actual) @@ -170,4 +175,170 @@ let testCWLToolDescription = Expect.isTrue (expected = actual) $"Expected: {expected}\nActual: {actual}" + ] + +let testCWLToolDescriptionMetadata = + testList "Decode with Metadata" [ + testCase "Class" <| fun _ -> + let expected = CWLClass.CommandLineTool + let actual = decodeCWLToolDescriptionMetadata.Class + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "CWLVersion" <| fun _ -> + let expected = "v1.2" + let actual = decodeCWLToolDescriptionMetadata.CWLVersion + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "baseCommand" <| fun _ -> + let expected = Some [|"dotnet"; "fsi"; "script.fsx"|] + let actual = decodeCWLToolDescriptionMetadata.BaseCommand + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testList "Hints" [ + let hintsItem = decodeCWLToolDescriptionMetadata.Hints + testCase "DockerRequirement" <| fun _ -> + let expected = DockerRequirement {DockerPull = Some "mcr.microsoft.com/dotnet/sdk:6.0"; DockerFile = None; DockerImageId = None} + let actual = hintsItem.Value.[0] + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + ] + testList "Requirements" [ + let requirementsItem = decodeCWLToolDescriptionMetadata.Requirements + testCase "InitialWorkDirRequirement" <| fun _ -> + let expected = InitialWorkDirRequirement [|Dirent {Entry = "$include: script.fsx"; Entryname = Some "script.fsx"; Writable = None }|] + let actual = requirementsItem.Value.[0] + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "EnvVarRequirement" <| fun _ -> + let expected = EnvVarRequirement [|{EnvName = "DOTNET_NOLOGO"; EnvValue = "true"}|] + let actual = requirementsItem.Value.[1] + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "NetworkAccessRequirement" <| fun _ -> + let expected = NetworkAccessRequirement + let actual = requirementsItem.Value.[2] + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + ] + testList "Inputs" [ + let inputsItem = decodeCWLToolDescriptionMetadata.Inputs.Value + testCase "Length" <| fun _ -> + let expected = 2 + let actual = inputsItem.Length + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testList "File" [ + let fileItem = inputsItem.[0] + testCase "Name" <| fun _ -> + let expected = "firstArg" + let actual = fileItem.Name + Expect.isTrue + ("firstArg" = fileItem.Name) + "Name of input is not 'firstArg'" + testCase "Type" <| fun _ -> + let expected = File (FileInstance()) + let actual = fileItem.Type_.Value + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "InputBinding" <| fun _ -> + let expected = Some {Position = Some 1; Prefix = None; ItemSeparator = None; Separate = None} + let actual = fileItem.InputBinding + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + ] + testList "String" [ + let stringItem = inputsItem.[1] + testCase "Name" <| fun _ -> + let expected = "secondArg" + let actual = stringItem.Name + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "Type" <| fun _ -> + let expected = String + let actual = stringItem.Type_.Value + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "InputBinding" <| fun _ -> + let expected = Some {Position = Some 2; Prefix = None; ItemSeparator = None; Separate = None} + let actual = stringItem.InputBinding + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + ] + ] + testList "Outputs" [ + let outputsItem = decodeCWLToolDescriptionMetadata.Outputs + testCase "Length" <| fun _ -> + let expected = 2 + let actual = outputsItem.Length + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testList "Directory" [ + let directoryItem = outputsItem.[0] + testCase "Name" <| fun _ -> + let expected = "output" + let actual = directoryItem.Name + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "Type" <| fun _ -> + let expected = Directory (DirectoryInstance()) + let actual = directoryItem.Type_.Value + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "OutputBinding" <| fun _ -> + let expected = Some {Glob = Some "$(runtime.outdir)/.nuget"} + let actual = directoryItem.OutputBinding + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + ] + testList "File" [ + let fileItem = outputsItem.[1] + testCase "Name" <| fun _ -> + let expected = "output2" + let actual = fileItem.Name + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "Type" <| fun _ -> + let expected = File (FileInstance()) + let actual = fileItem.Type_.Value + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + testCase "OutputBinding" <| fun _ -> + let expected = Some {Glob = Some "$(runtime.outdir)/*.csv"} + let actual = fileItem.OutputBinding + Expect.isTrue + (expected = actual) + $"Expected: {expected}\nActual: {actual}" + ] + ] + testCase "Metadata" <| fun _ -> + Expect.isSome decodeCWLToolDescriptionMetadata.Metadata $"Expected {decodeCWLToolDescriptionMetadata.Metadata} to be Some" + let expected = TestObjects.CWL.CommandLineToolMetadata.expectedMetadataString.Trim().Replace("\r\n", "\n") + let actual = (decodeCWLToolDescriptionMetadata.Metadata.Value |> DynObj.format).Trim().Replace("\r\n", "\n") + Expect.equal actual expected + $"Expected: {expected}\nActual: {actual}" + ] + +let main = + testList "CWLToolDescription" [ + testCWLToolDescription + testCWLToolDescriptionMetadata ] \ No newline at end of file diff --git a/tests/CWL/CWLObjectMetadata.Tests.fs b/tests/CWL/CWLObjectMetadata.Tests.fs deleted file mode 100644 index a913bc06..00000000 --- a/tests/CWL/CWLObjectMetadata.Tests.fs +++ /dev/null @@ -1,174 +0,0 @@ -module Tests.CWLObjectMetadata - -open ARCtrl.CWL -open ARCtrl.CWL.CWLTypes -open ARCtrl.CWL.Requirements -open ARCtrl.CWL.Inputs -open ARCtrl.CWL.Outputs -open DynamicObj -open YAMLicious -open TestingUtils - -let decodeCWLToolDescription = - TestObjects.CWL.CommandLineToolMetadata.cwl - |> Decode.decodeCommandLineTool - -let testCWLToolDescriptionMetadata = - testList "CWLToolDescription" [ - testCase "Class" <| fun _ -> - let expected = Class.CommandLineTool - let actual = decodeCWLToolDescription.Class - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "CWLVersion" <| fun _ -> - let expected = "v1.2" - let actual = decodeCWLToolDescription.CWLVersion - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "baseCommand" <| fun _ -> - let expected = Some [|"dotnet"; "fsi"; "script.fsx"|] - let actual = decodeCWLToolDescription.BaseCommand - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testList "Hints" [ - let hintsItem = decodeCWLToolDescription.Hints - testCase "DockerRequirement" <| fun _ -> - let expected = DockerRequirement {DockerPull = Some "mcr.microsoft.com/dotnet/sdk:6.0"; DockerFile = None; DockerImageId = None} - let actual = hintsItem.Value.[0] - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - ] - testList "Requirements" [ - let requirementsItem = decodeCWLToolDescription.Requirements - testCase "InitialWorkDirRequirement" <| fun _ -> - let expected = InitialWorkDirRequirement [|Dirent {Entry = "$include: script.fsx"; Entryname = Some "script.fsx"; Writable = None }|] - let actual = requirementsItem.Value.[0] - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "EnvVarRequirement" <| fun _ -> - let expected = EnvVarRequirement [|{EnvName = "DOTNET_NOLOGO"; EnvValue = "true"}|] - let actual = requirementsItem.Value.[1] - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "NetworkAccessRequirement" <| fun _ -> - let expected = NetworkAccessRequirement - let actual = requirementsItem.Value.[2] - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - ] - testList "Inputs" [ - let inputsItem = decodeCWLToolDescription.Inputs.Value - testCase "Length" <| fun _ -> - let expected = 2 - let actual = inputsItem.Length - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testList "File" [ - let fileItem = inputsItem.[0] - testCase "Name" <| fun _ -> - let expected = "firstArg" - let actual = fileItem.Name - Expect.isTrue - ("firstArg" = fileItem.Name) - "Name of input is not 'firstArg'" - testCase "Type" <| fun _ -> - let expected = File (FileInstance()) - let actual = fileItem.Type_.Value - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "InputBinding" <| fun _ -> - let expected = Some {Position = Some 1; Prefix = None; ItemSeparator = None; Separate = None} - let actual = fileItem.InputBinding - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - ] - testList "String" [ - let stringItem = inputsItem.[1] - testCase "Name" <| fun _ -> - let expected = "secondArg" - let actual = stringItem.Name - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "Type" <| fun _ -> - let expected = String - let actual = stringItem.Type_.Value - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "InputBinding" <| fun _ -> - let expected = Some {Position = Some 2; Prefix = None; ItemSeparator = None; Separate = None} - let actual = stringItem.InputBinding - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - ] - ] - testList "Outputs" [ - let outputsItem = decodeCWLToolDescription.Outputs - testCase "Length" <| fun _ -> - let expected = 2 - let actual = outputsItem.Length - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testList "Directory" [ - let directoryItem = outputsItem.[0] - testCase "Name" <| fun _ -> - let expected = "output" - let actual = directoryItem.Name - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "Type" <| fun _ -> - let expected = Directory (DirectoryInstance()) - let actual = directoryItem.Type_.Value - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "OutputBinding" <| fun _ -> - let expected = Some {Glob = Some "$(runtime.outdir)/.nuget"} - let actual = directoryItem.OutputBinding - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - ] - testList "File" [ - let fileItem = outputsItem.[1] - testCase "Name" <| fun _ -> - let expected = "output2" - let actual = fileItem.Name - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "Type" <| fun _ -> - let expected = File (FileInstance()) - let actual = fileItem.Type_.Value - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - testCase "OutputBinding" <| fun _ -> - let expected = Some {Glob = Some "$(runtime.outdir)/*.csv"} - let actual = fileItem.OutputBinding - Expect.isTrue - (expected = actual) - $"Expected: {expected}\nActual: {actual}" - ] - ] - testCase "Metadata" <| fun _ -> - Expect.isSome decodeCWLToolDescription.Metadata $"Expected {decodeCWLToolDescription.Metadata} to be Some" - let expected = TestObjects.CWL.CommandLineToolMetadata.expectedMetadataString.Trim().Replace("\r\n", "\n") - let actual = (decodeCWLToolDescription.Metadata.Value |> DynObj.format).Trim().Replace("\r\n", "\n") - Expect.equal actual expected - $"Expected: {expected}\nActual: {actual}" - ] \ No newline at end of file diff --git a/tests/CWL/CWLWorkflow.Tests.fs b/tests/CWL/CWLWorkflow.Tests.fs index a603181b..5df8c33f 100644 --- a/tests/CWL/CWLWorkflow.Tests.fs +++ b/tests/CWL/CWLWorkflow.Tests.fs @@ -7,17 +7,16 @@ open ARCtrl.CWL.Inputs open ARCtrl.CWL.Outputs open ARCtrl.CWL.Outputs.Workflow open ARCtrl.CWL.Inputs.Workflow -open YAMLicious open TestingUtils let decodeCWLWorkflowDescription = - TestObjects.CWL.Workflow.workflow + TestObjects.CWL.Workflow.workflowFile |> Decode.decodeWorkflow let testCWLWorkflowDescription = - testList "CWLWorkflowDescription" [ + testList "Decode" [ testCase "Class" <| fun _ -> - let expected = Class.Workflow + let expected = CWLClass.Workflow let actual = decodeCWLWorkflowDescription.Class Expect.equal actual expected $"Expected: {expected}\nActual: {actual}" @@ -130,4 +129,9 @@ let testCWLWorkflowDescription = Expect.equal a.OutputBinding e.OutputBinding $"Expected: {e}\nActual: {a}" ) actual expected + ] + +let main = + testList "CWLWorkflowDescription" [ + testCWLWorkflowDescription ] \ No newline at end of file diff --git a/tests/CWL/Inputs.Tests.fs b/tests/CWL/Inputs.Tests.fs index 92afcc37..285265c6 100644 --- a/tests/CWL/Inputs.Tests.fs +++ b/tests/CWL/Inputs.Tests.fs @@ -7,13 +7,13 @@ open YAMLicious open TestingUtils let decodeInput = - TestObjects.CWL.Inputs.inputs + TestObjects.CWL.Inputs.inputsFileContent |> Decode.read |> Decode.inputsDecoder |>fun i ->i.Value let testInput = - testList "inputs with Directory, File and string" [ + testList "Decode" [ testCase "Length" <| fun _ -> Expect.isTrue (3 = decodeInput.Length) "Length of inputs is not 3" testList "Directory" [ let directoryItem = decodeInput.[0] @@ -42,4 +42,9 @@ let testInput = (expected = actual) $"Expected: {expected}\nActual: {actual}" ] + ] + +let main = + testList "Input" [ + testInput ] \ No newline at end of file diff --git a/tests/CWL/Main.fs b/tests/CWL/Main.fs index 7083fc19..c08a8276 100644 --- a/tests/CWL/Main.fs +++ b/tests/CWL/Main.fs @@ -3,14 +3,13 @@ module ARCtrl.CWL.Tests open Fable.Pyxpecto let all = testSequenced <| testList "CWL" [ - Tests.CWLWorkflow.testCWLWorkflowDescription - Tests.CWLObject.testCWLToolDescription - Tests.CWLObjectMetadata.testCWLToolDescriptionMetadata - Tests.Metadata.testMetadata - Tests.Outputs.testOutput - Tests.Inputs.testInput - Tests.Requirements.testRequirement - Tests.WorkflowSteps.testWorkflowStep + Tests.CWLWorkflow.main + Tests.CWLObject.main + Tests.Metadata.main + Tests.Outputs.main + Tests.Inputs.main + Tests.Requirements.main + Tests.WorkflowSteps.main ] #if !TESTS_ALL diff --git a/tests/CWL/Metadata.Tests.fs b/tests/CWL/Metadata.Tests.fs index 602376bd..1c5faf2b 100644 --- a/tests/CWL/Metadata.Tests.fs +++ b/tests/CWL/Metadata.Tests.fs @@ -1,17 +1,12 @@ module Tests.Metadata -open ARCtrl.CWL -open ARCtrl.CWL.CWLTypes -open ARCtrl.CWL.Requirements -open ARCtrl.CWL.Inputs -open ARCtrl.CWL.Outputs open ARCtrl.CWL.Decode open DynamicObj open YAMLicious open TestingUtils let decodeMetadata = - TestObjects.CWL.Metadata.metadata + TestObjects.CWL.Metadata.metadataFileContent |> Decode.read let overflowDictionary = @@ -22,7 +17,7 @@ let dynObj = overflowDecoder (new DynamicObj()) overflowDictionary let testMetadata = - testList "CWL Metadata" [ + testList "Decode" [ testCase "Overflow Dictionary Keys" <| fun _ -> let expected = ["arc:has technology type"; "arc:technology platform"; "arc:performer"; "arc:has process sequence"] let actual = overflowDictionary.Keys |> List.ofSeq @@ -38,4 +33,10 @@ let testMetadata = let actualValue = dynObj |> DynObj.tryGetTypedPropertyValue "arc:technology platform" Expect.equal actualValue.Value expectedValue $"Expected: {expectedValue}\nActual: {actualValue}" + ] + + +let main = + testList "DynamicObj Metadata" [ + testMetadata ] \ No newline at end of file diff --git a/tests/CWL/Outputs.Tests.fs b/tests/CWL/Outputs.Tests.fs index be3d161a..499a23d6 100644 --- a/tests/CWL/Outputs.Tests.fs +++ b/tests/CWL/Outputs.Tests.fs @@ -7,12 +7,12 @@ open YAMLicious open TestingUtils let decodeOutput = - TestObjects.CWL.Outputs.outputs + TestObjects.CWL.Outputs.outputsFileContent |> Decode.read |> Decode.outputsDecoder let testOutput = - testList "outputs with basetypes and array" [ + testList "Decode" [ testCase "Length" <| fun _ -> let expected = 5 let actual = decodeOutput.Length @@ -124,4 +124,9 @@ let testOutput = (expected = actual) $"Expected: {expected}\nActual: {actual}" ] + ] + +let main = + testList "Output" [ + testOutput ] \ No newline at end of file diff --git a/tests/CWL/Requirements.Tests.fs b/tests/CWL/Requirements.Tests.fs index f2ec2731..e94d8868 100644 --- a/tests/CWL/Requirements.Tests.fs +++ b/tests/CWL/Requirements.Tests.fs @@ -7,13 +7,13 @@ open YAMLicious open TestingUtils let decodeRequirement = - TestObjects.CWL.Requirements.requirements + TestObjects.CWL.Requirements.requirementsFileContent |> Decode.read |> Decode.requirementsDecoder |> fun r -> r.Value let testRequirement = - testList "requirements with DockerRequirement, InitialWorkDirRequirement, EnvVarRequirement and NetworkAccess" [ + testList "Decode" [ testCase "Length" <| fun _ -> Expect.isTrue (5 = decodeRequirement.Length) "Length of requirements is not 5" testList "DockerRequirement" [ let dockerItem = decodeRequirement.[0] @@ -60,4 +60,9 @@ let testRequirement = (expected = actual) $"Expected: {expected}\nActual: {actual}" ] + ] + +let main = + testList "Requirement" [ + testRequirement ] \ No newline at end of file diff --git a/tests/CWL/WorkflowSteps.Tests.fs b/tests/CWL/WorkflowSteps.Tests.fs index 94bbc4b0..8948add5 100644 --- a/tests/CWL/WorkflowSteps.Tests.fs +++ b/tests/CWL/WorkflowSteps.Tests.fs @@ -9,12 +9,12 @@ open YAMLicious open TestingUtils let decodeWorkflowStep = - TestObjects.CWL.WorkflowSteps.workflowSteps + TestObjects.CWL.WorkflowSteps.workflowStepsFileContent |> Decode.read |> Decode.stepsDecoder let testWorkflowStep = - testList "Decode WorkflowStep" [ + testList "Decode" [ testCase "Length" <| fun _ -> Expect.isTrue (2 = decodeWorkflowStep.Length) "Length of WorkflowSteps is not 2" testList "IDs" [ testCase "MzMLToMzlite" <| fun _ -> @@ -79,4 +79,9 @@ let testWorkflowStep = (expected = actual) $"Expected: {expected}\nActual: {actual}" ] + ] + +let main = + testList "WorkflowStep" [ + testWorkflowStep ] \ No newline at end of file diff --git a/tests/TestingUtils/TestObjects.CWL/CommandLineTool.fs b/tests/TestingUtils/TestObjects.CWL/CommandLineTool.fs index ac2b6d0f..9593a0bc 100644 --- a/tests/TestingUtils/TestObjects.CWL/CommandLineTool.fs +++ b/tests/TestingUtils/TestObjects.CWL/CommandLineTool.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.CommandLineTool -let cwl ="""cwlVersion: v1.2 +let cwlFile ="""cwlVersion: v1.2 class: CommandLineTool hints: - class: DockerRequirement diff --git a/tests/TestingUtils/TestObjects.CWL/CommandLineToolMetadata.fs b/tests/TestingUtils/TestObjects.CWL/CommandLineToolMetadata.fs index ce1e581c..5e0ba034 100644 --- a/tests/TestingUtils/TestObjects.CWL/CommandLineToolMetadata.fs +++ b/tests/TestingUtils/TestObjects.CWL/CommandLineToolMetadata.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.CommandLineToolMetadata -let cwl ="""cwlVersion: v1.2 +let cwlFile ="""cwlVersion: v1.2 class: CommandLineTool hints: - class: DockerRequirement diff --git a/tests/TestingUtils/TestObjects.CWL/Inputs.fs b/tests/TestingUtils/TestObjects.CWL/Inputs.fs index 907617af..34024a3f 100644 --- a/tests/TestingUtils/TestObjects.CWL/Inputs.fs +++ b/tests/TestingUtils/TestObjects.CWL/Inputs.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.Inputs -let inputs ="""inputs: +let inputsFileContent ="""inputs: arcDirectory: Directory firstArg: type: File diff --git a/tests/TestingUtils/TestObjects.CWL/Metadata.fs b/tests/TestingUtils/TestObjects.CWL/Metadata.fs index 733084f2..6b0827ef 100644 --- a/tests/TestingUtils/TestObjects.CWL/Metadata.fs +++ b/tests/TestingUtils/TestObjects.CWL/Metadata.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.Metadata -let metadata ="""arc:has technology type: +let metadataFileContent ="""arc:has technology type: - class: arc:technology type arc:annotation value: "Fsharp Devcontainer" diff --git a/tests/TestingUtils/TestObjects.CWL/Outputs.fs b/tests/TestingUtils/TestObjects.CWL/Outputs.fs index 8f7f1ad3..93311e79 100644 --- a/tests/TestingUtils/TestObjects.CWL/Outputs.fs +++ b/tests/TestingUtils/TestObjects.CWL/Outputs.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.Outputs -let outputs ="""outputs: +let outputsFileContent ="""outputs: output: type: File outputBinding: diff --git a/tests/TestingUtils/TestObjects.CWL/Requirements.fs b/tests/TestingUtils/TestObjects.CWL/Requirements.fs index a909ada4..3191e8b8 100644 --- a/tests/TestingUtils/TestObjects.CWL/Requirements.fs +++ b/tests/TestingUtils/TestObjects.CWL/Requirements.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.Requirements -let requirements ="""requirements: +let requirementsFileContent ="""requirements: - class: DockerRequirement dockerImageId: "devcontainer" dockerFile: {$include: "FSharpArcCapsule/Dockerfile"} diff --git a/tests/TestingUtils/TestObjects.CWL/Workflow.fs b/tests/TestingUtils/TestObjects.CWL/Workflow.fs index 4845c65a..e082d3bd 100644 --- a/tests/TestingUtils/TestObjects.CWL/Workflow.fs +++ b/tests/TestingUtils/TestObjects.CWL/Workflow.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.Workflow -let workflow ="""cwlVersion: v1.2 +let workflowFile ="""cwlVersion: v1.2 class: Workflow requirements: diff --git a/tests/TestingUtils/TestObjects.CWL/WorkflowSteps.fs b/tests/TestingUtils/TestObjects.CWL/WorkflowSteps.fs index 32d2f492..f9a8d6c7 100644 --- a/tests/TestingUtils/TestObjects.CWL/WorkflowSteps.fs +++ b/tests/TestingUtils/TestObjects.CWL/WorkflowSteps.fs @@ -1,6 +1,6 @@ module TestObjects.CWL.WorkflowSteps -let workflowSteps ="""steps: +let workflowStepsFileContent ="""steps: MzMLToMzlite: run: ./runs/MzMLToMzlite/proteomiqon-mzmltomzlite.cwl in: