-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
173 lines (149 loc) · 3.85 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
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
plugins {
id 'java'
id "io.freefair.lombok" version "8.1.0"
id "io.qameta.allure" version "2.8.0"
id "io.freefair.aspectj" version "5.1.1"
id("org.jetbrains.kotlinx.kover") version "0.7.3"
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.junit.platform:junit-platform-launcher:1.7.0'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation 'org.junit.jupiter:junit-jupiter-params:5.7.0'
implementation 'org.assertj:assertj-core:3.19.0'
implementation 'com.typesafe:config:1.4.1'
implementation "org.aspectj:aspectjrt:1.9.6"
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'com.fasterxml.jackson.core:jackson-annotations:2.10.4'
testImplementation 'com.fasterxml.jackson.core:jackson-core:2.10.4'
testImplementation 'org.projectlombok:lombok:1.18.16'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.16'
}
test{
useJUnitPlatform()
enabled = false
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
outputs.upToDateWhen { false }
finalizedBy(tasks.koverXmlReport)
}
tasks.register('webtests', Test).configure(){
filter{
includeTestsMatching("simpleautomation.web.simple*")
}
}
tasks.register('resttests', Test).configure(){
filter{
includeTestsMatching("rest*")
}
finalizedBy tasks.koverXmlReport
}
tasks.register('kubertest', Test).configure(){
filter{
includeTestsMatching("rest.KuberTest*")
}
}
tasks.register('unit', Test).configure(){
filter{
includeTestsMatching("simple.automation.*")
}
}
tasks.register('regress', Test){
dependsOn 'resttests'
dependsOn 'webtests'
webtests.mustRunAfter(resttests)
}
//sourceSets{
// tst{
// java{
// compileClasspath += main.output
// runtimeClasspath += main.output
// srcDir file('src/main/java/simpleautomation')
// }
// }
//}
//
//configurations{
// tstImplementation.extendsFrom(testImplementation)
// tstRuntimeOnly.extendsFrom(testRuntimeOnly)
//}
//
//tasks.register('pseudotests', Test).configure(){
// testClassesDirs = sourceSets.tst.output.classesDirs
// classpath = sourceSets.tst.runtimeClasspath
// useJUnitPlatform{
// includeTags "pseudo"
// }
//}
def ourTask = tasks.register('grtest', customTask)
ourTask.configure(){
println 'from task root'
testInput = "custom input"
inputs
doFirst {
println 'from do first'
}
doLast {
println 'from do last'
}
}
tasks.register("2", customTask){
println "from 2"
}
def printFiles(String header, FileCollection files) {
logger.lifecycle(header)
files.forEach { f -> logger.lifecycle(" -> $f") }
}
class customTask extends DefaultTask{
@Input
String testInput = "defaultInput"
@TaskAction
def action1(){
println "custom action1 with input $testInput"
}
@TaskAction
def action2(){
println 'custom action2'
}
}
println 'from build root'
//jar {
// manifest{
// attributes 'Main-Class':'simpleautomation.Main'
// }
// from {
// configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
// }
//}
tasks.register('zipReport', Zip).configure(){
archiveFileName = 'reports.zip'
destinationDirectory = file("$buildDir/reports")
from "$buildDir/reports/tests"
}
tasks.register('copyReport', Copy).configure{
from file("$buildDir/reports/reports.zip")
into file("out")
}
allure{
autoconfigure = true
aspectjweaver = true
}
configurations {
testCompile
}
koverReport {
filters {
includes {
classes("simple.automation.*")
}
}
defaults {
xml {
onCheck = false
setReportFile(layout.projectDirectory.file(".qodana/code-coverage/result.xml").asFile)
}
}
}