forked from lfit/releng-pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (122 loc) · 4.69 KB
/
build.gradle
File metadata and controls
142 lines (122 loc) · 4.69 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
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2019 Intel Corporation
// Copyright (c) 2020 The Linux Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
plugins {
id 'java'
id 'groovy'
id 'jacoco'
}
jacoco {
toolVersion = "0.8.5"
}
group = 'thelinuxfoundation'
version = "0.0.1"
description = "Testing Shared Pipelines Library"
// Spock works with Java 1.7 and above
sourceCompatibility = 1.8
project.buildDir = 'target'
repositories {
// Spock releases are available from Maven Central
mavenCentral()
maven { url "https://repo.jenkins-ci.org/public" }
}
dependencies {
def withoutIcu = { exclude group: 'com.ibm.icu', module: 'icu4j' }
// mandatory dependencies for using Spock
implementation "org.codehaus.groovy:groovy-all:2.5.8"
implementation "com.cloudbees:groovy-cps:1.31@jar", withoutIcu
implementation "org.slf4j:jcl-over-slf4j:1.7.25"
testImplementation "org.slf4j:log4j-over-slf4j:1.7.25"
testImplementation "org.slf4j:slf4j-api:1.7.25"
testImplementation "ch.qos.logback:logback-core:1.2.3"
testImplementation "ch.qos.logback:logback-classic:1.2.3"
testImplementation "org.apache.commons:commons-csv:1.1"
testImplementation "com.google.guava:guava:20.0"
testImplementation group: 'org.apache.maven', name: 'maven-model',
version: '3.0.2'
testImplementation "org.spockframework:spock-core:1.3-groovy-2.5@jar"
// Jenkins related
testImplementation "com.homeaway.devtools.jenkins:jenkins-spock:2.1.2"
testImplementation "javax.servlet:javax.servlet-api:3.1.0"
testImplementation "org.jenkins-ci.main:jenkins-core:2.225", withoutIcu
testImplementation "org.jenkins-ci.plugins.workflow:workflow-api:2.40@jar"
testImplementation \
"org.jenkins-ci.plugins.workflow:workflow-step-api:2.22@jar"
testImplementation "org.jenkins-ci.plugins.workflow:workflow-cps:2.78@jar"
testImplementation \
"org.jenkins-ci.plugins.workflow:workflow-durable-task-step:2.35@jar"
// durable-task: transitive dependency for workflow-durable-task-step
testImplementation "org.jenkins-ci.plugins:durable-task:1.33@jar"
// workflow-cps-global-lib: provides libraryResource() step
testImplementation \
"org.jenkins-ci.plugins.workflow:workflow-cps-global-lib:2.15@jar"
testImplementation "org.jenkins-ci:symbol-annotation:1.10"
testImplementation "org.jenkins-ci.plugins:pipeline-stage-step:2.3@jar"
testImplementation "org.jenkins-ci.plugins:ssh-agent:1.17@jar"
testImplementation "org.jenkins-ci.plugins:config-file-provider:3.6.2@jar"
testImplementation "org.jenkins-ci.plugins:credentials-binding:1.20@jar"
testImplementation "org.jenkins-ci.plugins:pipeline-utility-steps:2.3.1@jar"
testImplementation "org.jenkins-ci.plugins:script-security:1.68@jar"
testImplementation "org.jenkins-ci.plugins:docker-commons:1.15@jar"
testImplementation "org.jenkins-ci.plugins:docker-workflow:1.21@jar"
testImplementation "org.springframework:spring-core:4.3.19.RELEASE"
testImplementation "org.springframework:spring-test:4.3.2.RELEASE"
}
test {
systemProperty 'root.loglevel', 'INFO'
systemProperty 'root.appender', 'Stdout'
systemProperty 'test.loglevel', 'INFO'
systemProperty 'logdir', './target/logs'
reports {
junitXml.enabled = true
}
// prints a summary after test execution
testLogging {
afterSuite { desc, result ->
if (!desc.parent) {
println "Results: ${result.resultType} (${result.testCount} tests, " \
+ "${result.successfulTestCount} successes, " \
+ "${result.failedTestCount} failures, ${result.skippedTestCount} " \
+ "skipped)"
}
}
}
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled true
}
}
// this is needed for spock to find all the source code in the var directory
task copyGlobalLibVars (type: Copy) {
from "$rootDir/vars"
include '**/*.groovy'
into "$buildDir/classes/vars"
}
compileTestGroovy {
options.incremental = true
options.fork = true
options.failOnError = false
}
compileTestGroovy.dependsOn copyGlobalLibVars
// print the test classpath. Good for debugging ClassNotFound issues
task printClasspath {
doLast {
configurations.testRuntimeClasspath.each { println it }
}
}