Yicong-Huang commented on code in PR #4871:
URL: https://github.com/apache/texera/pull/4871#discussion_r3178755319


##########
.github/labeler.yml:
##########
@@ -45,15 +45,47 @@ agent-service:
           - 'agent-service/**'
 
 engine:
+  # Non-Python, non-integration parts of amber/. Pure Python changes
+  # under amber/src/main/python/** intentionally fall through to the
+  # `python` label (which the labeler also matches via **/*.py), so
+  # they only trigger the python + amber-integration stacks rather
+  # than the full Scala-only `amber` stack. Integration specs live
+  # under amber/src/test/integration/** (added to sbt's Test sources
+  # via amber/build.sbt) and are caught by the `amber-integration`
+  # label below.
   - changed-files:
       - any-glob-to-any-file:
-          - 'amber/**'
+          - 'amber/build.sbt'
+          - 'amber/project/**'
+          - 'amber/src/main/scala/**'
+          - 'amber/src/main/java/**'
+          - 'amber/src/main/protobuf/**'
+          - 'amber/src/main/resources/**'
+          - 'amber/src/test/scala/**'
+          - 'amber/src/test/java/**'
+
+amber-integration:
+  # Scala specs that exercise both Scala and Python end-to-end. They
+  # live under amber/src/test/integration/scala/** (sbt's Test config
+  # picks them up via amber/build.sbt) and are tagged

Review Comment:
   Fixed in 0c187fa56c: the comment under `amber-integration` now describes the 
real layout — specs live under `amber/src/test/integration/**` (no `scala/` 
subdir) and sbt picks them up via `Test/unmanagedSourceDirectories` in 
`amber/build.sbt`.



##########
amber/src/test/integration/org/apache/texera/amber/engine/e2e/ReconfigurationIntegrationSpec.scala:
##########
@@ -0,0 +1,291 @@
+/*
+ * 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.texera.amber.engine.e2e
+
+import com.twitter.util.{Await, Duration, Promise}
+import com.typesafe.scalalogging.Logger
+import org.apache.pekko.actor.{ActorSystem, Props}
+import org.apache.pekko.testkit.{ImplicitSender, TestKit}
+import org.apache.pekko.util.Timeout
+import org.apache.texera.amber.clustering.SingleNodeListener
+import org.apache.texera.amber.core.executor.{OpExecInitInfo, OpExecWithCode}
+import org.apache.texera.amber.core.storage.DocumentFactory
+import org.apache.texera.amber.core.storage.model.VirtualDocument
+import org.apache.texera.amber.core.tuple.Tuple
+import org.apache.texera.amber.core.virtualidentity.OperatorIdentity
+import org.apache.texera.amber.core.workflow.{PortIdentity, WorkflowContext}
+import org.apache.texera.amber.engine.architecture.controller.{
+  ControllerConfig,
+  ExecutionStateUpdate
+}
+import org.apache.texera.amber.engine.architecture.rpc.controlcommands.{
+  EmptyRequest,
+  UpdateExecutorRequest,
+  WorkflowReconfigureRequest
+}
+import 
org.apache.texera.amber.engine.architecture.rpc.controlreturns.WorkflowAggregatedState.{
+  COMPLETED,
+  PAUSED
+}
+import org.apache.texera.amber.engine.common.AmberRuntime
+import org.apache.texera.amber.engine.common.client.AmberClient
+import org.apache.texera.amber.engine.e2e.TestUtils.{
+  cleanupWorkflowExecutionData,
+  initiateTexeraDBForTestCases,
+  setUpWorkflowExecutionData,
+  stateReached
+}
+import org.apache.texera.amber.operator.{LogicalOp, TestOperators}
+import org.apache.texera.amber.tags.IntegrationTest
+import 
org.apache.texera.web.resource.dashboard.user.workflow.WorkflowExecutionsResource.getResultUriByLogicalPortId
+import org.apache.texera.workflow.LogicalLink
+import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, Outcome, Retries}
+import org.scalatest.flatspec.AnyFlatSpecLike
+
+import scala.concurrent.duration._
+
+/**
+  * E2E reconfiguration tests that spawn Python UDF workers. Routed to the
+  * `amber-integration` CI job via the class-level `@IntegrationTest` tag,
+  * which provisions Python deps; the lighter `amber` job excludes this tag.
+  *
+  * Pure-Scala reconfiguration tests live in [[ReconfigurationSpec]] and run
+  * in the regular `amber` job.
+  */
+@IntegrationTest
+class ReconfigurationIntegrationSpec
+    extends TestKit(ActorSystem("ReconfigurationIntegrationSpec", 
AmberRuntime.akkaConfig))
+    with ImplicitSender
+    with AnyFlatSpecLike
+    with BeforeAndAfterAll
+    with BeforeAndAfterEach
+    with Retries {
+
+  /**
+    * This block retries each test once if it fails.
+    * In the CI environment, there is a chance that executeWorkflow does not 
receive "COMPLETED" status.
+    * Until we find the root cause of this issue, we use a retry mechanism 
here to stabilize CI runs.
+    */
+  override def withFixture(test: NoArgTest): Outcome =
+    withRetry { super.withFixture(test) }
+
+  implicit val timeout: Timeout = Timeout(5.seconds)
+
+  val logger = Logger("ReconfigurationIntegrationSpecLogger")
+  val ctx = new WorkflowContext()
+
+  override protected def beforeEach(): Unit = {
+    setUpWorkflowExecutionData()
+  }
+
+  override protected def afterEach(): Unit = {
+    cleanupWorkflowExecutionData()
+  }
+
+  override def beforeAll(): Unit = {
+    system.actorOf(Props[SingleNodeListener](), "cluster-info")
+    // These test cases access postgres in CI, but occasionally the jdbc 
driver cannot be found during CI run.
+    // Explicitly load the JDBC driver to avoid flaky CI failures.
+    Class.forName("org.postgresql.Driver")
+    initiateTexeraDBForTestCases()
+  }
+
+  override def afterAll(): Unit = {
+    TestKit.shutdownActorSystem(system)
+  }
+
+  def shouldReconfigure(
+      operators: List[LogicalOp],
+      links: List[LogicalLink],
+      targetOps: Seq[LogicalOp],
+      newOpExecInitInfo: OpExecInitInfo
+  ): Map[OperatorIdentity, List[Tuple]] = {
+    val workflow =

Review Comment:
   Extracted in 0c187fa56c: the workflow-driver body moved into 
`TestUtils.shouldReconfigure(system, ctx, ...)`, and both `ReconfigurationSpec` 
and `ReconfigurationIntegrationSpec` are now thin wrappers that pass their own 
`system`/`ctx` through. Future e2e specs can call `TestUtils.shouldReconfigure` 
directly without copy-pasting the helper.



##########
amber/src/test/integration/org/apache/texera/amber/tags/IntegrationTest.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.texera.amber.tags;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.scalatest.TagAnnotation;
+
+/**
+ * Class-level marker tag for ScalaTest specs that exercise both Scala
+ * and Python end-to-end. Routing to the {@code amber-integration} CI
+ * job is path-based (specs live under {@code amber/src/test/integration})
+ * via a dedicated {@code IntegrationTest} sbt configuration; this
+ * annotation is kept for IDE / reader clarity and so a future ScalaTest
+ * tag-filter (e.g. {@code -n org.apache.texera.amber.tags.IntegrationTest})
+ * also works.

Review Comment:
   Rewritten in 0c187fa56c: the Javadoc now describes the real mechanism — 
ScalaTest tag filtering driven by `AMBER_TEST_FILTER` in `amber/build.sbt` 
(`skip-integration` → `-l`, `integration-only` → `-n`). The 
`amber/src/test/integration` directory is added to 
`Test/unmanagedSourceDirectories`, no separate sbt configuration.



##########
.github/labeler.yml:
##########
@@ -45,15 +45,47 @@ agent-service:
           - 'agent-service/**'
 
 engine:
+  # Non-Python, non-integration parts of amber/. Pure Python changes
+  # under amber/src/main/python/** intentionally fall through to the
+  # `python` label (which the labeler also matches via **/*.py), so
+  # they only trigger the python + amber-integration stacks rather
+  # than the full Scala-only `amber` stack. Integration specs live
+  # under amber/src/test/integration/** (added to sbt's Test sources
+  # via amber/build.sbt) and are caught by the `amber-integration`
+  # label below.
   - changed-files:
       - any-glob-to-any-file:
-          - 'amber/**'
+          - 'amber/build.sbt'
+          - 'amber/project/**'
+          - 'amber/src/main/scala/**'
+          - 'amber/src/main/java/**'
+          - 'amber/src/main/protobuf/**'
+          - 'amber/src/main/resources/**'
+          - 'amber/src/test/scala/**'
+          - 'amber/src/test/java/**'
+

Review Comment:
   Fixed in 0c187fa56c: the `engine` matcher now lists `amber/.scalafmt.conf` 
and `amber/.scalafix.conf` explicitly (with a comment explaining why), so a PR 
that touches only the Scala formatter/linter configs still triggers the Scala 
stacks instead of producing an empty stack union.



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