Aiven-Open / gcs-connector-for-apache-kafka

Aiven's GCS Sink Connector for Apache Kafka®
Apache License 2.0
70 stars 38 forks source link

Implementation dependencies included on integration tests classpath and plugin path #283

Closed jeqo closed 1 year ago

jeqo commented 1 year ago

Integration tests start a Connect worker using plugin directory from the distribution:

task integrationTest(type: Test) {
    //...
    dependsOn test, distTar
    //...
    // Pass the distribution file path to the tests.
    systemProperty("integration-test.distribution.file.path", distTar.archiveFile.get().asFile.path)
    //...
}

To then use distribution: https://github.com/aiven/gcs-connector-for-apache-kafka/blob/ff9d1a11f1feb99acb302334cc6fc98032c0f023/src/integration-test/java/io/aiven/kafka/connect/gcs/AbstractIntegrationTest.java#L154

At the same time, integration tests inherit dependencies from tests (and therefore also base):

configurations {
    integrationTestImplementation.extendsFrom testImplementation
    integrationTestRuntime.extendsFrom testRuntimeClasspath
}

This may cause dependency conflicts as different versions may be added by integration tests and base deps.

For our use-case (ConnectRunner based integration tests), dependencies should not be inherited to only load Connector main dependencies via plugin directory.

jeqo commented 1 year ago

This was solved by #285