amondel2 commented on code in PR #432:
URL: 
https://github.com/apache/grails-intellij-plugin/pull/432#discussion_r4191401020


##########
plugin/src/main/java/org/apache/grails/intellij/plugin/projectView/impl/Grails3NodeProvider.java:
##########
@@ -36,13 +42,22 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import javax.swing.Icon;
 
 public class Grails3NodeProvider implements GrailsViewNodeProvider {
 
   private static final List<String> SPECIAL_FILES = List.of("build.gradle", 
"settings.gradle", "gradle.properties");
   private static final List<String> SPECIAL_DIRS = List.of("src/main/scripts", 
"src/main/webapp");
 
+  /**
+   * Grails 7 kebab-case test source roots under {@code src/}. The Grails 6 
camelCase roots
+   * ({@code integrationTest}, {@code functionalTest}) deliberately stay 
inside the {@code src} node.
+   */
+  private static final Set<String> TEST_SOURCE_DIRS = Set.of("test", 
"integration-test", "functional-test");

Review Comment:
   Fixed in `e1ad4a0`. The hard-coded name set is gone, so a project's own 
`testPhases { }` phases and `src/integration-test-cli` are lifted out of `src` 
too, and `src` refuses to claim them.
   
   On the route: `ProjectFileIndex.isInTestSourceContent` **does not exist in 
2026.2** — I dumped the interface to check. The real equivalent is 
`getContainingSourceRootType(VirtualFile)` plus 
`JpsModuleSourceRootType.isForTests()`, but that depends on registered source 
roots, which our test fixture doesn't provide, so alone it would have lifted 
nothing in tests — worse than the name list, because it fails silently. 
Discovery therefore combines the index check with a structural rule over 
`src`'s direct children, and the method comment records which route carries 
discovery. `src/main` is never lifted; `src/main/scripts` and `src/main/webapp` 
are unchanged. Covered by 
`testLiftsCustomTestPhaseAndTitlesItFromItsDirectoryName`.
   
   Two consequences I'm recording rather than designing around: every lifted 
root keeps `TESTS_FOLDER` (80), so **two custom phases tie** and their order is 
unspecified, since `GrailsNodeComparator` returns the weight difference without 
reaching the platform comparator — the same pre-existing tie as `SRC_FOLDERS`. 
And the structural rule assumes every non-`main` code-source root is a phase, 
so a non-standard production root would be lifted and labelled `Tests:legacy`; 
gating on the index doesn't help, because Gradle registers the whole content 
root as one `SOURCE` root. Both are in the comment.



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

Reply via email to