Skip to content

Commit

Permalink
Adapt parsing of execution report to new regex (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffengreiner authored Aug 29, 2022
1 parent 616f730 commit 0f13b01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
16 changes: 6 additions & 10 deletions src/main/groovy/life/qbic/utils/BioinformaticAnalysisParser.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,12 @@ class BioinformaticAnalysisParser implements DatasetParser<NfCorePipelineResult>
private static void parsePipelineInformation(Map pipelineInformation) {

pipelineInformation.get("children").each { Map child ->
switch (child.get("name")) {
case "software_versions.yml":
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.SOFTWARE_VERSIONS.getKeyName())
break
case "execution_report.html":
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.EXECUTION_REPORT.getKeyName())
break
default:
//ignoring other children
break
String filename = child.get("name")
if(filename.equals("software_versions.yml")){
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.SOFTWARE_VERSIONS.getKeyName())
}
else if(filename.matches("^execution_report.*")) {
insertAsProperty(pipelineInformation, child, RequiredPipelineFileKeys.EXECUTION_REPORT.getKeyName())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class BioinformaticAnalysisSpec extends Specification {
assert softwareVersions.getName() == "software_versions.yml"

ExecutionReport executionReport = pipelineInfo.getExecutionReport()
assert executionReport.getRelativePath() == "./pipeline_info/execution_report.html"
assert executionReport.getName() == "execution_report.html"
assert executionReport.getRelativePath() == "./pipeline_info/execution_report_1234-56-78_90-12-34.html"
assert executionReport.getName() == "execution_report_1234-56-78_90-12-34.html"


}
Expand Down Expand Up @@ -104,7 +104,7 @@ class BioinformaticAnalysisSpec extends Specification {

def "parsing a file throws a DataParserException"() {
given:
def pathToDirectory = Paths.get(exampleDirectoriesRoot, "validates/pipeline_info/execution_report.html")
def pathToDirectory = Paths.get(exampleDirectoriesRoot, "validates/pipeline_info/execution_report_1234-56-78_90-12-34.html")
when:
bioinformaticAnalysisParser.parseFrom(pathToDirectory)
then:
Expand Down

0 comments on commit 0f13b01

Please sign in to comment.