roryqi commented on code in PR #14331:
URL: https://github.com/apache/gravitino/pull/14331#discussion_r4420236342


##########
iceberg/iceberg-rest-server/build.gradle.kts:
##########
@@ -269,44 +200,35 @@ tasks {
   }
 }
 
-val experimentalTest by tasks.registering(Test::class) {
-  description = "Runs Iceberg REST tests that require the experimental Iceberg 
runtime"
-  group = "verification"
-  testClassesDirs = sourceSets.test.get().output.classesDirs
-  classpath =
-    sourceSets.main.get().output +
-    sourceSets.test.get().output +
-    experimentalTestRuntimeClasspath
-  systemProperty("datastratoIcebergGitCommit", datastratoIcebergGitCommit)
-  systemProperty("spark.ui.enabled", "false")
-  setIncludes(
-    setOf(
-      "**/IcebergExperimentalAuthorizationIT.class",
-      "**/IcebergReadRestrictionIT.class"
-    )
-  )
-  filter {
-    includeTestsMatching(
-      
"org.apache.gravitino.iceberg.integration.test.IcebergExperimentalAuthorizationIT"
-    )
-    includeTestsMatching(
-      "org.apache.gravitino.iceberg.integration.test.IcebergReadRestrictionIT"
+// Share the authorization IT harness with the experimental service module.
+val testJar by tasks.registering(Jar::class) {
+  archiveClassifier.set("tests")
+  from(sourceSets.test.get().output) {
+    include(
+      
"org/apache/gravitino/iceberg/integration/test/IcebergAuthorizationIT*.class",
+      
"org/apache/gravitino/iceberg/integration/test/IcebergTableAuthorizationIT*.class"
     )
   }
-  mustRunAfter(tasks.test)
-  dependsOn(
-    tasks.testClasses,
-    tasks.jar,
-    ":catalogs:catalog-lakehouse-iceberg:jar",
-    ":iceberg:iceberg-rest-server-experiment:copyDepends",
-    ":iceberg:iceberg-rest-server-experiment:jar"
-  )
+}
+
+configurations.create("testArtifacts") {
+  isCanBeResolved = false
+  extendsFrom(configurations.testRuntimeClasspath.get())

Review Comment:
   Addressed in `96ed8ed8c8`. Removed the testRuntimeClasspath inheritance from 
testArtifacts. Both Spark IT suites now use a separate experimentalTest source 
set in the experiment module, with explicit harness, Spark/Iceberg, JDBC, and 
container dependencies. The default Jackson pins are unconditional again; only 
the two dedicated Spark IT classpaths use Spark-compatible versions. Verified 
that production and ordinary test compile/runtime classpaths contain no Spark 
and resolve jackson-databind 2.15.2; all 68 ordinary unit tests pass.



##########
iceberg/iceberg-rest-server-experiment/src/test/java/org/apache/gravitino/server/authentication/ReadRestrictionGroupAuthenticator.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+package org.apache.gravitino.server.authentication;
+
+import java.security.Principal;
+import java.util.Collections;
+import java.util.Optional;
+import org.apache.gravitino.UserGroup;
+import org.apache.gravitino.UserPrincipal;
+
+/** Supplies a group-bearing principal for Iceberg read-restriction 
integration tests. */
+public class ReadRestrictionGroupAuthenticator extends SimpleAuthenticator {

Review Comment:
   Addressed in `96ed8ed8c8`. The fixture now implements the public 
Authenticator interface directly in 
org.apache.gravitino.iceberg.integration.test.auth, under a dedicated 
testFixtures source set. It no longer extends SimpleAuthenticator or shares its 
package. Added 14 unit test executions covering group membership, other users, 
original-token preservation, supported token types, and malformed/missing Basic 
credentials. The deploy server still receives only the small authenticator 
fixture JAR.



##########
iceberg/iceberg-rest-server/build.gradle.kts:
##########
@@ -269,44 +200,35 @@ tasks {
   }
 }
 
-val experimentalTest by tasks.registering(Test::class) {
-  description = "Runs Iceberg REST tests that require the experimental Iceberg 
runtime"
-  group = "verification"
-  testClassesDirs = sourceSets.test.get().output.classesDirs
-  classpath =
-    sourceSets.main.get().output +
-    sourceSets.test.get().output +
-    experimentalTestRuntimeClasspath
-  systemProperty("datastratoIcebergGitCommit", datastratoIcebergGitCommit)
-  systemProperty("spark.ui.enabled", "false")
-  setIncludes(
-    setOf(
-      "**/IcebergExperimentalAuthorizationIT.class",
-      "**/IcebergReadRestrictionIT.class"
-    )
-  )
-  filter {
-    includeTestsMatching(
-      
"org.apache.gravitino.iceberg.integration.test.IcebergExperimentalAuthorizationIT"
-    )
-    includeTestsMatching(
-      "org.apache.gravitino.iceberg.integration.test.IcebergReadRestrictionIT"
+// Share the authorization IT harness with the experimental service module.
+val testJar by tasks.registering(Jar::class) {
+  archiveClassifier.set("tests")
+  from(sourceSets.test.get().output) {
+    include(
+      
"org/apache/gravitino/iceberg/integration/test/IcebergAuthorizationIT*.class",

Review Comment:
   Addressed in `96ed8ed8c8`. The shared harness JAR now includes the full test 
output, and the duplicated experiment log4j2.properties is removed. I also 
found that the root build excludes log4j2.properties and test/** from every 
JAR, so this test JAR explicitly clears those production exclusions to retain 
its test resources.



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