@@ -84,10 +84,6 @@ class Tester {
84
84
// i.e. 'arg.volumes' becomes 'volumes' (also contains expanded ranges)
85
85
List<String > optionNames = []
86
86
def optionDefaults = [:]
87
- // A list of created and uncreated files
88
- // (set if the user's used the corresponding blocks in the test)
89
- List<String > creates = []
90
- List<String > doesNotCreate = []
91
87
92
88
/**
93
89
* The run method.
@@ -112,8 +108,6 @@ class Tester {
112
108
take(currentTestFilename. length() - testExt. length())
113
109
sectionNumber = 0
114
110
testScriptVersion = 0
115
- creates = []
116
- doesNotCreate []
117
111
118
112
// We must not have duplicate test files -
119
113
// this indicates there are pipelines in different projects
@@ -272,7 +266,7 @@ class Tester {
272
266
*/
273
267
private separate () {
274
268
275
- println " -------"
269
+ println " -------"
276
270
277
271
}
278
272
@@ -632,7 +626,7 @@ class Tester {
632
626
633
627
// If command execution was successful (exit value of 0)
634
628
// then:
635
- // - check that an output file was created (if expected)
629
+ // - check that any declared _creates_ output files were created
636
630
// - iterate through any optional _see_ values,
637
631
// checking that the pipeline log contains the defined text.
638
632
boolean validated = true
@@ -642,20 +636,18 @@ class Tester {
642
636
// Here we look for things like "output*" in the
643
637
// redirected output path.
644
638
if (testOutputPath != null && createsBlock != null ) {
645
- def outputFiles = new FileNameFinder ().
639
+ def createdFiles = new FileNameFinder ().
646
640
getFileNames(testOutputPath. toString(), " *" )
647
- for (String create in creates) {
648
- println " +++++ " + create
641
+ for (String expectedFile in createsBlock) {
649
642
boolean found = false
650
- for (String outputFile in outputFiles) {
651
- println " >>>>> " + outputFile
652
- if (outputFile. endsWith(create)) {
643
+ for (String createdFile in createdFiles) {
644
+ if (createdFile. endsWith(expectedFile)) {
653
645
found = true
654
646
break
655
647
}
656
648
}
657
649
if (! found) {
658
- err(" Expected output file '$c reste ' but couldn't find it" )
650
+ err(" Expected output file '$e xpectedFile ' but couldn't find it" )
659
651
validated = false
660
652
break
661
653
}
0 commit comments