-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
72 lines (61 loc) · 1.79 KB
/
build.gradle
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
plugins {
// Apply the groovy Plugin to add support for Groovy.
id 'groovy'
}
// follow the structure as dictated by Jenkins:
sourceSets {
main {
groovy {
srcDirs = ['src','vars']
}
resources {
srcDirs = ['resources']
}
}
test {
groovy {
srcDirs = ['test']
}
}
}
repositories {
jcenter()
maven {
url "https://repo.jenkins-ci.org/releases/"
}
}
dependencies {
implementation 'org.codehaus.groovy:groovy-all:2.5.8'
implementation 'org.apache.ivy:ivy:2.4.0'
implementation 'org.jenkins-ci.main:jenkins-core:2.164.1'
def staplerGAV = 'org.kohsuke.stapler:stapler:1.255'
implementation staplerGAV
annotationProcessor staplerGAV
implementation 'org.jenkins-ci.plugins.workflow:workflow-step-api:2.19@jar'
implementation 'org.jenkins-ci.plugins:pipeline-utility-steps:2.2.0@jar'
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
testImplementation 'junit:junit:4.12'
testImplementation 'com.lesfurets:jenkins-pipeline-unit:1.1'
}
test {
dependsOn cleanTest
// don't stop if tests fail
ignoreFailures = true
// minimize logging
testLogging.maxGranularity = 0
// show stdout from tests
onOutput { dest, event -> print event.message }
// show test results
def results = []
afterTest { desc, result -> println "${desc.className.split("\\.")[-1]}: ${desc.name}: ${result.resultType}" }
afterSuite { desc, result ->
if (desc.className) {
results << result
}
}
// show summary
doLast {
println "Tests: ${results.sum { it.testCount }}, Failures: ${results.sum { it.failedTestCount }}" +
", Errors: ${results.sum { it.exceptions.size() }}, Skipped: ${results.sum { it.skippedTestCount }}"
}
}