Skip to content

Commit 058aa6e

Browse files
- Pipeline Tester moved to 'yml' service descriptors (#40)
1 parent d80c7e2 commit 058aa6e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/groovy/PipelineTester.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env groovy
22

33
/**
4-
* Copyright (c) 2018 Informatics Matters Ltd.
4+
* Copyright (c) 2019 Informatics Matters Ltd.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import org.apache.commons.cli.Option
3333

3434
// Version
3535
// Update with every change/release
36-
String version = '2.6.5'
36+
String version = '2.7.0'
3737

3838
println "+------------------+"
3939
println "| PipelineTester | v$version"

src/groovy/Tester.groovy

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env groovy
22

33
/**
4-
* Copyright (c) 2018 Informatics Matters Ltd.
4+
* Copyright (c) 2019 Informatics Matters Ltd.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -16,12 +16,17 @@
1616
* limitations under the License.
1717
*/
1818

19+
// Groovy 3.0.0 (to be released) contains a groovy.yaml.YamlSlurper.
20+
// Until that's available we're forced to use something else...
21+
@Grab('org.yaml:snakeyaml:1.24')
22+
1923
import java.nio.file.Files
2024
import java.util.regex.Pattern
2125

22-
import groovy.json.JsonSlurper
2326
import groovy.text.SimpleTemplateEngine
2427

28+
import org.yaml.snakeyaml.Yaml
29+
2530
/**
2631
* The Tester. A groovy class for the automated testing
2732
* of Informatics Matters pipeline scripts. This class searches for
@@ -48,7 +53,7 @@ class Tester {
4853
String executeAnchorDir = File.separator + 'src' + File.separator
4954
String testFileSpec = '**' + File.separator + "*${testExt}"
5055
String testSearchDir = '..'+ File.separator + '..' + File.separator + '..'
51-
String sdExt = '.dsd.json'
56+
String sdExt = '.dsd.yml'
5257
String optionPrefix = 'arg.'
5358
String metricsFile = 'output_metrics.txt'
5459
String dumpOutPrefix = ' #'
@@ -191,7 +196,8 @@ class Tester {
191196
currentServiceDescriptor = null
192197
File sdFilenameFile = new File(sdFilename)
193198
if (sdFilenameFile.exists()) {
194-
currentServiceDescriptor = new JsonSlurper().parse(sdFilenameFile.toURI().toURL())
199+
Yaml yaml = new Yaml()
200+
currentServiceDescriptor = yaml.load(new FileInputStream(sdFilenameFile))
195201
extractOptionsFromCurrentServiceDescriptor()
196202
}
197203

0 commit comments

Comments
 (0)