forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
101 lines (87 loc) · 3.81 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
plugins {
id 'java'
}
// The java plugin automatically compiles/runs tests in the test source set (./src/test directory). Since we want acceptance tests to run
// only when explicitly requested, we put them in a separate source set, specify the sourceset's dependencies via configuration extensions below,
// and create a custom test task that can be invoked to run acceptance tests.
sourceSets {
acceptanceTests {
java {
srcDir("src/acceptanceTests/java")
}
resources {
srcDir("src/acceptanceTests/resources")
}
}
automaticMigrationAcceptanceTest {
java {
srcDir("src/automaticMigrationAcceptanceTest/java")
}
resources {
srcDir("src/automaticMigrationAcceptanceTest/resources")
}
}
}
// Gradle links configurations with the name xImplementation or xRuntimeOnly etc.. to the source set named x. Therefore, any deps specified
// using the extensions below apply only to this sourceset and not any other code in the project.
configurations {
acceptanceTestsImplementation.extendsFrom testImplementation
acceptanceTestsRuntimeOnly.extendsFrom testRuntimeOnly
automaticMigrationAcceptanceTestImplementation.extendsFrom testImplementation
automaticMigrationAcceptanceTestRuntimeOnly.extendsFrom testRuntimeOnly
}
dependencies {
implementation project(':airbyte-api')
implementation 'org.testcontainers:testcontainers:1.15.3'
acceptanceTestsImplementation project(':airbyte-api')
acceptanceTestsImplementation project(':airbyte-commons')
acceptanceTestsImplementation project(':airbyte-config:persistence')
acceptanceTestsImplementation project(':airbyte-db:lib')
acceptanceTestsImplementation project(':airbyte-tests')
acceptanceTestsImplementation project(':airbyte-test-utils')
acceptanceTestsImplementation 'com.fasterxml.jackson.core:jackson-databind'
acceptanceTestsImplementation 'io.github.cdimascio:java-dotenv:3.0.0'
acceptanceTestsImplementation 'org.apache.commons:commons-csv:1.4'
acceptanceTestsImplementation 'org.testcontainers:postgresql:1.15.3'
acceptanceTestsImplementation 'org.postgresql:postgresql:42.2.18'
automaticMigrationAcceptanceTestImplementation project(':airbyte-api')
automaticMigrationAcceptanceTestImplementation project(':airbyte-commons')
automaticMigrationAcceptanceTestImplementation project(':airbyte-tests')
automaticMigrationAcceptanceTestImplementation 'org.testcontainers:testcontainers:1.15.3'
}
// test should run using the current version of the docker compose configuration.
task copyComposeFileForAcceptanceTests(type: Copy) {
from "${rootDir}/docker-compose.yaml"
into "${sourceSets.acceptanceTests.output.resourcesDir}"
}
task copyComposeFileForMigrationAcceptanceTests(type: Copy) {
from "${rootDir}/docker-compose.yaml"
into "${sourceSets.automaticMigrationAcceptanceTest.output.resourcesDir}"
}
assemble.dependsOn(project.tasks.copyComposeFileForAcceptanceTests)
assemble.dependsOn(project.tasks.copyComposeFileForMigrationAcceptanceTests)
task acceptanceTests(type: Test) {
testClassesDirs += sourceSets.acceptanceTests.output.classesDirs
classpath += sourceSets.acceptanceTests.runtimeClasspath
useJUnitPlatform()
failFast = true
testLogging() {
events "passed", "failed"
exceptionFormat "full"
}
mustRunAfter test
}
task automaticMigrationAcceptanceTest(type: Test) {
testClassesDirs += sourceSets.automaticMigrationAcceptanceTest.output.classesDirs
classpath += sourceSets.automaticMigrationAcceptanceTest.runtimeClasspath
useJUnitPlatform()
failFast = true
testLogging() {
events "passed", "failed"
exceptionFormat "full"
}
mustRunAfter test
}
tasks.withType(Copy) {
duplicatesStrategy DuplicatesStrategy.INCLUDE
}