@@ -74,6 +74,7 @@ class Tester {
74
74
int testsExecuted = 0
75
75
int testsIgnored = 0
76
76
def failedTests = []
77
+ def observedFiles = []
77
78
78
79
// The service descriptor for the current test file...
79
80
def currentServiceDescriptor = null
@@ -98,7 +99,7 @@ class Tester {
98
99
99
100
// Find all the potential test files
100
101
def testFiles = new FileNameFinder (). getFileNames(testSearchDir, testFileSpec)
101
- testFiles . each { path ->
102
+ for ( String path : testFiles) {
102
103
103
104
// Reset filename and section number
104
105
currentTestFilename = path. split(File . separator)[-1 ]
@@ -107,6 +108,17 @@ class Tester {
107
108
sectionNumber = 0
108
109
testScriptVersion = 0
109
110
111
+ // We must not have duplicate test files -
112
+ // this indicates there are pipelines in different projects
113
+ // that will clash if combined.
114
+ if (observedFiles. contains(currentTestFilename)) {
115
+ err(" Duplicate pipline ($currentTestFilename )" )
116
+ recordFailedTest(" -" )
117
+ separate()
118
+ continue
119
+ }
120
+ observedFiles. add(currentTestFilename)
121
+
110
122
// Guess the Service Descriptor path and filename
111
123
// and try to extract the command and the supported options...
112
124
String sdFilename = path. take(path. length() - testExt. length()) + sdExt
@@ -122,19 +134,22 @@ class Tester {
122
134
if (section_key_lower. equals(' version' )) {
123
135
124
136
if (! checkFileVersion(section. value)) {
137
+ separate()
125
138
err(" Unsupported test script version ($section . value )." +
126
139
" Expected value from choice of $supportedTestFileVersions " )
140
+ err(" In $path " )
127
141
recordFailedTest(" -" )
128
- return false
142
+ break
129
143
}
130
144
131
145
} else {
132
146
133
147
// Must have a version number if we get here...
134
148
if (testScriptVersion == 0 ) {
149
+ separate()
135
150
err(' The file is missing its version definition' )
136
151
recordFailedTest(" -" )
137
- return false
152
+ break
138
153
}
139
154
140
155
// Section is either a `setup_collect` or `test`...
@@ -144,8 +159,10 @@ class Tester {
144
159
} else if (section_key_lower. startsWith(testPrefix)) {
145
160
processTest(path, section)
146
161
} else if (section_key_lower. startsWith(ignorePrefix)) {
162
+ separate()
147
163
logTest(path, section)
148
164
testsIgnored + = 1
165
+ info(' OK (Ignored)' )
149
166
}
150
167
151
168
}
@@ -440,6 +457,7 @@ class Tester {
440
457
*/
441
458
def processSetupCollection (setupSection ) {
442
459
460
+ separate()
443
461
info(' Processing setup_collection section' )
444
462
445
463
// Extract key setup values, supplying defaults
@@ -470,8 +488,6 @@ class Tester {
470
488
*/
471
489
private logTest (path , section ) {
472
490
473
- separate()
474
-
475
491
info(" Test: $section . key " )
476
492
info(" File: $currentTestFilename " )
477
493
info(" Path: $path " )
@@ -504,6 +520,7 @@ class Tester {
504
520
505
521
testsExecuted + = 1
506
522
523
+ separate()
507
524
logTest(filename, section)
508
525
509
526
def command = section. value[' command' ]
@@ -609,8 +626,6 @@ class Tester {
609
626
if (! testOutputFile. exists()) {
610
627
err(" Expected output file '$testOutputFile ' but it wasn't there" )
611
628
validated = false
612
- } else {
613
- info(" Got '$testOutputFile '" )
614
629
}
615
630
}
616
631
@@ -630,8 +645,6 @@ class Tester {
630
645
if (finder. count == 0 ) {
631
646
err(" Expected to see '$see ' but it was not in the command's output" )
632
647
validated = false
633
- } else {
634
- info(" Saw '$see '" )
635
648
}
636
649
}
637
650
}
0 commit comments