Copilot commented on code in PR #13560:
URL: https://github.com/apache/gluten/pull/13560#discussion_r4542920881
##########
gluten-arrow/pom.xml:
##########
@@ -278,4 +278,47 @@
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
</build>
+ <profiles>
+ <profile>
+ <id>exclude-jni-test</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes combine.children="append">
+ <!-- The jni-test profile requires the separately built native
test bridge. -->
+ <exclude>**/JavaExceptionJniTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
Review Comment:
`activeByDefault` profiles are only active when *no* other profiles are
explicitly enabled. In this repo it’s common to run tests with explicit
profiles (e.g., `-Pspark-3.5`, `-Pbackends-velox`, `-Pjava-17`), which would
disable `exclude-jni-test` and unintentionally run
`JavaExceptionJniTest`—likely failing with `UnsatisfiedLinkError` when the test
bridge isn’t built. To ensure JNI tests are excluded unless `-Pjni-test` is
set, move the surefire exclusion to the module’s default surefire configuration
(outside profiles), and in the `jni-test` profile explicitly override/clear
that exclusion (e.g., override `excludes` / use `combine.self=\"override\"`),
or switch the JNI test to a naming pattern that is excluded by default and only
included by the `jni-test` profile.
##########
.github/workflows/velox_backend_x86.yml:
##########
@@ -1061,7 +1064,9 @@ jobs:
cpp-test-udf-test:
needs: detect-changes
- if: needs.detect-changes.outputs.cpp == 'true'
+ if: >-
+ needs.detect-changes.outputs.cpp == 'true' ||
+ needs.detect-changes.outputs.jni_test == 'true'
Review Comment:
The `jni_test` change detector matches `pom\\.xml` at the repository root,
which will trigger the heavy `cpp-test-udf-test` job (and native build + JNI
bridge build) for any root POM change—even when the change doesn’t affect JNI
behavior. If the intent is to only run this job when JNI-test wiring or
relevant modules change, consider narrowing the matcher to the relevant POM(s)
only (e.g., `gluten-arrow/pom.xml`, `gluten-core/pom.xml`, and/or
workflow/build scripts), to reduce unnecessary CI load/regressions in PR
turnaround time.
##########
.github/workflows/velox_backend_x86.yml:
##########
@@ -157,6 +159,7 @@ jobs:
echo "cpp=$(match '^(cpp/|ep/build-velox/|dev/)')"
>> $GITHUB_OUTPUT
echo "java=$(match
'^(\.github/workflows/|pom\.xml|backends-velox/|gluten-(uniffle|celeborn|ras|core|substrait|arrow|delta|iceberg|hudi|paimon)/|gluten-ut/(common/|test/|src-iceberg-upstream/|pom\.xml)|package/|build/mvn)')"
>> $GITHUB_OUTPUT
+ echo "jni_test=$(match
'^(\.github/workflows/velox_backend_x86\.yml|pom\.xml|gluten-(arrow|core)/pom\.xml|build/mvn|gluten-arrow/src/test/java/org/apache/gluten/jni/.*|gluten-arrow/src/main/java/org/apache/gluten/exception/JniExceptionDescriber\.java|gluten-core/src/main/java/org/apache/gluten/exception/GlutenException\.java)$')"
>> $GITHUB_OUTPUT
Review Comment:
The `jni_test` change detector matches `pom\\.xml` at the repository root,
which will trigger the heavy `cpp-test-udf-test` job (and native build + JNI
bridge build) for any root POM change—even when the change doesn’t affect JNI
behavior. If the intent is to only run this job when JNI-test wiring or
relevant modules change, consider narrowing the matcher to the relevant POM(s)
only (e.g., `gluten-arrow/pom.xml`, `gluten-core/pom.xml`, and/or
workflow/build scripts), to reduce unnecessary CI load/regressions in PR
turnaround time.
--
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]