Copilot commented on code in PR #6818:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6818#discussion_r3620986514


##########
drools-test-coverage/standalone/kie-ci-with-domain/tests/pom.xml:
##########
@@ -134,4 +134,42 @@
     </plugins>
   </build>
 
+  <profiles>
+    <!-- The tests load test-kjar at runtime from the local Maven repo via 
kie-ci.
+         In a full reactor build the kjar is already installed, but in a 
partial CI
+         build (where only the tests module is in scope) it may be missing.
+         Use maven-invoker-plugin to build and install the sibling modules 
first. -->
+    <profile>
+      <id>missing-test-kjar</id>
+      <activation>
+        <file>
+          <missing>../test-kjar/target/classes/META-INF/kmodule.xml</missing>
+        </file>
+      </activation>

Review Comment:
   The profile activation checks for a build output file in 
../test-kjar/target, but the actual failure mode is the kjar missing from the 
local Maven repository. If test-kjar was previously built (so target/classes 
exists) but not installed into the current local repo (e.g., different 
-Dmaven.repo.local, cleaned repo, or only `package` was run), this profile will 
not activate and the tests can still fail with "Cannot find KieModule".



##########
drools-test-coverage/standalone/kie-ci-without-domain/tests/pom.xml:
##########
@@ -129,4 +129,55 @@
     </plugins>
   </build>
 
+  <profiles>
+    <!-- The tests load test-kjar at runtime from the local Maven repo via 
kie-ci.
+         In a full reactor build the kjar is already installed, but in a 
partial CI
+         build (where only the tests module is in scope) it may be missing.
+         Use maven-invoker-plugin to build and install the sibling modules 
first. -->
+    <profile>
+      <id>missing-test-kjar</id>
+      <activation>
+        <file>
+          <missing>../test-kjar/target/classes/META-INF/kmodule.xml</missing>
+        </file>
+      </activation>

Review Comment:
   The profile activation checks for a build output file in 
../test-kjar/target, but the tests load the kjar from the local Maven 
repository. If test-kjar was built earlier (so the target/classes file exists) 
but the artifact is not installed in the current local repo, this profile will 
not activate and the tests can still fail at runtime with "Cannot find 
KieModule".



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