fairagro / M4.4_UC6_ARC

UC6 workflow in ARC proof-of-concept
0 stars 0 forks source link

Validate the ARC, does it fail? Why? Our Fault? #34

Closed JensKrumsieck closed 2 months ago

JensKrumsieck commented 2 months ago

ARC validation fails with

[07:35:44 ERR] Critical.Arc contains workflow in workflow directory failed in 00:00:00.0160000. 

Image

which is according to these lines in the 2.0.0-draft specification, which contains to predicates https://github.com/nfdi4plants/arc-validate/blob/9964380cf4c8b6420b325d9fc3cd5d364b8e96e7/src/ARCExpect/SpecificationValidation/V2_0_0_Draft.fs#L363C15-L404C18

                // Check if each workflow directory features a cwl file
                ARCExpect.validationCase (TestID.Name "Arc contains workflow in workflow directory") {
                    let workflowDir = 
                        absoluteDirectoryPaths 
                        |> Seq.filter(fun x -> x.Name = StructuralOntology.AFSO.``Workflow Directory``.Name)
                        |>Seq.map(fun x -> x.Value|>ParamValue.getValue|>string)

                    let cwls = 
                        absoluteDirectoryPaths 
                        |> Seq.filter(fun x -> 
                            x.Name = StructuralOntology.AFSO.``CWL File``.Name && 
                            x.Value
                            |>ParamValue.getValue
                            |>string
                            |>fun (x: string) -> x.Split [|'/'|]
                            |>fun x -> 
                                match x with 
                                | [|"workflows";_;_|] -> true
                                | _ -> false
                        )

                    cwls
                    |> Validate.ParamCollection.SatisfiesPredicate (fun x -> (Seq.length x) = (workflowDir|>Seq.length)) 

                    cwls
                    |> Validate.ParamCollection.SatisfiesPredicate(fun x -> 
                        x
                        |> Seq.forall (fun y -> 
                            workflowDir
                            |> Seq.contains (
                                y.Value
                                |>ParamValue.getValue
                                |>string
                                |>fun x -> 
                                    x.Split('/')
                                    |> Array.rev
                                    |>Array.tail
                                    |>Array.rev
                                    |>String.concat"/"
                                ) 
                            ) 
                    ) 
                }

I have limited knowledge in F#, but what i think it does is:

First the check whether the count of cwl files matches the number directories in workflows

 cwls
 |> Validate.ParamCollection.SatisfiesPredicate (fun x -> (Seq.length x) = (workflowDir|>Seq.length)) 

and then does this: Checking if the path without the actual filename is contained in workflow dir

 cwls
                    |> Validate.ParamCollection.SatisfiesPredicate(fun x -> 
                        x
                        |> Seq.forall (fun y -> 
                            workflowDir
                            |> Seq.contains (
                                y.Value
                                |>ParamValue.getValue
                                |>string
                                |>fun x -> 
                                    x.Split('/')
                                    |> Array.rev
                                    |>Array.tail
                                    |>Array.rev
                                    |>String.concat"/"
                                ) 
                            ) 
                    ) 
JensKrumsieck commented 2 months ago

I think they want either all files in workflows root or a separate, folder for each cwl file Both seems to pass the validation