zentol commented on code in PR #23: URL: https://github.com/apache/flink-connector-shared-utils/pull/23#discussion_r1394112129
########## module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java: ########## @@ -0,0 +1,31 @@ +/* + * 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.flink.connector.testing; + +import static org.apache.flink.util.Preconditions.checkNotNull; + +/** A dummy class; only exists so that the compile/packaging plugins have something to do. */ +public class SomeClass { + public static void main(String[] args) { + // this call is an intended (for testing) violation of the + // ConnectorRules#CONNECTOR_CLASSES_ONLY_DEPEND_ON_PUBLIC_API archunit rule that was fixed Review Comment: I'd prefer a violation that is fully under the control of this repo. ########## pom.xml: ########## @@ -48,7 +52,41 @@ under the License. <artifactId>flink-test-utils-junit</artifactId> <version>${flink.version}</version> <scope>test</scope> + <!-- for dependency convergence --> + <exclusions> + <exclusion> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + </exclusion> + </exclusions> </dependency> + + <!-- ArchUit test dependencies --> + <dependency> + <groupId>org.apache.flink</groupId> + <artifactId>flink-architecture-tests-test</artifactId> Review Comment: I'd rather have us define our own rules than relying on the Flink ones. We then wouldn't need these 2 dependencies, nor 10 violations stores, nor had to update them when Flink versions are being bumped. For correctness purposes it shouldn't make a difference. ########## module-with-tests/src/test/java/org/apache/flink/connector/testing/architecture/TestCodeArchitectureTest.java: ########## @@ -0,0 +1,46 @@ +/* + * 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.flink.connector.testing.architecture; + +import org.apache.flink.architecture.TestCodeArchitectureTestBase; +import org.apache.flink.architecture.common.ImportOptions; + +import com.tngtech.archunit.core.importer.ImportOption; +import com.tngtech.archunit.junit.AnalyzeClasses; +import com.tngtech.archunit.junit.ArchTest; +import com.tngtech.archunit.junit.ArchTests; + +/** Architecture tests for test code. */ +@AnalyzeClasses( + packages = { + "org.apache.flink.batch.connectors.cassandra", + "org.apache.flink.streaming.connectors.cassandra", + "org.apache.flink.connector.cassandra", + "org.apache.flink.connectors.cassandra" + }, Review Comment: These should cause the test to be a no-op. ########## module-with-no-tests/src/main/java/org/apache/flink/connector/testing/SomeClass2.java: ########## @@ -19,4 +19,7 @@ package org.apache.flink.connector.testing; /** A dummy class; only exists so that the compile/packaging plugins have something to do. */ -public class SomeClass {} +public class SomeClass2 { Review Comment: Why is this class being modified? ########## module-with-tests/src/main/java/org/apache/flink/connector/testing/SomeClass.java: ########## @@ -0,0 +1,31 @@ +/* + * 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.flink.connector.testing; + +import static org.apache.flink.util.Preconditions.checkNotNull; + +/** A dummy class; only exists so that the compile/packaging plugins have something to do. */ +public class SomeClass { + public static void main(String[] args) { + // this call is an intended (for testing) violation of the + // ConnectorRules#CONNECTOR_CLASSES_ONLY_DEPEND_ON_PUBLIC_API archunit rule that was fixed Review Comment: Actually, I'm a bit lost. Does this fail the build or not? What prevents it from failing if the architecture tests are enabled? We always build against the same Flink version after all. ########## module-with-no-tests/.gitignore: ########## @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml Review Comment: if anything this belongs into a root .gitignore. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org