forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairbyte-source-acceptance-test.gradle
45 lines (39 loc) · 2 KB
/
airbyte-source-acceptance-test.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
import org.gradle.api.Plugin
import org.gradle.api.Project
class AirbyteSourceAcceptanceTestPlugin implements Plugin<Project> {
void apply(Project project) {
project.task('sourceAcceptanceTest') {
doFirst {
project.exec {
def targetMountDirectory = "/test_input"
def args = [
'docker', 'run', '--rm', '-i',
// provide access to the docker daemon
'-v', "/var/run/docker.sock:/var/run/docker.sock",
// A container within a container mounts from the host filesystem, not the parent container.
// this forces /tmp to be the same directory for host, parent container, and child container.
'-v', "/tmp:/tmp",
// mount the project dir. all provided input paths must be relative to that dir.
'-v', "${project.projectDir.absolutePath}:${targetMountDirectory}",
'-w', "$targetMountDirectory",
'airbyte/source-acceptance-test',
'-p', 'integration_tests.acceptance',
]
commandLine args
}
}
outputs.upToDateWhen { false }
}
project.sourceAcceptanceTest.dependsOn(':airbyte-integrations:bases:source-acceptance-test:airbyteDocker')
project.sourceAcceptanceTest.dependsOn(project.build)
project.sourceAcceptanceTest.dependsOn(project.airbyteDocker)
if (project.hasProperty('airbyteDockerTest')){
project.sourceAcceptanceTest.dependsOn(project.airbyteDockerTest)
}
// make sure we create the integrationTest task once in case a java integration test was already initialized
if (!project.hasProperty('integrationTest')) {
project.task('integrationTest')
}
project.integrationTest.dependsOn(project.sourceAcceptanceTest)
}
}