dweiss commented on code in PR #15623:
URL: https://github.com/apache/lucene/pull/15623#discussion_r2779705019


##########
build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/java/TestsAndRandomizationPlugin.java:
##########
@@ -601,4 +632,114 @@ private static boolean addVectorizationOptions(
 
     return defaultVectorizationOption.get();
   }
+
+  public abstract static class LuceneTestFramework implements TestFramework {
+    private final DefaultTestFilter filter;
+    private final Factory<File> testTaskTemporaryDir;
+    private final Provider<Boolean> dryRun;
+    private TestFrameworkDetector detector =
+        new TestFrameworkDetector() {
+          private TestDefinitionProcessor<? super ClassTestDefinition> 
testDefinitionProcessor;
+
+          @Override
+          public void startDetection(
+              TestDefinitionProcessor<? super ClassTestDefinition> 
testDefinitionProcessor) {
+            this.testDefinitionProcessor = testDefinitionProcessor;
+          }
+
+          @Override
+          public boolean processTestClass(RelativeFile testClassFile) {
+            var cc =
+                ClassFile.of(
+                    ClassFile.ConstantPoolSharingOption.NEW_POOL,
+                    ClassFile.DebugElementsOption.DROP_DEBUG,
+                    ClassFile.LineNumbersOption.DROP_LINE_NUMBERS,
+                    ClassFile.StackMapsOption.DROP_STACK_MAPS);
+
+            try {
+              ClassModel parsed = cc.parse(testClassFile.getFile().toPath());
+              String internalName = 
parsed.thisClass().asInternalName().replace('/', '.');

Review Comment:
   Yeah... I checked the test count in each project before and after this 
change and they align, so I don't think we miss anything. I agree this code 
isn't too elegant but it works fine (for us). We can remove it entirely if 
gradle's bug is fixed, eventually.



-- 
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]

Reply via email to