-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathbuild.gradle
More file actions
executable file
·665 lines (543 loc) · 24.8 KB
/
Copy pathbuild.gradle
File metadata and controls
executable file
·665 lines (543 loc) · 24.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
plugins {
// id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.gradleup.shadow' version '8.3.0'
}
apply plugin: 'eclipse'
apply plugin: 'groovy'
project.ext {
VERSION="0.9.14"
STAGE="build/stage/bpipe-$VERSION"
}
sourceSets {
main {
groovy {
srcDirs = ['src']
}
}
test {
groovy {
srcDirs = ['test-src']
}
}
}
/*
configurations {
compile
cloudJar
}
*/
repositories {
flatDir(dirs: file('local-lib'))
mavenCentral()
// Unfortunately it seems GridGain have disabled their maven repository
// Therefore users need to now manually download the GridGain jar file
// maven { url "http://www.gridgainsystems.com/maven2" }
}
dependencies {
println "*" * 100
println "* " + "Building for Groovy $GROOVY_VERSION".center(96) + "* "
println "*" * 100
if(GROOVY_VERSION.startsWith('2.4')) {
// Grab the groovy-all jar which contains everything
implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.8'
// Override with json from 2.5.6 because we want new features from the json
// module to allow json customisation
implementation files(fileTree(dir:'groovy-lib', includes:['groovy-json-2.5.13.jar']))
}
else {
implementation group: 'org.codehaus.groovy', name: 'groovy', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-dateutil', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-cli-commons', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-datetime', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-json', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-sql', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-templates', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-xml', version: GROOVY_VERSION
implementation group: 'org.codehaus.groovy', name: 'groovy-groovysh', version: GROOVY_VERSION
}
implementation files(fileTree(dir:'local-lib', includes:['*.jar']))
implementation 'org.codehaus.gpars:gpars:1.2.1'
// ivy allows Grape to be used inside Bpipe pipelines
implementation group: 'org.apache.ivy', name: 'ivy', version: '2.4.0'
// In case GridGain ever revive their Maven repo ...
// implementation ('org.gridgain:gridgain:4.0.2c') { transitive = false }
implementation ('javax.mail:mail:1.4.5')
// Batik
implementation 'org.apache.xmlgraphics:batik-util:1.7@jar'
implementation 'org.apache.xmlgraphics:batik-css:1.7@jar'
implementation 'org.apache.xmlgraphics:batik-dom:1.7'
implementation 'org.apache.xmlgraphics:batik-svg-dom:1.7@jar'
implementation 'org.apache.xmlgraphics:batik-svggen:1.7@jar'
implementation 'org.apache.xmlgraphics:batik-awt-util:1.7@jar'
implementation group: 'org.fusesource.jansi', name: 'jansi', version: '1.16'
implementation group: 'org.apache.activemq', name: 'activemq-client', version: '5.14.5'
implementation group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.25.1'
implementation group: 'org.glassfish.jersey.media', name: 'jersey-media-multipart', version: '2.25.1'
implementation group: 'com.fasterxml.jackson.jaxrs', name: 'jackson-jaxrs-json-provider', version: '2.13.1'
implementation(group: 'org.gitlab4j', name: 'gitlab4j-api', version: '4.14.30') { transitive = false }
implementation group: 'org.json', name: 'json', version: '20180813'
implementation group: 'jline', name: 'jline', version: '2.14.6'
implementation ('com.hazelcast:hazelcast-all:2.1.2') { transitive = false }
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.9.3'
implementation group: 'com.google.cloud', name: 'google-cloud-nio', version: '0.62.0-alpha'
implementation group: 'com.amazonaws', name: 'aws-java-sdk-ec2', version: '1.12.25'
implementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.12.25'
implementation 'com.amazonaws:aws-java-sdk-sqs:1.12.25'
implementation 'com.amazonaws:amazon-sqs-java-messaging-lib:1.1.2'
implementation group: 'com.upplication', name: 's3fs', version: '2.2.2'
implementation group: 'org.apache.tika', name: 'tika-core', version: '2.4.1'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation group: 'org.codehaus.groovy', name: 'groovy-test', version: GROOVY_VERSION
}
//compileGroovy {
// classpath = (configurations.compile + configurations.cloudJar)
//}
// Check for presence of GridGain library - if not available, exclude the
// source files that depend on it
if(!new File("local-lib").listFiles().find { it.name =~ /gridgain.*.jar/ }) {
println ""
println "=" * 80
println "No Gridgain library found. Gridgain support disabled in this build.".center(80)
println "=" * 80
println ""
sourceSets { main { groovy {
srcDir 'src'
exclude '**/Gridgain*.groovy'
} } }
}
/*
import com.github.jengelman.gradle.plugins.shadow.transformers.*
@groovy.transform.CompileStatic
@CacheableTransformer
class FixedGroovyExtensionModuleTransformer extends GroovyExtensionModuleTransformer {
private static final String GROOVY_EXTENSION_MODULE_DESCRIPTOR_PATH =
"META-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule"
private final Properties module = new Properties()
@Override
boolean canTransformResource(FileTreeElement element) {
return element.relativePath.pathString == GROOVY_EXTENSION_MODULE_DESCRIPTOR_PATH
}
private handle(String key, String value, Closure mergeValue) {
def existingValue = module.getProperty(key)
if (existingValue) {
mergeValue(existingValue)
} else {
module.setProperty(key, value)
}
}
@Override
boolean hasTransformedResource() {
return module.size() > 0
}
@Override
void modifyOutputStream(shadow.org.apache.tools.zip.ZipOutputStream os, boolean preserveFileTimestamps) {
shadow.org.apache.tools.zip.ZipEntry entry = new shadow.org.apache.tools.zip.ZipEntry(GROOVY_EXTENSION_MODULE_DESCRIPTOR_PATH)
entry.time = TransformerContext.getEntryTimestamp(preserveFileTimestamps, entry.time)
os.putNextEntry(entry)
module.store(os, null)
os.closeEntry()
}
}
*/
shadowJar {
// if(GROOVY_VERSION == "3.0.25") {
mergeGroovyExtensionModules()
// }
// else {
// transform(FixedGroovyExtensionModuleTransformer)
// }
exclude '*slf4j-*'
// entryCompression = ZipEntryCompression.STORED
// minimize {
// dependency('org.codehaus.groovy:.*:.*')
// }
}
/*
jar {
duplicatesStrategy 'include'
def cloudJars = configurations.cloudJar*.name
def coreJars = configurations.compile*.name
def cloudOnly = cloudJars - coreJars
println "The cloud exclusive jars are: \n\n" + configurations.cloudJar.grep { (it.name in cloudOnly) }.join('\n') + "\n"
from configurations.compile.grep {
!(it.name in cloudOnly) &&
!(it.name in ["mail.jar"]) &&
!it.name.startsWith("gridgain") &&
!it.name.startsWith("hazelcast") &&
!it.name.startsWith("xalan-") &&
!it.name.startsWith("xml-apis") &&
!it.name.startsWith("slf4j-jdk14")
}.collect {
// println it
// println "main: " + it.name
it.isDirectory() ? it : zipTree(it)
}
exclude { details ->
// details.relativePath.pathString.startsWith('javax/xml') ||
details.relativePath.pathString.startsWith('org/xml') // ||
// details.relativePath.pathString.startsWith('jersey') // ||
// details.relativePath.pathString.startsWith('org/slf4j')
}
// mergeGroovyExtensionModules()
}
*/
import java.nio.file.Files
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
/**
* Runs Bpipe functional tests from the tests/ directory and writes JUnit XML reports
* to build/test-results/e2eTests/ so Gradle includes them in its HTML test report.
*
* Test selection:
* testPrefixes - include tests whose names start with any listed prefix (empty = all)
* excludePrefixes - exclude tests whose names start with any listed prefix (used for Misc group)
* nameFilter - additional substring filter, set via -Pe2eFilter=<name>
*/
class BpipeE2ETest extends DefaultTask {
@Internal List<String> testPrefixes = []
@Internal List<String> excludePrefixes = []
@Internal String nameFilter = ''
/** Maximum number of tests to run in parallel. Default 1 (sequential).
* Set via -Pe2eParallel=N on the command line. */
@Internal int maxParallel = 1
@TaskAction
void runTests() {
def testsDir = project.file('tests')
def reportsDir = project.file('build/test-results/e2eTests')
reportsDir.mkdirs()
def allDirs = testsDir.listFiles()
.findAll { it.isDirectory() && it.name =~ /^[A-Za-z]/ && new File(it, 'run.sh').exists() }
.sort { it.name }
def testDirs
if (excludePrefixes) {
testDirs = allDirs.findAll { dir -> !excludePrefixes.any { dir.name.startsWith(it) } }
} else if (testPrefixes) {
testDirs = allDirs.findAll { dir -> testPrefixes.any { dir.name.startsWith(it) } }
} else {
testDirs = allDirs
}
if (nameFilter) {
testDirs = testDirs.findAll { it.name.contains(nameFilter) }
}
if (testDirs.isEmpty()) {
logger.warn("No e2e tests found (prefixes=${testPrefixes}, exclude=${excludePrefixes}, filter='${nameFilter}')")
return
}
def effectiveParallel = Math.max(1, maxParallel)
if (effectiveParallel > 1) {
logger.lifecycle("Running ${testDirs.size()} e2e test(s) with up to ${effectiveParallel} in parallel...")
} else {
logger.lifecycle("Running ${testDirs.size()} e2e test(s)...")
}
def results = runTestDirs(testDirs, testsDir, effectiveParallel)
writeJUnitXml(results, reportsDir)
def passed = results.count { it.passed }
def failed = results.count { !it.passed }
logger.lifecycle('\n===== E2E Test Summary =====')
logger.lifecycle(" Passed: ${passed} / ${results.size()}")
if (failed > 0) {
logger.lifecycle(" Failed: ${failed}")
results.findAll { !it.passed }.each { r ->
logger.lifecycle("\n----- FAILED: ${r.name} -----")
logger.lifecycle(r.output ?: '(no output captured)')
logger.lifecycle('-----')
}
throw new GradleException("${failed} e2e test(s) failed")
}
}
private List runTestDirs(List<File> testDirs, File testsDir, int parallelism) {
// Closure that runs a single test — defined here so it's visible inside
// thread-pool closures (Groovy build-script method dispatch doesn't
// resolve private methods through nested closure delegates).
def execTest = { File testDir ->
new File(testDir, '.bpipe').deleteDir()
def startTime = System.currentTimeMillis()
def pb = new ProcessBuilder('bash', 'run.sh')
pb.directory(testDir)
pb.redirectErrorStream(true)
pb.environment().put('BASE', testsDir.absolutePath)
def proc = pb.start()
def output = new StringBuffer()
def readerThread = Thread.start {
proc.inputStream.newReader('UTF-8').eachLine { line -> output.append(line).append('\n') }
}
def finished = proc.waitFor(300, java.util.concurrent.TimeUnit.SECONDS)
if (!finished) {
proc.destroyForcibly()
output.append('\n[TEST TIMED OUT after 300s]')
}
readerThread.join(5000)
def exitCode = finished ? proc.exitValue() : 1
def duration = (System.currentTimeMillis() - startTime) / 1000.0
// On failure, append the bpipe output log (test.out) which contains the
// actual stdout/stderr from the pipeline run — run.sh redirects bpipe's
// output there so it doesn't appear in the process stdout we captured above.
if (exitCode != 0) {
def testOutFile = new File(testDir, 'test.out')
if (testOutFile.exists()) {
output.append('\n[test.out contents]\n')
output.append(testOutFile.text)
}
}
[name: testDir.name, passed: exitCode == 0, output: output.toString(), duration: duration]
}
if (parallelism <= 1) {
// Sequential — original behaviour
def results = []
testDirs.each { testDir ->
def result = execTest(testDir)
results << result
logger.lifecycle(" ${result.passed ? 'PASSED' : 'FAILED'}: ${result.name} (${String.format('%.1f', result.duration as double)}s)")
}
return results
}
// Parallel execution
def pool = java.util.concurrent.Executors.newFixedThreadPool(parallelism)
def futures = testDirs.collect { testDir ->
pool.submit({
execTest(testDir)
} as java.util.concurrent.Callable)
}
def results = []
futures.each { future ->
def result = future.get(600, java.util.concurrent.TimeUnit.SECONDS)
results << result
logger.lifecycle(" ${result.passed ? 'PASSED' : 'FAILED'}: ${result.name} (${String.format('%.1f', result.duration as double)}s)")
}
pool.shutdown()
return results
}
private void writeJUnitXml(List results, File reportsDir) {
def escapeXml = { String s ->
s.replace('&', '&').replace('"', '"').replace('<', '<').replace('>', '>')
}
def total = results.size()
def failures = results.count { !it.passed }
def totalTime = results ? (results.sum { it.duration as double } as double) : 0.0d
def sb = new StringBuilder()
sb << '<?xml version="1.0" encoding="UTF-8"?>\n'
sb << "<testsuite name=\"BpipeE2ETests\" tests=\"${total}\" failures=\"${failures}\" time=\"${String.format('%.3f', totalTime)}\">\n"
results.each { r ->
def eName = escapeXml(r.name as String)
def eTime = String.format('%.3f', r.duration as double)
if (r.passed) {
sb << " <testcase name=\"${eName}\" classname=\"bpipe.e2e\" time=\"${eTime}\"/>\n"
} else {
sb << " <testcase name=\"${eName}\" classname=\"bpipe.e2e\" time=\"${eTime}\">\n"
sb << " <failure message=\"Test ${eName} failed\" type=\"AssertionError\"><![CDATA[${r.output ?: ''}]]></failure>\n"
sb << " </testcase>\n"
}
}
sb << "</testsuite>\n"
new File(reportsDir, 'e2e-results.xml').text = sb.toString()
}
}
//task cloudjar(type:ShadowJar) {
//
// archiveName='bpipe-cloud.jar'
//
// classifier='all'
//
// from configurations.cloudJar.each {
// println it
// }
//
//
// configurations = [project.configurations.cloudJar]
//
// mergeServiceFiles()
//}
/*
* Configure tests to be more friendly for agentic coding: keep noise to a minimum unless there
* is a failure and then output full detail when something fails to stderr/stdout
*/
tasks.withType(Test).configureEach { t ->
// Keep Gradle's own console logging brief
testLogging {
events "failed"
exceptionFormat "full"
showStandardStreams = false
}
// Buffer output per test descriptor
def stdoutByTest = new IdentityHashMap<TestDescriptor, StringBuilder>()
def stderrByTest = new IdentityHashMap<TestDescriptor, StringBuilder>()
onOutput { TestDescriptor descriptor, TestOutputEvent event ->
// We only care about atomic tests (methods / iterations), not suite-level noise
if (descriptor.parent == null) {
return
}
def map = (event.destination == TestOutputEvent.Destination.StdOut) ? stdoutByTest : stderrByTest
def buf = map.computeIfAbsent(descriptor) { new StringBuilder() }
buf.append(event.message)
}
afterTest { TestDescriptor descriptor, TestResult result ->
try {
if (result.resultType == TestResult.ResultType.FAILURE) {
def stdout = stdoutByTest.remove(descriptor)?.toString()
def stderr = stderrByTest.remove(descriptor)?.toString()
println ""
println "---- output for ${descriptor.className}.${descriptor.name} ----"
if (stdout) {
println "[stdout]"
print stdout
if (!stdout.endsWith("\n")) println()
}
if (stderr) {
println "[stderr]"
print stderr
if (!stderr.endsWith("\n")) println()
}
println "---- end output ----"
} else {
// passing/skipped: discard buffered output
stdoutByTest.remove(descriptor)
stderrByTest.remove(descriptor)
}
} finally {
// cleanup in case descriptor object lingers
stdoutByTest.remove(descriptor)
stderrByTest.remove(descriptor)
}
}
}
task bpipeJar(type: Jar, dependsOn: 'compileGroovy') {
from 'build/classes/groovy/main'
archiveFileName='bpipe-only.jar'
duplicatesStrategy 'include'
}
task stage(dependsOn: [bpipeJar, shadowJar /*,cloudjar*/]) {
doLast {
println "The staging directory is $STAGE"
ant.mkdir(dir: STAGE)
ant.mkdir(dir: "$STAGE/bin")
ant.mkdir(dir: "$STAGE/lib")
ant.mkdir(dir: "$STAGE/lib/slf4j")
ant.copy(todir: "$STAGE/bin") {
ant.fileset(dir: 'bin', includes: "**")
}
println "The file to stage bpipe to is: " + (new File(STAGE+'/bin/bpipe')).absolutePath
new File(STAGE+'/bin/bpipe').text =
new File("bin/bpipe").text.replaceAll("VERSION=0.0.0","VERSION=$VERSION").replaceAll("BUILDDATE=0","BUILDDATE="+String.valueOf(System.currentTimeMillis()))
ant.copy(todir: "$STAGE/lib") {
// do not distribute mail.jar due to license
ant.fileset(dir: 'local-lib', includes: "*.jar",
excludes: "slf4j-*,mail.jar,gridgain-*.jar,hazelcast-*.jar,batik*.jar,commons-cli*.jar,jgraphx.jar,xml-*.jar,gpars*.jar,jsr*.jar,extra166y*.jar,groovy-all-*.jar,google-*.jar")
// ant.fileset(dir: 'build/libs', includes: "bpipe.jar,bpipe-cloud.jar")
ant.fileset(dir: 'build/libs', includes: "bpipe-all.jar")
}
ant.copy(todir: "$STAGE/lib/slf4j") {
ant.fileset(dir: 'local-lib/slf4j', includes: "*.jar")
}
["templates","html"].each { type ->
ant.mkdir(dir: "$STAGE/$type")
ant.copy(todir: "$STAGE/$type") {
ant.fileset(dir: "src/main/$type/bpipe", includes: "**")
}
}
ant.copy(todir: "$STAGE") {
ant.fileset(dir: 'src/main/config', includes: "bpipe.config")
}
ant.chmod(perm: 'a+rx') {
ant.fileset(dir: "$STAGE/bin", includes: "**")
}
}
}
task dist(dependsOn: stage) {
doLast {
ant.tar(destfile: "build/bpipe-${VERSION}.tar") {
ant.fileset(dir: "build/stage", includes: "bpipe-${VERSION}/lib/**", excludes:"**/*.swp")
ant.fileset(dir: "build/stage", includes: "bpipe-${VERSION}/bpipe.config", excludes:"**/*.swp")
ant.fileset(dir: "build/stage", includes: "bpipe-${VERSION}/html/**", excludes:"**/*.swp")
ant.fileset(dir: "build/stage", includes: "bpipe-${VERSION}/templates/**", excludes:"**/*.swp")
ant.tarfileset(dir: "build/stage", filemode:"755", includes: "bpipe-${VERSION}/bin/**", excludes:"**/*.swp")
}
// Note: natively zipping loses permissions, but repackaging tar does not
ant.zip(destfile: "build/bpipe-${VERSION}.zip") {
ant.tarfileset(src: "build/bpipe-${VERSION}.tar")
}
ant.gzip(destfile:"build/bpipe-${VERSION}.tar.gz", src: "build/bpipe-${VERSION}.tar")
}
}
// ===== E2E Test Task Registrations =====
//
// Groups are defined by lists of name prefixes. A test directory matches a group if its
// name starts with any prefix in the list. Exact test names can also be listed when
// they don't share a common prefix with their peers.
//
// Run all tests: ./gradlew e2eTest
// Run a single test: ./gradlew e2eTest -Pe2eFilter=simple
// Run a group: ./gradlew e2eTestParallel
// Run misc (ungrouped): ./gradlew e2eTestMisc
def e2eTestGroups = [
Core: ['simple', 'succeed', 'background', 'status_command', 'documentation',
'pipeline_var', 'pipeline_require', 'wait_for_output', 'when', 'slow',
'touch', 'backtick', 'glob', 'add_jar', 'abspath_preserve', 'extensions',
'print_created_files', 'remake', 'quiet_and_clean', 'large_number_files',
'read_inputs_from_file', 'manual_resolve', 'folderasoutput',
'innocuous_output_dir_ref', 'define'],
Produce: ['produce',
// persistently fails in CI for unclear reasons
// 'preallocate',
'implicitmultioutput', 'optional_output',
'optional_transform_annotation', 'append_output_dir'],
Transform: ['transform', 'filter', 'filterlines'],
From: ['from', 'input', 'double_input_ext', 'whole_input_is_extension',
'single_input_with_number'],
Output: ['output', 'outputdir', 'outputext', 'outputfolder', 'non_default_output',
'prefix', 'dir_option_changes_output_dir', 'outdir_with_following_input',
'outputs_from_diff_parallel_stages', 'outputs_listed_in_order',
'overlapping_double_ext'],
Parallel: ['parallel', 'consecutive_parallel', 'double_parallel', 'nested_parallel',
'huge_nested_parallel', 'huge_parallel', 'middle_parallel_no_inputs',
'ordered_input_to_parallel', 'empty_parallel_segment', 'empty_parallel_stage',
'param_nested_parallel'],
Branch: ['branch', 'split', 'detached_branch', 'set_branch_name', 'mid_pipeline_split',
'parent_branch_variable'],
Sample: ['persample', 'perchromosome', 'per_chromosome', 'chr', 'paired_end',
'per_generic_list', 'custom_chr', 'region_as_bed', 'region_flag',
'bed', 'prechrinput'],
Check: ['check', 'double_check', 'groovy_check', 'external_error',
'undefined_variable', 'missing_input_error', 'mnc_github_bug_264'],
Config: ['config', 'param', 'params_from_file', 'using', 'stage_based_config',
'stage_specific_parameter', 'embedded_config', 'environments', 'options',
'reference_param_in_config', 'require_with_using', 'cmdlinevars',
'custom_db_location', 'custom_filetype', 'withconfig'],
Load: ['load', 'segment', 'external_segment', 'externalstages', 'dependent_modules',
'ref_local_in_external', 'reference_loaded_before_run', 'replace_segment',
'error_on_load', 'cmd_line_load'],
Channels: ['forward', 'merge_point', 'channels', 'simple_channels', 'accompanies'],
Multi: ['multi', 'two_inputs_double_ext', 'downstream_multiinputs'],
Cleanup: ['cleanup', 'alias', 'intermediate', 'unclean', 'equal_timestamps_cleanup',
'preserve'],
Resources: ['thread', 'resource_limit', 'maxmem', 'memory_variable', 'sge', 'torque',
'rscript', 'file_notifications', 'send_http_json', 'send_to_file',
'query_with_outputdir', 'output_branch_report'],
]
def e2eParallelism = Integer.parseInt(project.findProperty('e2eParallel') ?: '1')
tasks.register('e2eTest', BpipeE2ETest) {
group = 'verification'
description = 'Run all Bpipe e2e tests (use -Pe2eFilter=<name> to run a specific test, -Pe2eParallel=N for parallel execution)'
dependsOn stage
nameFilter = project.findProperty('e2eFilter') ?: ''
maxParallel = e2eParallelism
}
e2eTestGroups.each { groupName, prefixes ->
tasks.register("e2eTest${groupName}", BpipeE2ETest) {
group = 'e2e tests'
description = "Run ${groupName} e2e tests"
dependsOn stage
testPrefixes = prefixes
maxParallel = e2eParallelism
}
}
tasks.register('e2eTestMisc', BpipeE2ETest) {
group = 'e2e tests'
description = 'Run miscellaneous e2e tests not covered by other groups'
dependsOn stage
excludePrefixes = e2eTestGroups.values().flatten() as List
maxParallel = e2eParallelism
}
wrapper {
gradleVersion = '5.2.1'
}