gianm commented on code in PR #18236: URL: https://github.com/apache/druid/pull/18236#discussion_r2201221797
########## dev/validate-junit5-usage: ########## @@ -0,0 +1,37 @@ +#!/bin/bash + +# 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. +#-------------------------------------------------------------------- + +# Utility script for running the new integration tests, since the Maven Review Comment: comment seems incorrect ########## dev/validate-junit5-usage: ########## @@ -0,0 +1,37 @@ +#!/bin/bash + +# 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. +#-------------------------------------------------------------------- + +# Utility script for running the new integration tests, since the Maven +# commands are unwieldy. Allows straightforward usage of ITs on the desktop +# and in various build scripts. Handles configuration of various kinds. + +set -e + +git grep junit-jupiter-engine '**/pom.xml' | cut -d: -f1 | while read pom ;do + + m=`dirname $pom` + hasj4=`git grep org.junit.Test $m | head -n 1 | wc -l` + hasVintage=`git grep junit-vintage-engine $m|head -n 1 | wc -l` + + echo "$m hasj4:$hasj4 hasVintage:$hasVintage" + + if [ "$hasVintage" != "$hasj4" ];then + echo "Module [$m] either needs tests upgraded to junit5 or the vintage engine!" Review Comment: would be helpful to extend this error message to include details about the problem and how to fix it, i.e. to say something like: ``` Module[$m] uses both JUnit4 and JUnit5. It needs the junit-vintage-engine to ensure that JUnit4 tests run properly. Add this to the pom (or migrate all tests to JUnit 5): <dependency> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> <scope>test</scope> </dependency> ``` ########## services/src/test/java/org/apache/druid/cli/CliPeonTest.java: ########## @@ -67,6 +70,17 @@ public class CliPeonTest { + @BeforeClass + public static void beforeClass() Review Comment: I'm confused about why this is needed or how it helps; the `RuntimeInfoModule` should only be active during embedded tests, and this is not an embedded test. Seems like something is wrong somewhere if this module is getting loaded outside embedded tests. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
