forked from opensearch-project/data-prepper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (104 loc) · 3.84 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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
plugins{
id 'de.undercouch.download' version '5.5.0'
}
apply plugin: 'de.undercouch.download'
import de.undercouch.gradle.tasks.download.Download
dependencies {
implementation project(':data-prepper-api')
implementation project(path: ':data-prepper-plugins:common')
implementation 'io.micrometer:micrometer-core'
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation libs.commons.compress
implementation libs.commons.io
implementation 'software.amazon.awssdk:sts'
implementation 'software.amazon.awssdk:s3'
implementation 'com.maxmind.geoip2:geoip2:4.2.0'
implementation 'com.maxmind.db:maxmind-db:3.1.0'
implementation 'org.hibernate.validator:hibernate-validator:8.0.1.Final'
implementation libs.commons.lang3
implementation libs.armeria.core
testImplementation project(':data-prepper-core')
testImplementation project(':data-prepper-plugin-framework')
testImplementation project(':data-prepper-pipeline-parser')
testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
testImplementation project(':data-prepper-test-common')
}
def downloadFiles = tasks.register('downloadFiles')
def databaseNames = [
'GeoLite2-City-Test',
'GeoLite2-Country-Test',
'GeoLite2-ASN-Test'
]
databaseNames.forEach { databaseName -> {
def url = "https://raw.githubusercontent.com/maxmind/MaxMind-DB/main/test-data/${databaseName}.mmdb"
def gradleName = databaseName.replaceAll('-', '')
def downloadTask = tasks.register("download${gradleName}", Download) {
src(url)
dest "${project.layout.buildDirectory.get()}/resources/test/mmdb-files/geo-lite2/${databaseName}.mmdb"
overwrite true
}
downloadFiles.get().dependsOn downloadTask
}}
def enterpriseDatabaseNames = [
'GeoIP2-Enterprise-Test'
]
enterpriseDatabaseNames.forEach { enterpriseDatabaseName -> {
def url = "https://raw.githubusercontent.com/maxmind/MaxMind-DB/main/test-data/${enterpriseDatabaseName}.mmdb"
def gradleName = enterpriseDatabaseName.replaceAll('-', '')
def downloadEnterpriseTask = tasks.register("download${gradleName}", Download) {
src(url)
dest "${project.layout.buildDirectory.get()}/resources/test/mmdb-files/geo-ip2/${enterpriseDatabaseName}.mmdb"
overwrite true
}
downloadFiles.get().dependsOn downloadEnterpriseTask
}}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integrationTest/java')
}
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntime.extendsFrom testRuntime
}
task integrationTest(type: Test) {
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
useJUnitPlatform()
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperty 'data-prepper.dir', project.layout.buildDirectory.get().getAsFile().absolutePath
filter {
includeTestsMatching '*IT'
}
}
test {
useJUnitPlatform()
dependsOn(downloadFiles)
systemProperty 'data-prepper.dir', project.layout.buildDirectory.get().getAsFile().absolutePath
}
checkstyleTest {
dependsOn(downloadFiles)
}
compileIntegrationTestJava.dependsOn downloadFiles
jacocoTestCoverageVerification {
dependsOn jacocoTestReport
violationRules {
rule {
limit {
minimum = 0.84
}
}
}
}
check.dependsOn jacocoTestCoverageVerification
check.dependsOn integrationTest