chia7712 commented on code in PR #22201: URL: https://github.com/apache/kafka/pull/22201#discussion_r3191905960
########## clients/src/testFixtures/java/org/apache/kafka/clients/admin/FailureInjectingTimeoutProcessorFactory.java: ########## @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.kafka.clients.admin; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FailureInjectingTimeoutProcessorFactory extends KafkaAdminClient.TimeoutProcessorFactory { Review Comment: similar to `KafkaAdminClientInternalFactory`, which can be moved out of testfixtures. ########## clients/src/testFixtures/java/org/apache/kafka/clients/admin/KafkaAdminClientInternalFactory.java: ########## @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.kafka.clients.admin; + +public class KafkaAdminClientInternalFactory { Review Comment: Exposing a package-private method through this 'factory' feels very hacky. I'll submit a PR to move the specific test from core to clients-integration-test so we can close this door for good. ########## build.gradle: ########## @@ -4014,6 +4056,25 @@ task aggregatedJavadoc(type: Javadoc) { } gradle.projectsEvaluated { + // Validate that no module depends on `project(':clients').sourceSets.test.output` + allprojects { proj -> + proj.configurations.all { config -> + config.dependencies.each { dep -> + if (dep instanceof FileCollectionDependency) { + dep.files.files.each { file -> + if (file.absolutePath.endsWith('/clients/build/classes/java/test')) { Review Comment: Nice catch. Right now it only rejects client test code, but since other modules still depend on other's test code, this will eventually result in all test scopes being rejected as we clean them up. A beautiful world! :smile: -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
