This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-9383-1f0bb4d495048570fcb620c516ee705bf1f987ee in repository https://gitbox.apache.org/repos/asf/texera.git
commit 7b1033b85799ddd3a65485bb895f4bf08429d999 Author: Xinyuan Lin <[email protected]> AuthorDate: Mon Nov 9 10:29:26 2026 +0000 test(amber): remove obsolete fixtures and scenarios (#9383) ### What changes were proposed in this PR? Remove unused coordinator implicit setup and obsolete commented scenarios, unread dataset resource fixtures, and unused Iceberg schema-conversion fields and callbacks. **+0/−334 lines.** Every executable case, live schema, dataset insert, cleanup query, document operation, and catalog spy is retained. The removed bindings have no consumers in their suites; the coordinator scenarios were already comments. There is no behavior change. ### Any related issues, documentation, discussions? Closes #9378. ### How was this PR tested? With Java 17 and a PostgreSQL Iceberg catalog: ``` sbt -java-home C:/Users/linxi/.jdks/jbr-17.0.14 "WorkflowExecutionService/scalafmtCheckAll" "WorkflowExecutionService/scalafixAll --check" sbt -java-home C:/Users/linxi/.jdks/jbr-17.0.14 "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.coordinator.CoordinatorSpec org.apache.texera.web.resource.dashboard.file.DatasetResourceSpec org.apache.texera.amber.storage.result.iceberg.IcebergDocumentSpec org.apache.texera.amber.storage.result.iceberg.IcebergTableStatsSpec -- -oD" ``` 31 tests passed with the same case identities and outcomes. The dataset cases use embedded PostgreSQL; Iceberg uses an isolated local catalog database. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-6) --- .../result/iceberg/IcebergDocumentSpec.scala | 14 - .../result/iceberg/IcebergTableStatsSpec.scala | 15 -- .../architecture/coordinator/CoordinatorSpec.scala | 290 --------------------- .../dashboard/file/DatasetResourceSpec.scala | 15 -- 4 files changed, 334 deletions(-) diff --git a/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentSpec.scala b/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentSpec.scala index fa5e84e4c9..621e57bf3e 100644 --- a/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentSpec.scala +++ b/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentSpec.scala @@ -32,10 +32,7 @@ import org.apache.texera.amber.core.virtualidentity.{ } import org.apache.texera.amber.core.workflow.{GlobalPortIdentity, PortIdentity} import org.apache.texera.amber.tags.IntegrationTest -import org.apache.texera.amber.util.IcebergUtil import org.apache.iceberg.catalog.Catalog -import org.apache.iceberg.data.Record -import org.apache.iceberg.{Schema => IcebergSchema} import org.scalatest.BeforeAndAfterAll import java.lang.reflect.{InvocationHandler, InvocationTargetException, Method, Proxy} @@ -48,11 +45,6 @@ import java.util.concurrent.atomic.AtomicInteger class IcebergDocumentSpec extends VirtualDocumentSpec[Tuple] with BeforeAndAfterAll { var amberSchema: Schema = _ - var icebergSchema: IcebergSchema = _ - var serde: (IcebergSchema, Tuple) => Record = _ - var deserde: (IcebergSchema, Record) => Tuple = _ - var catalog: Catalog = _ - val tableNamespace = "test_namespace" var baseURI: URI = _ var uri: URI = _ @@ -72,12 +64,6 @@ class IcebergDocumentSpec extends VirtualDocumentSpec[Tuple] with BeforeAndAfter ) ) - // Initialize Iceberg Schema - icebergSchema = IcebergUtil.toIcebergSchema(amberSchema) - - // Initialize serialization and deserialization functions - serde = IcebergUtil.toGenericRecord - deserde = (schema, record) => IcebergUtil.fromRecord(record, amberSchema) } override def beforeEach(): Unit = { diff --git a/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergTableStatsSpec.scala b/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergTableStatsSpec.scala index 868574abb9..6069040faf 100644 --- a/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergTableStatsSpec.scala +++ b/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergTableStatsSpec.scala @@ -30,10 +30,6 @@ import org.apache.texera.amber.core.virtualidentity.{ } import org.apache.texera.amber.core.workflow.{GlobalPortIdentity, PortIdentity} import org.apache.texera.amber.tags.IntegrationTest -import org.apache.texera.amber.util.IcebergUtil -import org.apache.iceberg.catalog.Catalog -import org.apache.iceberg.data.Record -import org.apache.iceberg.{Schema => IcebergSchema} import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.{BeforeAndAfterAll, Suite} @@ -47,11 +43,6 @@ import java.util.UUID class IcebergTableStatsSpec extends AnyFlatSpec with BeforeAndAfterAll with Suite { var amberSchema: Schema = _ - var icebergSchema: IcebergSchema = _ - var serde: (IcebergSchema, Tuple) => Record = _ - var deserde: (IcebergSchema, Record) => Tuple = _ - var catalog: Catalog = _ - val tableNamespace = "test_namespace" var uri: URI = VFSURIFactory.resultURI( VFSURIFactory.createPortBaseURI( WorkflowIdentity(0), @@ -83,12 +74,6 @@ class IcebergTableStatsSpec extends AnyFlatSpec with BeforeAndAfterAll with Suit ) ) - // Initialize Iceberg Schema - icebergSchema = IcebergUtil.toIcebergSchema(amberSchema) - - // Initialize serialization and deserialization functions - serde = IcebergUtil.toGenericRecord - deserde = (schema, record) => IcebergUtil.fromRecord(record, amberSchema) } behavior of "TableStatistics" diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/CoordinatorSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/CoordinatorSpec.scala index 6392a90cbb..51f7580fa8 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/CoordinatorSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/coordinator/CoordinatorSpec.scala @@ -21,7 +21,6 @@ package org.apache.texera.amber.engine.architecture.coordinator import org.apache.pekko.actor.{Actor, ActorSystem, Props} import org.apache.pekko.testkit.{ImplicitSender, TestActorRef, TestKit, TestProbe} -import org.apache.pekko.util.Timeout import org.apache.texera.amber.clustering.SingleNodeListener import org.apache.texera.amber.core.virtualidentity.{ ActorVirtualIdentity, @@ -46,7 +45,6 @@ import org.scalatest.BeforeAndAfterAll import org.scalatest.flatspec.AnyFlatSpecLike import java.net.URI -import scala.concurrent.ExecutionContextExecutor import scala.concurrent.duration._ /** @@ -79,9 +77,6 @@ class CoordinatorSpec with AnyFlatSpecLike with BeforeAndAfterAll { - implicit val timeout: Timeout = Timeout(5.seconds) - implicit val executionContext: ExecutionContextExecutor = system.dispatcher - override def beforeAll(): Unit = { system.actorOf(Props[SingleNodeListener](), "cluster-info") } @@ -278,289 +273,4 @@ class CoordinatorSpec } } - // private val logicalPlan1 = - // """{ - // |"operators":[ - // |{"tableName":"D:\\large_input.csv","operatorId":"Scan","operatorType":"LocalScanSource","delimiter":","}, - // |{"attributeName":0,"keyword":"Asia","operatorId":"KeywordSearch","operatorType":"KeywordMatcher"}, - // |{"operatorId":"Count","operatorType":"Aggregation"}, - // |{"operatorId":"Sink","operatorType":"Sink"}], - // |"links":[ - // |{"origin":"Scan","destination":"KeywordSearch"}, - // |{"origin":"KeywordSearch","destination":"Count"}, - // |{"origin":"Count","destination":"Sink"}] - // |}""".stripMargin - // - // private val logicalPlan2 = - // """{ - // |"operators":[ - // |{"tableName":"D:\\large_input.csv","operatorId":"Scan","operatorType":"LocalScanSource","delimiter":","}, - // |{"operatorId":"Count","operatorType":"Aggregation"}, - // |{"operatorId":"Sink","operatorType":"Sink"}], - // |"links":[ - // |{"origin":"Scan","destination":"Count"}, - // |{"origin":"Count","destination":"Sink"}] - // |}""".stripMargin - // - // private val logicalPlan3 = - // """{ - // |"operators":[ - // |{"tableName":"D:\\test.txt","operatorId":"Scan","operatorType":"LocalScanSource","delimiter":"|"}, - // |{"attributeName":15,"keyword":"package","operatorId":"KeywordSearch","operatorType":"KeywordMatcher"}, - // |{"operatorId":"Count","operatorType":"Aggregation"}, - // |{"operatorId":"Sink","operatorType":"Sink"}], - // |"links":[ - // |{"origin":"Scan","destination":"KeywordSearch"}, - // |{"origin":"KeywordSearch","destination":"Count"}, - // |{"origin":"Count","destination":"Sink"}] - // |}""".stripMargin - // - // private val logicalPlan4 = - // """{ - // |"operators":[ - // |{"tableName":"D:\\test.txt","operatorId":"Scan1","operatorType":"LocalScanSource","delimiter":"|","indicesToKeep":null}, - // |{"tableName":"D:\\test.txt","operatorId":"Scan2","operatorType":"LocalScanSource","delimiter":"|","indicesToKeep":null}, - // |{"attributeName":15,"keyword":"package","operatorId":"KeywordSearch","operatorType":"KeywordMatcher"}, - // |{"operatorId":"Join","operatorType":"HashJoin","innerTableIndex":0,"outerTableIndex":0}, - // |{"operatorId":"Count","operatorType":"Aggregation"}, - // |{"operatorId":"Sink","operatorType":"Sink"}], - // |"links":[ - // |{"origin":"Scan1","destination":"KeywordSearch"}, - // |{"origin":"KeywordSearch","destination":"Join"}, - // |{"origin":"Scan2","destination":"Join"}, - // |{"origin":"Join","destination":"Count"}, - // |{"origin":"Count","destination":"Sink"}] - // |}""".stripMargin - // - // "A coordinator" should "be able to set and trigger count breakpoint in the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! PassBreakpointTo("KeywordSearch", new CountGlobalBreakpoint("break1", 100000)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // var isCompleted = false - // parent.receiveWhile(30.seconds, 10.seconds) { - // case ReportState(CoordinatorState.Paused) => - // coordinator ! Resume - // case ReportState(CoordinatorState.Completed) => - // isCompleted = true - // case _ => - // } - // assert(isCompleted) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "execute the workflow1 normally" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // parent.expectMsg(1.minute, ReportState(CoordinatorState.Completed)) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "execute the workflow3 normally" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan3)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // parent.expectMsg(1.minute, ReportState(CoordinatorState.Completed)) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "execute the workflow2 normally" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan2)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(ReportState(CoordinatorState.Ready)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // parent.expectMsg(1.minute, ReportState(CoordinatorState.Completed)) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "be able to pause/resume the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(ReportState(CoordinatorState.Ready)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // coordinator ! Pause - // parent.expectMsg(ReportState(CoordinatorState.Pausing)) - // parent.expectMsg(ReportState(CoordinatorState.Paused)) - // coordinator ! Resume - // parent.expectMsg(ReportState(CoordinatorState.Resuming)) - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // coordinator ! Pause - // parent.expectMsg(ReportState(CoordinatorState.Pausing)) - // parent.expectMsg(ReportState(CoordinatorState.Paused)) - // coordinator ! Resume - // parent.expectMsg(ReportState(CoordinatorState.Resuming)) - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // coordinator ! Pause - // parent.expectMsg(ReportState(CoordinatorState.Pausing)) - // parent.expectMsg(ReportState(CoordinatorState.Paused)) - // coordinator ! Resume - // parent.expectMsg(ReportState(CoordinatorState.Resuming)) - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // coordinator ! Pause - // parent.expectMsg(ReportState(CoordinatorState.Pausing)) - // parent.expectMsg(ReportState(CoordinatorState.Paused)) - // coordinator ! Resume - // parent.expectMsg(ReportState(CoordinatorState.Resuming)) - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // parent.expectMsg(1.minute, ReportState(CoordinatorState.Completed)) - // parent.ref ! PoisonPill - // } - - // "A coordinator" should "be able to modify the logic after pausing the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // Thread.sleep(300) - // coordinator ! Pause - // parent.expectMsg(ReportState(CoordinatorState.Pausing)) - // parent.expectMsg(ReportState(CoordinatorState.Paused)) - // coordinator ! ModifyLogic( - // new KeywordSearchMetadata( - // OperatorTag("sample", "KeywordSearch"), - // Constants.currentWorkerNum, - // 0, - // "asia" - // ) - // ) - // parent.expectMsg(Ack) - // Thread.sleep(10000) - // coordinator ! Resume - // parent.expectMsg(ReportState(CoordinatorState.Resuming)) - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // parent.expectMsg(1.minute, ReportState(CoordinatorState.Completed)) - // parent.ref ! PoisonPill - // } - - // "A coordinator" should "be able to set and trigger conditional breakpoint in the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! PassBreakpointTo( - // "KeywordSearch", - // new ConditionalGlobalBreakpoint("break2", x => x.getString(8).toInt == 9884) - // ) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // var isCompleted = false - // parent.receiveWhile(30.seconds, 10.seconds) { - // case ReportState(CoordinatorState.Paused) => - // coordinator ! Resume - // case ReportState(CoordinatorState.Completed) => - // isCompleted = true - // case _ => - // } - // assert(isCompleted) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "be able to set and trigger count breakpoint on complete in the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! PassBreakpointTo("KeywordSearch", new CountGlobalBreakpoint("break1", 146017)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // var isCompleted = false - // parent.receiveWhile(30.seconds, 10.seconds) { - // case ReportState(CoordinatorState.Paused) => - // coordinator ! Resume - // case ReportState(CoordinatorState.Completed) => - // isCompleted = true - // case _ => - // } - // assert(isCompleted) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "be able to pause/resume with conditional breakpoint in the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! PassBreakpointTo( - // "KeywordSearch", - // new ConditionalGlobalBreakpoint("break2", x => x.getString(8).toInt == 9884) - // ) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // val random = new Random() - // for (i <- 0 until 100) { - // if (random.nextBoolean()) { - // coordinator ! Pause - // } else { - // coordinator ! Resume - // } - // } - // coordinator ! Resume - // var isCompleted = false - // parent.receiveWhile(30.seconds, 10.seconds) { - // case ReportState(CoordinatorState.Paused) => - // coordinator ! Resume - // case ReportState(CoordinatorState.Completed) => - // isCompleted = true - // case _ => - // } - // assert(isCompleted) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "be able to pause/resume with count breakpoint in the workflow1" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan1)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(30.seconds, ReportState(CoordinatorState.Ready)) - // coordinator ! PassBreakpointTo("KeywordSearch", new CountGlobalBreakpoint("break1", 100000)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // val random = new Random() - // for (i <- 0 until 100) { - // if (random.nextBoolean()) { - // coordinator ! Pause - // } else { - // coordinator ! Resume - // } - // } - // coordinator ! Resume - // var isCompleted = false - // parent.receiveWhile(30.seconds, 10.seconds) { - // case ReportState(CoordinatorState.Paused) => - // coordinator ! Resume - // case ReportState(CoordinatorState.Completed) => - // isCompleted = true - // case _ => - // } - // assert(isCompleted) - // parent.ref ! PoisonPill - // } - // - // "A coordinator" should "execute the workflow4 normally" in { - // val parent = TestProbe() - // val coordinator = parent.childActorOf(COORDINATOR.props(logicalPlan4)) - // coordinator ! AckedCoordinatorInitialization - // parent.expectMsg(ReportState(CoordinatorState.Ready)) - // coordinator ! Start - // parent.expectMsg(ReportState(CoordinatorState.Running)) - // parent.expectMsg(1.minute, ReportState(CoordinatorState.Completed)) - // parent.ref ! PoisonPill - // } - } diff --git a/amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/DatasetResourceSpec.scala b/amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/DatasetResourceSpec.scala index 7e58489556..5bcbbe2b27 100644 --- a/amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/DatasetResourceSpec.scala +++ b/amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/DatasetResourceSpec.scala @@ -19,12 +19,10 @@ package org.apache.texera.web.resource.dashboard.file -import org.apache.texera.auth.SessionUser import org.apache.texera.dao.MockTexeraDB import org.apache.texera.dao.jooq.generated.enums.UserRoleEnum import org.apache.texera.dao.jooq.generated.tables.pojos.User import org.apache.texera.web.resource.dashboard.DashboardResource.SearchQueryParams -import org.apache.texera.web.resource.dashboard.user.dataset.DatasetResource.DashboardDataset import org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilder import org.scalatest.flatspec.AnyFlatSpec import org.apache.texera.dao.jooq.generated.tables.daos.{UserDao, DatasetDao, DatasetUserAccessDao} @@ -75,14 +73,6 @@ class DatasetResourceSpec dataset } - private val sessionUser1: SessionUser = { - new SessionUser(ownerUser) - } - - private val sessionUser2: SessionUser = { - new SessionUser(testUser) - } - // get context lazily private lazy val datasetDao: DatasetDao = { new DatasetDao(getDSLContext.configuration()) @@ -114,7 +104,6 @@ class DatasetResourceSpec override protected def afterEach(): Unit = { // 1. Delete access rows before the dataset - val datasetUserAccessDao = new DatasetUserAccessDao(getDSLContext.configuration()) getDSLContext .deleteFrom(org.apache.texera.dao.jooq.generated.tables.DatasetUserAccess.DATASET_USER_ACCESS) .execute() @@ -129,10 +118,6 @@ class DatasetResourceSpec shutdownDB() } - private def assertSameDataset(a: Dataset, b: DashboardDataset): Unit = { - assert(a.getName == b.dataset.getName) - } - "User.accountCreationTime" should "be persisted and retrievable via UserDao" in { val userDao = new UserDao(getDSLContext.configuration()) val u1 = userDao.fetchOneByUid(Integer.valueOf(1))
