nfdi4plants / arc-validate

Home of all the tools and libraries to create and run validation of ARCs
https://nfdi4plants.github.io/arc-validate/
MIT License
3 stars 2 forks source link

No validation result XML file is generated if the isa.*.xlsx is missing #63

Open j-bauer opened 8 months ago

j-bauer commented 8 months ago

While testing corner cases of the ARC validation pipeline following error occured. The test was done with a repository containing only a README.md (to test what happens if people create empty repos before pushing an ARC into it). This shows the output of both the arc-validate tool as well as the create-badge.py script:

+ arc-validate
Internal Error:                         
The option value was None (Parameter 'option')
"   at Microsoft.FSharp.Core.OptionModule.GetValue[T](FSharpOption`1 option) in D:\a\_work\1\s\src\FSharp.Core\option.fs:line 13
   at ArcValidation.CvTokenHelperFunctions.CvContainer.isPartOfInvestigation@79-2.Invoke(ICvBase x)
   at Microsoft.FSharp.Collections.SeqModule.Exists[T](FSharpFunc`2 predicate, IEnumerable`1 source) in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 641
   at Microsoft.FSharp.Collections.SeqModule.Exists[T](FSharpFunc`2 predicate, IEnumerable`1 source) in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 641
   at ArcValidation.InformationExtraction.Investigation.getContactsContainer@60.Invoke(CvContainer cv) in /opt/arc-validate/src/ArcValidation/InformationExtraction.fs:line 60
   at Microsoft.FSharp.Collections.Internal.IEnumerator.next@246[T](FSharpFunc`2 f, IEnumerator`1 e, FSharpRef`1 started, Unit unitVar0) in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 248
   at Microsoft.FSharp.Collections.Internal.IEnumerator.filter@236.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 250
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source) in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 966
   at ArcValidation.TestGeneration.Critical.Arc.ISA.generateISATests(ArcConfig arcConfig) in /opt/arc-validate/src/ArcValidation/TestGeneration/Critical/ArcISA.fs:line 22
   at ARCValidate.main(String[] argv) in /opt/arc-validate/src/arc-validate/Program.fs:line 29"
$ /opt/arc-validate/create-badge.py
Traceback (most recent call last):
  File "/opt/arc-validate/create-badge.py", line 9, in <module>
    xml = JUnitXml.fromfile(xml_path)
  File "/usr/local/lib/python3.9/dist-packages/junitparser/junitparser.py", line 751, in fromfile
    tree = etree.parse(filepath)  # nosec
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 569, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: './arc-validate-results.xml'
$ exit 0
Uploading artifacts for successful job 00:00
Uploading artifacts...
WARNING: arc-validate-results.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/doniparthi1/Facultative-CAM-in-Talinum) 
WARNING: arc-quality.svg: no matching files. Ensure that the artifact path is relative to the working directory (/builds/doniparthi1/Facultative-CAM-in-Talinum) 
ERROR: No files to upload

Sounds like just an uncaught expection? The tool should always generate the arc-validate-results.xml in order for the create-badge.py script to be able to create a 0/x badge.

kMutagene commented 6 months ago

I hope this is caught by https://github.com/nfdi4plants/arc-validate/commit/c03db33921040a09f803154df557c9f3bbd20870 for now, if this still occurs when we migrated to v2, we have to investigate this further.