@@ -114,6 +114,7 @@ class Tester {
114
114
sectionNumber = 0
115
115
testScriptVersion = 0
116
116
testTimeoutSeconds = 30
117
+ collectionCreates = []
117
118
118
119
// We must not have duplicate test files -
119
120
// this indicates there are pipelines in different projects
@@ -127,10 +128,17 @@ class Tester {
127
128
observedFiles. add(currentTestFilename)
128
129
129
130
// Guess the Service Descriptor path and filename
130
- // and try to extract the command and the supported options...
131
+ // and try to extract the command and the supported options.
132
+ // The SD file must exist if the user has defined a set of
133
+ // parameters. The SD file is not required if the test
134
+ // contains just raw commands.
131
135
String sdFilename = path. take(path. length() - testExt. length()) + sdExt
132
- currentServiceDescriptor = new JsonSlurper (). parse(new File (sdFilename). toURI(). toURL())
133
- extractOptionsFromCurrentServiceDescriptor()
136
+ currentServiceDescriptor = null
137
+ File sdFilenameFile = new File (sdFilename)
138
+ if (sdFilenameFile. exists()) {
139
+ currentServiceDescriptor = new JsonSlurper (). parse(sdFilenameFile. toURI(). toURL())
140
+ extractOptionsFromCurrentServiceDescriptor()
141
+ }
134
142
135
143
// Now run each test found in the test spec
136
144
// (also checking for `setup_collection` and `version` sections).
@@ -477,7 +485,6 @@ class Tester {
477
485
}
478
486
479
487
// Globally-defined created files?
480
- collectionCreates = []
481
488
if (setupSection. value. creates != null ) {
482
489
collectionCreates = setupSection. value. get(' creates' )
483
490
}
@@ -565,10 +572,15 @@ class Tester {
565
572
String pipelineCommand
566
573
if (command == null ) {
567
574
568
- if (! checkAllOptionsHaveBeenUsed(paramsBlock)) {
575
+ if (currentServiceDescriptor == null ) {
576
+ err(' Found "params" but there was no service descriptor file.' )
577
+ recordFailedTest(section. key)
578
+ return
579
+ } else if (! checkAllOptionsHaveBeenUsed(paramsBlock)) {
569
580
recordFailedTest(section. key)
570
581
return
571
582
}
583
+
572
584
// No raw command defined in the test block,
573
585
// so use the command defined in the service descriptor...
574
586
String the_command = currentServiceDescriptor. command
0 commit comments