* Separate platform and connector testcontainer versions * Fix dependency * Fix dependency * Fix dependency usage * Prevent leaking testcontainer dependencies
107 lines
4.1 KiB
Groovy
107 lines
4.1 KiB
Groovy
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 project(':airbyte-container-orchestrator')
|
|
|
|
implementation 'io.fabric8:kubernetes-client:5.12.2'
|
|
implementation libs.platform.testcontainers
|
|
|
|
acceptanceTestsImplementation project(':airbyte-api')
|
|
acceptanceTestsImplementation project(':airbyte-commons')
|
|
acceptanceTestsImplementation project(':airbyte-config:config-models')
|
|
acceptanceTestsImplementation project(':airbyte-config:config-persistence')
|
|
acceptanceTestsImplementation project(':airbyte-db:db-lib')
|
|
acceptanceTestsImplementation project(':airbyte-tests')
|
|
acceptanceTestsImplementation project(':airbyte-test-utils')
|
|
acceptanceTestsImplementation project(':airbyte-workers')
|
|
|
|
acceptanceTestsImplementation 'com.fasterxml.jackson.core:jackson-databind'
|
|
acceptanceTestsImplementation 'io.github.cdimascio:java-dotenv:3.0.0'
|
|
acceptanceTestsImplementation 'io.temporal:temporal-sdk:1.8.1'
|
|
acceptanceTestsImplementation 'org.apache.commons:commons-csv:1.4'
|
|
acceptanceTestsImplementation libs.platform.testcontainers.postgresql
|
|
acceptanceTestsImplementation libs.postgresql
|
|
|
|
automaticMigrationAcceptanceTestImplementation project(':airbyte-api')
|
|
automaticMigrationAcceptanceTestImplementation project(':airbyte-commons')
|
|
automaticMigrationAcceptanceTestImplementation project(':airbyte-tests')
|
|
|
|
automaticMigrationAcceptanceTestImplementation libs.platform.testcontainers
|
|
}
|
|
|
|
// 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
|
|
}
|