kunwp1 commented on code in PR #9597:
URL: https://github.com/apache/texera/pull/9597#discussion_r4659658799
##########
amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/NetworkInputGatewaySpec.scala:
##########
@@ -22,10 +22,9 @@ package
org.apache.texera.amber.engine.architecture.messaginglayer
import org.apache.texera.amber.core.tuple.{AttributeType, Schema, TupleLike}
import org.apache.texera.amber.core.virtualidentity.{ActorVirtualIdentity,
ChannelIdentity}
import org.apache.texera.amber.engine.common.ambermessage.{DataFrame,
WorkflowFIFOMessage}
-import org.scalamock.scalatest.MockFactory
import org.scalatest.flatspec.AnyFlatSpec
-class NetworkInputGatewaySpec extends AnyFlatSpec with MockFactory {
+class NetworkInputGatewaySpec extends AnyFlatSpec {
Review Comment:
The same sweep has a few more hits these modules still carry, if you want
them in this PR:
- `MockFactory` with no mocks: `CostBasedScheduleGeneratorSpec`,
`RangeBasedShuffleSpec`.
- `BeforeAndAfterEach` with no `beforeEach`/`afterEach`:
`BatchSizePropagationSpec`, `DataProcessorSpec`, `TrivialControlSpec`.
- `BeforeAndAfterAll` with no hooks: `DefaultCostEstimatorSpec`.
- `BeforeAndAfter` with no `before`/`after` blocks:
`KeywordSearchOpExecSpec`, `SpecializedFilterOpExecSpec`,
`ProjectionOpExecSpec` (workflow-operator).
`LoggingSpec` and `ReplaySpec` also mix in `BeforeAndAfterAll` with no
hooks, but there the hook is what's missing. They're the only `TestKit` specs
that never call `TestKit.shutdownActorSystem(system)` in `afterAll`, so their
actor systems outlive the suite. Better to add the shutdown than to drop the
mixin.
##########
common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryInputStreamSpec.scala:
##########
@@ -21,18 +21,14 @@ package org.apache.texera.service.util
import org.apache.texera.amber.core.tuple.LargeBinary
import org.apache.texera.common.tags.NonParallelTest
-import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach}
+import org.scalatest.BeforeAndAfterAll
import org.scalatest.funsuite.AnyFunSuite
import java.io.{ByteArrayInputStream, IOException}
import scala.util.Random
@NonParallelTest
-class LargeBinaryInputStreamSpec
- extends AnyFunSuite
- with S3StorageTestBase
- with BeforeAndAfterAll
- with BeforeAndAfterEach {
+class LargeBinaryInputStreamSpec extends AnyFunSuite with S3StorageTestBase
with BeforeAndAfterAll {
Review Comment:
`S3StorageTestBase` already extends `BeforeAndAfterAll`, so `with
BeforeAndAfterAll` and its import can go here too, leaving `extends AnyFunSuite
with S3StorageTestBase`. The same applies to `LargeBinaryOutputStreamSpec` and
`S3StorageClientSpec`. The `super.beforeAll()`/`afterAll()` chain is unchanged.
##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/waterfallChart/WaterfallChartOpDescSpec.scala:
##########
@@ -55,8 +55,7 @@ class WaterfallChartOpDescSpec
it should "throw an AssertionError naming the Y Axis when only xColumn is
set" in {
opDesc.xColumn = "x_col"
- val ex =
- expectError[AssertionError]("Y Axis Values cannot be
empty")(opDesc.createPlotlyFigure())
+ expectError[AssertionError]("Y Axis Values cannot be
empty")(opDesc.createPlotlyFigure())
Review Comment:
A few lines up (51-53), `val ex = expectError[AssertionError](...)` is
followed by `ex shouldBe a[AssertionError]`. `expectError` already returns the
intercepted `AssertionError`, so that check can't fail, and the bare call here
does the same job. `ContinuousErrorBandsOpDescSpec:54-55` and
`WindRoseChartOpDescSpec:48-51` have the same pair. The sweep skipped them
because `ex` is technically read.
--
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]