@@ -87,7 +87,7 @@ class Tester {
87
87
/**
88
88
* The run method.
89
89
* Locates all the test files, loads them and executes them.
90
- * This is the main/public entrypoint for the class.
90
+ * This is the main/public entry-point for the class.
91
91
*
92
92
* @return boolean, false if any test has failed.
93
93
*/
@@ -203,7 +203,8 @@ class Tester {
203
203
}
204
204
205
205
/**
206
- * cleanup the generated output.
206
+ * Cleanup the generated output.
207
+ *
207
208
* Pipelines that create files have their files placed in the project's
208
209
* `tmp` directory. This method, called at the start of testing and when
209
210
* all tests have passed successfully, removed the collected files.
@@ -317,9 +318,10 @@ class Tester {
317
318
if (option. defaultValue != null ) {
318
319
if (option. defaultValue in java.util.List ) {
319
320
// Assume something like '[java.lang.Float, 0.7]'
320
- // So the defau;t 's the 2nd entry?
321
+ // So the default 's the 2nd entry?
321
322
optionDefaults[arglessOption] = option. defaultValue[1 ]
322
323
} else {
324
+ // Just a string?
323
325
optionDefaults[arglessOption] = option. defaultValue
324
326
}
325
327
}
@@ -440,7 +442,7 @@ class Tester {
440
442
441
443
info(' Processing setup_collection section' )
442
444
443
- // Extract key setup values, suppling defaults
445
+ // Extract key setup values, supplying defaults
444
446
int timeoutSeconds = setupSection. value. get(' timeout' )
445
447
if (timeoutSeconds != null ) {
446
448
info(" Setup timeout=$timeoutSeconds " )
@@ -517,7 +519,7 @@ class Tester {
517
519
// Unless a test-specific command has been defined
518
520
// check the parameters against the service descriptor
519
521
// to ensure that all the options are recognised.
520
- String the_command = null
522
+ String pipelineCommand
521
523
if (command == null ) {
522
524
523
525
if (! checkAllOptionsHaveBeenUsed(params_block)) {
@@ -526,7 +528,12 @@ class Tester {
526
528
}
527
529
// No raw command defined in the test block,
528
530
// so use the command defined in the service descriptor...
529
- the_command = currentServiceDescriptor. command
531
+ String the_command = currentServiceDescriptor. command
532
+
533
+ // Replace the respective values in the command string...
534
+ pipelineCommand = expandTemplate(the_command, params_block)
535
+ // Replace newlines with '\n'
536
+ pipelineCommand = pipelineCommand. replace(System . lineSeparator(), ' \n ' )
530
537
531
538
} else {
532
539
// The user-supplied command might be a multi-line string.
@@ -535,18 +542,13 @@ class Tester {
535
542
command. eachLine {
536
543
the_command + = it. trim() + ' '
537
544
}
538
- the_command = the_command. trim()
545
+ pipelineCommand = the_command. trim()
539
546
}
540
547
541
- // Here ... `the_command ` is either the SD-defined command or the
548
+ // Here ... `pipelineCommand ` is either the SD-defined command or the
542
549
// command defined in this test's command block.
543
550
544
- // replace the respective values in the command string...
545
- String pipelineCommand = expandTemplate(the_command, params_block)
546
- // Replace newlines with '\n'
547
- pipelineCommand = pipelineCommand. replace(System . lineSeparator(), ' \n ' )
548
-
549
- // Redirect the '-o' option, if defined
551
+ // Redirect the '-o' option, if there is a '-o' in the command
550
552
def oOption = pipelineCommand =~ / $outputRegex/
551
553
File testOutputFile = null
552
554
if (oOption. count > 0 ) {
@@ -596,9 +598,9 @@ class Tester {
596
598
597
599
// If command execution was successful (exit value of 0)
598
600
// then:
599
- // - check that th eoutput file was created (if expected)
601
+ // - check that the output file was created (if expected)
600
602
// - iterate through any optional _see_ values,
601
- // checking that the piupeline log contains the defined text.
603
+ // checking that the pipeline log contains the defined text.
602
604
boolean validated = true
603
605
if (exitValue == 0 ) {
604
606
0 commit comments