You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "FrankYang0529 (via GitHub)" <gi...@apache.org> on 2026/06/12 00:22:27 UTC
[PR] KAFKA-20553: Eliminate the dependencies on sourceSets.test.output for connect:runtime [kafka]
FrankYang0529 opened a new pull request, #22547:
URL: https://github.com/apache/kafka/pull/22547
Gradle test fixtures to the clients module and removes all dependencies
on sourceSets.test.output. We should revisit other usages in this JIRA.
This will simplify the dependency graph and unblock the upgrade to
Gradle 9.5+
This patch is working on `connect:runtime`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20553: Eliminate the dependencies on sourceSets.test.output for connect:runtime [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22547:
URL: https://github.com/apache/kafka/pull/22547#discussion_r3408695728
##########
connect/runtime/src/testFixtures/java/org/apache/kafka/connect/runtime/isolation/TestPlugins.java:
##########
@@ -417,6 +429,31 @@ private static Path resourceDirectoryPath(String resourceDir) throws IOException
return file;
}
+ private static Path extractResourceDirectoryFromJar(String resourceDir, URL resource) throws IOException {
+ String prefix = resourceDir.endsWith("/") ? resourceDir : resourceDir + "/";
+ Path tmpDir = TestUtils.tempDirectory("test-plugins-resources.").toPath();
+ JarURLConnection connection = (JarURLConnection) resource.openConnection();
+ // Do not share the cached JarFile with the classloader, so we own it and can close it.
+ connection.setUseCaches(false);
+ try (JarFile jarFile = connection.getJarFile()) {
+ Enumeration<JarEntry> entries = jarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry entry = entries.nextElement();
+ String name = entry.getName();
+ if (entry.isDirectory() || !name.startsWith(prefix)) {
+ continue;
+ }
+ Path dest = tmpDir.resolve(name.substring(prefix.length()));
+ Files.createDirectories(dest.getParent());
+ try (InputStream in = jarFile.getInputStream(entry)) {
+ Files.copy(in, dest, StandardCopyOption.REPLACE_EXISTING);
+ }
+ dest.toFile().deleteOnExit();
Review Comment:
this is unnecessary now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20553: Eliminate the dependencies on sourceSets.test.output for connect:runtime [kafka]
Posted by "FrankYang0529 (via GitHub)" <gi...@apache.org>.
FrankYang0529 commented on code in PR #22547:
URL: https://github.com/apache/kafka/pull/22547#discussion_r3403626901
##########
connect/runtime/src/testFixtures/java/org/apache/kafka/connect/runtime/isolation/TestPlugins.java:
##########
@@ -417,6 +428,32 @@ private static Path resourceDirectoryPath(String resourceDir) throws IOException
return file;
}
+ private static Path extractResourceDirectoryFromJar(String resourceDir, URL resource) throws IOException {
+ String prefix = resourceDir.endsWith("/") ? resourceDir : resourceDir + "/";
+ Path tmpDir = Files.createTempDirectory("test-plugins-resources.");
+ tmpDir.toFile().deleteOnExit();
Review Comment:
Good catch. Updated it. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20553: Eliminate the dependencies on sourceSets.test.output for connect:runtime [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #22547:
URL: https://github.com/apache/kafka/pull/22547
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20553: Eliminate the dependencies on sourceSets.test.output for connect:runtime [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #22547:
URL: https://github.com/apache/kafka/pull/22547#discussion_r3403155350
##########
connect/runtime/src/testFixtures/java/org/apache/kafka/connect/runtime/isolation/TestPlugins.java:
##########
@@ -417,6 +428,32 @@ private static Path resourceDirectoryPath(String resourceDir) throws IOException
return file;
}
+ private static Path extractResourceDirectoryFromJar(String resourceDir, URL resource) throws IOException {
+ String prefix = resourceDir.endsWith("/") ? resourceDir : resourceDir + "/";
+ Path tmpDir = Files.createTempDirectory("test-plugins-resources.");
+ tmpDir.toFile().deleteOnExit();
Review Comment:
Would `TestUtils.tempDirectory` be a better fit for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org