From ed2f6a9a295ad6ccc475db88f46eb9e35a221bb5 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 15:49:52 +0000 Subject: [PATCH 01/31] Set scala-3 dialect to Scala 3. --- .scalafmt.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.scalafmt.conf b/.scalafmt.conf index 60771025..a164bdaa 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -31,3 +31,9 @@ project.git = true project.excludeFilters = [ ".*-scala-3.*" ] + +fileOverride { + "glob:**/scala-3/**" { + runner.dialect = scala3 + } +} \ No newline at end of file From 1d8fb1b27927b546479015b2706d1e7986d2cdba Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 16:03:45 +0000 Subject: [PATCH 02/31] Remove unused imports. --- modules/core/shared/src/main/scala-3/weaver/Expect.scala | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/core/shared/src/main/scala-3/weaver/Expect.scala b/modules/core/shared/src/main/scala-3/weaver/Expect.scala index 6aa396a0..dfc9f4bb 100644 --- a/modules/core/shared/src/main/scala-3/weaver/Expect.scala +++ b/modules/core/shared/src/main/scala-3/weaver/Expect.scala @@ -1,8 +1,5 @@ package weaver -import cats.data.{ NonEmptyList, ValidatedNel } -import cats.syntax.all._ - import com.eed3si9n.expecty._ import internals._ From 6cd0eb1c163d5cc6fb0912a91e8d4c688d391b3c Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 16:03:58 +0000 Subject: [PATCH 03/31] Remove unused dummy parameter. --- .../core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala b/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala index f77fcbd9..9b82a6a2 100644 --- a/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala +++ b/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala @@ -7,13 +7,11 @@ import weaver.internals.Reflection import org.junit.runner.Description import org.junit.runner.notification.RunNotifier -class WeaverRunner(cls: Class[_], dummy: Boolean) +class WeaverRunner(cls: Class[_]) extends org.junit.runner.Runner { type F[A] = Any - def this(cls: Class[_]) = this(cls, true) - lazy val suite: RunnableSuite[F] = { Reflection.loadRunnableSuite(cls.getName(), getClass().getClassLoader()) } From f6eccd9f26c4524880c1b72cbc77bb3112a73c01 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 16:51:57 +0000 Subject: [PATCH 04/31] Remove unused code. --- .../shared/src/main/scala/weaver/framework/DogFood.scala | 6 +++--- .../src/main/scala/weaver/framework/Fingerprints.scala | 1 - .../src/main/scala/weaver/framework/WeaverFramework.scala | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/framework/shared/src/main/scala/weaver/framework/DogFood.scala b/modules/framework/shared/src/main/scala/weaver/framework/DogFood.scala index 67ae7d41..6b0ebbca 100644 --- a/modules/framework/shared/src/main/scala/weaver/framework/DogFood.scala +++ b/modules/framework/shared/src/main/scala/weaver/framework/DogFood.scala @@ -38,7 +38,7 @@ abstract class DogFood[F[_]]( for { eventHandler <- effect.delay(new MemoryEventHandler()) logger <- effect.delay(new MemoryLogger()) - _ <- getTasks(suites, logger).use { case (runner, tasks) => + _ <- getTasks(suites).use { case (runner, tasks) => runTasks(runner, eventHandler, logger, maxParallelism)(tasks.toList) } _ <- patience.fold(effect.unit)(framework.unsafeRun.sleep) @@ -71,8 +71,8 @@ abstract class DogFood[F[_]]( } private def getTasks( - suites: Seq[Fingerprinted], - logger: Logger): Resource[F, (WeaverRunner[F], Array[sbt.testing.Task])] = { + suites: Seq[Fingerprinted] + ): Resource[F, (WeaverRunner[F], Array[sbt.testing.Task])] = { val acquire = Sync[F].delay { val cl = PlatformCompat.getClassLoader(this.getClass()) framework.weaverRunner(Array(), Array(), cl, None) diff --git a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala index 29bdf3fd..715dd65b 100644 --- a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala +++ b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala @@ -6,7 +6,6 @@ import scala.reflect.ClassTag import cats.effect.Sync import weaver.internals.Reflection._ -import weaver.{ EffectSuite, GlobalResourceF } import sbt.testing.{ Fingerprint, SubclassFingerprint, TaskDef } diff --git a/modules/framework/shared/src/main/scala/weaver/framework/WeaverFramework.scala b/modules/framework/shared/src/main/scala/weaver/framework/WeaverFramework.scala index 6335ab23..8a940668 100644 --- a/modules/framework/shared/src/main/scala/weaver/framework/WeaverFramework.scala +++ b/modules/framework/shared/src/main/scala/weaver/framework/WeaverFramework.scala @@ -3,8 +3,6 @@ package framework import java.io.PrintStream -import weaver.{ Platform, discard } - import sbt.testing.{ Framework => BaseFramework, Runner => BaseRunner, _ } class WeaverFramework[F[_]]( From 2b4f6aa46d85912b75a2f3284b0a64578f9c83a6 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 16:52:04 +0000 Subject: [PATCH 05/31] Refactor code to remove unreachable case warning. --- modules/framework/jvm/src/main/scala/RunnerCompat.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/framework/jvm/src/main/scala/RunnerCompat.scala b/modules/framework/jvm/src/main/scala/RunnerCompat.scala index 8494d466..c84b8753 100644 --- a/modules/framework/jvm/src/main/scala/RunnerCompat.scala +++ b/modules/framework/jvm/src/main/scala/RunnerCompat.scala @@ -57,9 +57,9 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => val stillRunning = new AtomicInteger(0) val waitForResourcesShutdown = new java.util.concurrent.Semaphore(0) - val tasksAndSuites = taskDefs.toList.map { taskDef => - taskDef -> suiteLoader(taskDef) - }.collect { case (taskDef, Some(suite)) => (taskDef, suite) } + val tasksAndSuites = (taskDefs.toList.mapFilter { taskDef => + suiteLoader(taskDef).map(loader => (taskDef, loader)) + }) def makeTasks( taskDef: TaskDef, From 1a0ff999fd352dc11bda93bae84dd5cd0e98496d Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 16:59:17 +0000 Subject: [PATCH 06/31] Remove unused imports for Scala 3 Test JVM. --- modules/framework-cats/shared/src/test/scala/Meta.scala | 2 +- .../test/scala/weaver/scalacheck/CheckersConcurrencyTest.scala | 3 --- .../shared/src/test/scala/weaver/scalacheck/CheckersTest.scala | 1 - .../src/test/scala/weaver/scalacheck/PropertyDogFoodTest.scala | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/framework-cats/shared/src/test/scala/Meta.scala b/modules/framework-cats/shared/src/test/scala/Meta.scala index e6079933..bbe095df 100644 --- a/modules/framework-cats/shared/src/test/scala/Meta.scala +++ b/modules/framework-cats/shared/src/test/scala/Meta.scala @@ -102,7 +102,7 @@ object Meta { override implicit protected def effectCompat: UnsafeRun[IO] = SetTimeUnsafeRun - loggedTest("erroring with causes") { log => + loggedTest("erroring with causes") { _ => throw CustomException( "surfaced error", CustomException("first cause", diff --git a/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersConcurrencyTest.scala b/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersConcurrencyTest.scala index 663c5144..733ce19c 100644 --- a/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersConcurrencyTest.scala +++ b/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersConcurrencyTest.scala @@ -9,9 +9,6 @@ import scala.concurrent.duration._ import cats.effect.Outcome._ import cats.effect.testkit.TestControl import cats.effect.{ IO, Ref } -import cats.syntax.all._ - -import weaver.TestStatus import org.scalacheck.Gen diff --git a/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersTest.scala b/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersTest.scala index ba6c5f2b..e7d9cb62 100644 --- a/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersTest.scala +++ b/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/CheckersTest.scala @@ -4,7 +4,6 @@ package scalacheck import scala.concurrent.duration._ import cats.effect.IO -import cats.syntax.all._ import org.scalacheck.Gen diff --git a/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/PropertyDogFoodTest.scala b/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/PropertyDogFoodTest.scala index 4715d18d..cf0e5b95 100644 --- a/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/PropertyDogFoodTest.scala +++ b/modules/scalacheck/shared/src/test/scala/weaver/scalacheck/PropertyDogFoodTest.scala @@ -4,7 +4,6 @@ package scalacheck import scala.concurrent.duration._ import cats.effect.{ IO, Resource } -import cats.syntax.all._ import weaver.framework._ From a9f246013ca96c3a82ab4555bea887d2bec44e6d Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:00:26 +0000 Subject: [PATCH 07/31] Remove unused integer from LazyAccessSequential. --- modules/framework-cats/jvm/src/test/scala/MetaJVM.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala b/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala index d21d8dcc..e49e0d2d 100644 --- a/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala +++ b/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala @@ -132,7 +132,7 @@ object MetaJVM { } } - abstract class LazyAccessSequential(global: GlobalRead, index: Int) + abstract class LazyAccessSequential(global: GlobalRead) extends IOSuite { type Res = LazyState def sharedResource: Resource[IO, Res] = { @@ -157,10 +157,10 @@ object MetaJVM { // Using sleeps to force sequential runs of suites class LazyAccessSequential0(global: GlobalRead) - extends LazyAccessSequential(global, 0) + extends LazyAccessSequential(global) class LazyAccessSequential1(global: GlobalRead) - extends LazyAccessSequential(global, 1) + extends LazyAccessSequential(global) class LazyAccessSequential2(global: GlobalRead) - extends LazyAccessSequential(global, 2) + extends LazyAccessSequential(global) } From 62c64c5caf9b8c073247e0abfea76e109620f7d3 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:00:43 +0000 Subject: [PATCH 08/31] Use msg instead of cat for Scala 2/3 warnings. --- modules/framework-cats/shared/src/test/scala/Meta.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/framework-cats/shared/src/test/scala/Meta.scala b/modules/framework-cats/shared/src/test/scala/Meta.scala index bbe095df..7ab883bd 100644 --- a/modules/framework-cats/shared/src/test/scala/Meta.scala +++ b/modules/framework-cats/shared/src/test/scala/Meta.scala @@ -14,7 +14,7 @@ object Meta { object Boom extends Error("Boom") with scala.util.control.NoStackTrace - @nowarn("cat=w-flag-dead-code") + @nowarn("msg=dead code following this construct") object CrashingSuite extends SimpleIOSuite { throw Boom } From e921362d435498432361e0bdc00bdd72fc725e0f Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:06:11 +0000 Subject: [PATCH 09/31] Use recoverWith with partial function. --- modules/framework/jvm/src/main/scala/RunnerCompat.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/framework/jvm/src/main/scala/RunnerCompat.scala b/modules/framework/jvm/src/main/scala/RunnerCompat.scala index c84b8753..f13f4bcc 100644 --- a/modules/framework/jvm/src/main/scala/RunnerCompat.scala +++ b/modules/framework/jvm/src/main/scala/RunnerCompat.scala @@ -240,7 +240,7 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => .productR(broker.send(TestFinished(outcome))), finalizer) } - )).handleErrorWith { case scala.util.control.NonFatal(_) => + )).recoverWith { case scala.util.control.NonFatal(_) => effect.unit // avoid non-fatal errors propagating up } } From b1cd2ec841fede720386632739a5ae7b87374789 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:11:22 +0000 Subject: [PATCH 10/31] Use runner. --- modules/framework/jvm/src/main/scala/DogFoodCompat.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/framework/jvm/src/main/scala/DogFoodCompat.scala b/modules/framework/jvm/src/main/scala/DogFoodCompat.scala index 81f3b81b..c86aaec5 100644 --- a/modules/framework/jvm/src/main/scala/DogFoodCompat.scala +++ b/modules/framework/jvm/src/main/scala/DogFoodCompat.scala @@ -17,7 +17,7 @@ private[weaver] trait DogFoodCompat[F[_]] { self: DogFood[F] => eventHandler: EventHandler, logger: Logger, maxParallelism: Int)(tasks: List[sbt.testing.Task]): F[Unit] = { - + val _ = runner effect.void { @scala.annotation.nowarn("msg=implicit numeric widening") val r = tasks.toVector.parTraverseN[F, Unit](maxParallelism) { task => From 8b8c04534a07a35e3513dff85ae60d94120d0e8c Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:12:31 +0000 Subject: [PATCH 11/31] Add a None case for comprehensive matching. --- .../shared/src/main/scala/weaver/framework/Fingerprints.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala index 715dd65b..535adf8b 100644 --- a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala +++ b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala @@ -58,6 +58,7 @@ abstract class WeaverFingerprints[F[_]](implicit F: Sync[F]) { loadModule(taskDef.fullyQualifiedName(), classLoader) val init = cast(module)(GlobalResourcesInitClass) Some(GlobalResourcesRef(init)) + case _ => None } } From b24746d4a493c00a1824cdf55b14660e17711a52 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:13:29 +0000 Subject: [PATCH 12/31] Remove unused implicit numeric widening annotation. --- modules/framework/jvm/src/main/scala/DogFoodCompat.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/framework/jvm/src/main/scala/DogFoodCompat.scala b/modules/framework/jvm/src/main/scala/DogFoodCompat.scala index c86aaec5..eb864379 100644 --- a/modules/framework/jvm/src/main/scala/DogFoodCompat.scala +++ b/modules/framework/jvm/src/main/scala/DogFoodCompat.scala @@ -19,7 +19,6 @@ private[weaver] trait DogFoodCompat[F[_]] { self: DogFood[F] => maxParallelism: Int)(tasks: List[sbt.testing.Task]): F[Unit] = { val _ = runner effect.void { - @scala.annotation.nowarn("msg=implicit numeric widening") val r = tasks.toVector.parTraverseN[F, Unit](maxParallelism) { task => blocker.block(discard[Array[Task]](task.execute(eventHandler, Array(logger)))) From d8ceb05f0689445221c7e9d7cc540897422e729a Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:20:57 +0000 Subject: [PATCH 13/31] Remove unused private var. --- modules/framework/js-native/src/main/scala/RunnerCompat.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/framework/js-native/src/main/scala/RunnerCompat.scala b/modules/framework/js-native/src/main/scala/RunnerCompat.scala index a37921d6..5029b521 100644 --- a/modules/framework/js-native/src/main/scala/RunnerCompat.scala +++ b/modules/framework/js-native/src/main/scala/RunnerCompat.scala @@ -177,7 +177,7 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => } private[weaver] object ReadWriter { - class Reader(bytes: ByteBuffer, private var pt: Int) { + class Reader(bytes: ByteBuffer) { def readString() = { val stringSize = bytes.getInt() val ar = new Array[Byte](stringSize) @@ -201,7 +201,7 @@ private[weaver] object ReadWriter { def reader[A](s: String)(f: Reader => A) = { val buf = ByteBuffer.wrap(s.getBytes) - f(new Reader(buf, 0)) + f(new Reader(buf)) } def writer(f: Writer => Unit): String = { From 936d593456e1855eb44c2c974d7d3ec7a334a628 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:21:14 +0000 Subject: [PATCH 14/31] Mark cls as unused (broken for 2.12). --- modules/core/js/src/main/scala/org/junit/runner/RunWith.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala b/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala index 98c3708b..d1d79b65 100644 --- a/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala +++ b/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala @@ -3,4 +3,4 @@ package org.junit.runner /** * Stub used for cross-compilation */ -class RunWith[T](cls: Class[T]) extends scala.annotation.StaticAnnotation +class RunWith[T](@scala.annotation.unused cls: Class[T]) extends scala.annotation.StaticAnnotation From 0c24b5d29df1515d638e0c974415a4599f85e1bd Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:22:52 +0000 Subject: [PATCH 15/31] Reformat. --- modules/core/js/src/main/scala/org/junit/runner/RunWith.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala b/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala index d1d79b65..b6ffcfec 100644 --- a/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala +++ b/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala @@ -3,4 +3,5 @@ package org.junit.runner /** * Stub used for cross-compilation */ -class RunWith[T](@scala.annotation.unused cls: Class[T]) extends scala.annotation.StaticAnnotation +class RunWith[T](@scala.annotation.unused cls: Class[T]) + extends scala.annotation.StaticAnnotation From 086549240129a3aa561b014a4e7ba749c7780d3b Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Fri, 8 Mar 2024 17:26:18 +0000 Subject: [PATCH 16/31] Mark RunWith as unused. --- .../core/native/src/main/scala/org/junit/runner/RunWith.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala b/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala index 98c3708b..b6ffcfec 100644 --- a/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala +++ b/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala @@ -3,4 +3,5 @@ package org.junit.runner /** * Stub used for cross-compilation */ -class RunWith[T](cls: Class[T]) extends scala.annotation.StaticAnnotation +class RunWith[T](@scala.annotation.unused cls: Class[T]) + extends scala.annotation.StaticAnnotation From d1ac0c4fb9b46eefbb7fd7f32929a51d877270c9 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Mon, 11 Mar 2024 14:35:25 +0000 Subject: [PATCH 17/31] Add newline to scalafmt.conf. --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index a164bdaa..00ceef68 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -36,4 +36,4 @@ fileOverride { "glob:**/scala-3/**" { runner.dialect = scala3 } -} \ No newline at end of file +} From 12cca522231f30ce74de2b60f4db2095cd670224 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Mon, 11 Mar 2024 14:55:00 +0000 Subject: [PATCH 18/31] Use scalacCompatAnnotation. --- build.sbt | 28 ++++++++++--------- .../main/scala/org/junit/runner/RunWith.scala | 4 ++- .../main/scala/weaver/PlatformCompat.scala | 4 +-- .../main/scala/org/junit/runner/RunWith.scala | 3 +- .../main/scala/weaver/PlatformCompat.scala | 3 +- .../src/main/scala/DogFoodCompat.scala | 3 +- .../src/main/scala/RunnerCompat.scala | 3 +- .../jvm/src/main/scala/RunnerCompat.scala | 3 +- 8 files changed, 30 insertions(+), 21 deletions(-) diff --git a/build.sbt b/build.sbt index 23524a28..383259c1 100644 --- a/build.sbt +++ b/build.sbt @@ -25,18 +25,19 @@ ThisBuild / crossScalaVersions := Seq(scala212, scala213, "3.3.1") ThisBuild / scalaVersion := scala213 // the default Scala val Version = new { - val catsEffect = "3.5.2" - val catsLaws = "2.9.0" - val discipline = "1.5.1" - val expecty = "0.16.0" - val fs2 = "3.5.0" - val junit = "4.13.2" - val portableReflect = "1.1.2" - val scalaJavaTime = "2.4.0" - val scalacheck = "1.17.0" - val scalajsMacroTask = "1.1.1" - val scalajsStubs = "1.1.0" - val testInterface = "1.0" + val catsEffect = "3.5.2" + val catsLaws = "2.9.0" + val discipline = "1.5.1" + val expecty = "0.16.0" + val fs2 = "3.5.0" + val junit = "4.13.2" + val portableReflect = "1.1.2" + val scalaJavaTime = "2.4.0" + val scalacheck = "1.17.0" + val scalajsMacroTask = "1.1.1" + val scalajsStubs = "1.1.0" + val testInterface = "1.0" + val scalacCompatAnnotation = "0.1.4" } lazy val root = tlCrossRootProject.aggregate(core, @@ -55,7 +56,8 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) "org.typelevel" %%% "cats-effect" % Version.catsEffect, "com.eed3si9n.expecty" %%% "expecty" % Version.expecty, // https://github.com/portable-scala/portable-scala-reflect/issues/23 - "org.portable-scala" %%% "portable-scala-reflect" % Version.portableReflect cross CrossVersion.for3Use2_13 + "org.portable-scala" %%% "portable-scala-reflect" % Version.portableReflect cross CrossVersion.for3Use2_13, + "org.typelevel" %% "scalac-compat-annotation" % Version.scalacCompatAnnotation ) ) diff --git a/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala b/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala index b6ffcfec..02389224 100644 --- a/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala +++ b/modules/core/js/src/main/scala/org/junit/runner/RunWith.scala @@ -1,7 +1,9 @@ package org.junit.runner +import org.typelevel.scalaccompat.annotation.unused + /** * Stub used for cross-compilation */ -class RunWith[T](@scala.annotation.unused cls: Class[T]) +class RunWith[T](@unused cls: Class[T]) extends scala.annotation.StaticAnnotation diff --git a/modules/core/js/src/main/scala/weaver/PlatformCompat.scala b/modules/core/js/src/main/scala/weaver/PlatformCompat.scala index d1f4679e..f331a229 100644 --- a/modules/core/js/src/main/scala/weaver/PlatformCompat.scala +++ b/modules/core/js/src/main/scala/weaver/PlatformCompat.scala @@ -1,8 +1,8 @@ package weaver - +import org.typelevel.scalaccompat.annotation.unused private[weaver] object PlatformCompat { val platform: Platform = Platform.JS - def getClassLoader(clazz: java.lang.Class[_]): ClassLoader = + def getClassLoader(@unused clazz: java.lang.Class[_]): ClassLoader = new ClassLoader() {} } diff --git a/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala b/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala index b6ffcfec..0ba6ff2c 100644 --- a/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala +++ b/modules/core/native/src/main/scala/org/junit/runner/RunWith.scala @@ -1,7 +1,8 @@ package org.junit.runner +import org.typelevel.scalaccompat.annotation.unused /** * Stub used for cross-compilation */ -class RunWith[T](@scala.annotation.unused cls: Class[T]) +class RunWith[T](@unused cls: Class[T]) extends scala.annotation.StaticAnnotation diff --git a/modules/core/native/src/main/scala/weaver/PlatformCompat.scala b/modules/core/native/src/main/scala/weaver/PlatformCompat.scala index f981fbf9..7d588b18 100644 --- a/modules/core/native/src/main/scala/weaver/PlatformCompat.scala +++ b/modules/core/native/src/main/scala/weaver/PlatformCompat.scala @@ -1,8 +1,9 @@ package weaver +import org.typelevel.scalaccompat.annotation.unused private[weaver] object PlatformCompat { val platform: Platform = Platform.Native - def getClassLoader(clazz: java.lang.Class[_]): ClassLoader = + def getClassLoader(@unused clazz: java.lang.Class[_]): ClassLoader = new ClassLoader() {} } diff --git a/modules/framework/js-native/src/main/scala/DogFoodCompat.scala b/modules/framework/js-native/src/main/scala/DogFoodCompat.scala index dc6b7d97..d794752c 100644 --- a/modules/framework/js-native/src/main/scala/DogFoodCompat.scala +++ b/modules/framework/js-native/src/main/scala/DogFoodCompat.scala @@ -4,6 +4,7 @@ package framework import cats.data.Chain import cats.effect.Resource import cats.syntax.all._ +import org.typelevel.scalaccompat.annotation.unused private[weaver] trait DogFoodCompat[F[_]] { self: DogFood[F] => @@ -15,7 +16,7 @@ private[weaver] trait DogFoodCompat[F[_]] { self: DogFood[F] => runner: WeaverRunner[F], eventHandler: sbt.testing.EventHandler, logger: sbt.testing.Logger, - maxParallelism: Int)(tasks: List[sbt.testing.Task]): F[Unit] = { + @unused maxParallelism: Int)(tasks: List[sbt.testing.Task]): F[Unit] = { tasks.traverse { task => self.framework.unsafeRun.fromFuture { task.asInstanceOf[AsyncTask].executeFuture(eventHandler, Array(logger)) diff --git a/modules/framework/js-native/src/main/scala/RunnerCompat.scala b/modules/framework/js-native/src/main/scala/RunnerCompat.scala index 5029b521..501011f9 100644 --- a/modules/framework/js-native/src/main/scala/RunnerCompat.scala +++ b/modules/framework/js-native/src/main/scala/RunnerCompat.scala @@ -2,6 +2,7 @@ package weaver package framework import java.nio.ByteBuffer +import org.typelevel.scalaccompat.annotation.unused import scala.collection.mutable.ListBuffer import scala.concurrent.Future @@ -138,7 +139,7 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => } } - def finaliseError(outcomes: Ref[ + def finaliseError(@unused outcomes: Ref[ F, Chain[TestOutcome]]): Throwable => F[Unit] = { error => val outcome = diff --git a/modules/framework/jvm/src/main/scala/RunnerCompat.scala b/modules/framework/jvm/src/main/scala/RunnerCompat.scala index f13f4bcc..0fb0f393 100644 --- a/modules/framework/jvm/src/main/scala/RunnerCompat.scala +++ b/modules/framework/jvm/src/main/scala/RunnerCompat.scala @@ -1,5 +1,6 @@ package weaver package framework +import org.typelevel.scalaccompat.annotation.unused import java.io.PrintStream import java.util.concurrent.ConcurrentLinkedQueue @@ -37,7 +38,7 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => } // Required on js - def receiveMessage(msg: String): Option[String] = None + def receiveMessage(@unused msg: String): Option[String] = None // Flag meant to be raised if build-tool call `done` protected val isDone: AtomicBoolean = new AtomicBoolean(false) From 50ff96abb9857ff0dfd2208e0e039320ccbe1a29 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Mon, 11 Mar 2024 15:28:21 +0000 Subject: [PATCH 19/31] Add type parameters for Scala 2.12 compiler subtype warning. --- modules/core/shared/src/main/scala/weaver/Test.scala | 2 +- modules/core/shared/src/main/scala/weaver/suites.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/shared/src/main/scala/weaver/Test.scala b/modules/core/shared/src/main/scala/weaver/Test.scala index 397ee715..56a9be4a 100644 --- a/modules/core/shared/src/main/scala/weaver/Test.scala +++ b/modules/core/shared/src/main/scala/weaver/Test.scala @@ -40,6 +40,6 @@ object Test { def apply[F[_]](name: String, f: F[Expectations])( implicit F: EffectCompat[F] - ): F[TestOutcome] = apply(name, (_: Log[F]) => f) + ): F[TestOutcome] = apply[F](name, (_: Log[F]) => f) } diff --git a/modules/core/shared/src/main/scala/weaver/suites.scala b/modules/core/shared/src/main/scala/weaver/suites.scala index b3a118f8..5b105650 100644 --- a/modules/core/shared/src/main/scala/weaver/suites.scala +++ b/modules/core/shared/src/main/scala/weaver/suites.scala @@ -131,13 +131,13 @@ abstract class MutableFSuite[F[_]] extends RunnableSuite[F] { } def pureTest(name: TestName)(run : => Expectations) : Unit = registerTest(name)(_ => Test(name.name, effectCompat.effect.delay(run))) - def loggedTest(name: TestName)(run: Log[F] => F[Expectations]) : Unit = registerTest(name)(_ => Test(name.name, log => run(log))) + def loggedTest(name: TestName)(run: Log[F] => F[Expectations]) : Unit = registerTest(name)(_ => Test[F](name.name, log => run(log))) def test(name: TestName) : PartiallyAppliedTest = new PartiallyAppliedTest(name) class PartiallyAppliedTest(name : TestName) { def apply(run: => F[Expectations]) : Unit = registerTest(name)(_ => Test(name.name, run)) def apply(run : Res => F[Expectations]) : Unit = registerTest(name)(res => Test(name.name, run(res))) - def apply(run : (Res, Log[F]) => F[Expectations]) : Unit = registerTest(name)(res => Test(name.name, log => run(res, log))) + def apply(run : (Res, Log[F]) => F[Expectations]) : Unit = registerTest(name)(res => Test[F](name.name, log => run(res, log))) // this alias helps using pattern matching on `Res` def usingRes(run : Res => F[Expectations]) : Unit = apply(run) From 5fde5d4d7a6d5d5a610d69bb523a4d176b9d813f Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Mon, 11 Mar 2024 16:37:31 +0000 Subject: [PATCH 20/31] Fix doc for 2.13 --- .../shared/src/main/scala/weaver/framework/Fingerprints.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala index 535adf8b..f36982cf 100644 --- a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala +++ b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala @@ -76,7 +76,7 @@ abstract class WeaverFingerprints[F[_]](implicit F: Sync[F]) { /** * A fingerprint that searches only for classes extending * [[weaver.EffectSuite]]. that have a constructor that takes a single - * [[weaver.GlobalResources.Read]] parameter. + * `weaver.GlobalResources.Read` parameter. */ object ResourceSharingSuiteFingerprint extends WeaverFingerprint { def isModule() = false From 6721c4d77963e352b684f99d7a620b06044d5626 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Mon, 11 Mar 2024 16:59:08 +0000 Subject: [PATCH 21/31] Experiment: remove RunWith annotation. --- modules/core/shared/src/main/scala/weaver/suites.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/core/shared/src/main/scala/weaver/suites.scala b/modules/core/shared/src/main/scala/weaver/suites.scala index 5b105650..1ece7c2d 100644 --- a/modules/core/shared/src/main/scala/weaver/suites.scala +++ b/modules/core/shared/src/main/scala/weaver/suites.scala @@ -7,7 +7,6 @@ import cats.effect.{ Async, Resource } import cats.syntax.all._ import fs2.Stream -import org.junit.runner.RunWith import org.portablescala.reflect.annotation.EnableReflectiveInstantiation // Just a non-parameterized marker trait to help SBT's test detection logic. @@ -60,7 +59,6 @@ object EffectSuite { } -@RunWith(classOf[weaver.junit.WeaverRunner]) abstract class RunnableSuite[F[_]] extends EffectSuite[F] { implicit protected def effectCompat: UnsafeRun[EffectType] private[weaver] def getEffectCompat: UnsafeRun[EffectType] = effectCompat From 5374b60ae347f54c9751cd4a994d12a98a3bce53 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 12 Mar 2024 15:56:16 +0000 Subject: [PATCH 22/31] Add unused Reader.pt, WeaverRunner.dummy, LazyAccessSequential.index --- .../jvm/src/main/scala/weaver/junit/WeaverRunner.scala | 4 +++- .../framework-cats/jvm/src/test/scala/MetaJVM.scala | 10 ++++++---- .../js-native/src/main/scala/RunnerCompat.scala | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala b/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala index 9b82a6a2..7a730766 100644 --- a/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala +++ b/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala @@ -1,13 +1,15 @@ package weaver package junit +import org.typelevel.scalaccompat.annotation.unused + import weaver.TestStatus._ import weaver.internals.Reflection import org.junit.runner.Description import org.junit.runner.notification.RunNotifier -class WeaverRunner(cls: Class[_]) +class WeaverRunner(cls: Class[_], @unused dummy: Boolean) extends org.junit.runner.Runner { type F[A] = Any diff --git a/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala b/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala index e49e0d2d..f9d23b94 100644 --- a/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala +++ b/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala @@ -2,6 +2,8 @@ package weaver package framework package test +import org.typelevel.scalaccompat.annotation.unused + import java.io.File import cats.effect._ @@ -132,7 +134,7 @@ object MetaJVM { } } - abstract class LazyAccessSequential(global: GlobalRead) + abstract class LazyAccessSequential(global: GlobalRead, @unused index: Int) extends IOSuite { type Res = LazyState def sharedResource: Resource[IO, Res] = { @@ -157,10 +159,10 @@ object MetaJVM { // Using sleeps to force sequential runs of suites class LazyAccessSequential0(global: GlobalRead) - extends LazyAccessSequential(global) + extends LazyAccessSequential(global, 0) class LazyAccessSequential1(global: GlobalRead) - extends LazyAccessSequential(global) + extends LazyAccessSequential(global, 1) class LazyAccessSequential2(global: GlobalRead) - extends LazyAccessSequential(global) + extends LazyAccessSequential(global, 2) } diff --git a/modules/framework/js-native/src/main/scala/RunnerCompat.scala b/modules/framework/js-native/src/main/scala/RunnerCompat.scala index 501011f9..f57f4d77 100644 --- a/modules/framework/js-native/src/main/scala/RunnerCompat.scala +++ b/modules/framework/js-native/src/main/scala/RunnerCompat.scala @@ -178,7 +178,7 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => } private[weaver] object ReadWriter { - class Reader(bytes: ByteBuffer) { + class Reader(bytes: ByteBuffer, @unused private var pt: Int) { def readString() = { val stringSize = bytes.getInt() val ar = new Array[Byte](stringSize) @@ -202,7 +202,7 @@ private[weaver] object ReadWriter { def reader[A](s: String)(f: Reader => A) = { val buf = ByteBuffer.wrap(s.getBytes) - f(new Reader(buf)) + f(new Reader(buf, 0)) } def writer(f: Writer => Unit): String = { From 98dd4922933eee2e7dd39494c84a2f0008a2e885 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 12 Mar 2024 16:01:25 +0000 Subject: [PATCH 23/31] Add WeaverRunner constructor back. --- modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala b/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala index 7a730766..358f374b 100644 --- a/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala +++ b/modules/core/jvm/src/main/scala/weaver/junit/WeaverRunner.scala @@ -14,6 +14,8 @@ class WeaverRunner(cls: Class[_], @unused dummy: Boolean) type F[A] = Any + def this(cls: Class[_]) = this(cls, true) + lazy val suite: RunnableSuite[F] = { Reflection.loadRunnableSuite(cls.getName(), getClass().getClassLoader()) } From 482bd816fa4617b9dc4cd443c2ba997c3650682f Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 12 Mar 2024 16:07:38 +0000 Subject: [PATCH 24/31] Use nowarn2 annotation. --- modules/framework-cats/shared/src/test/scala/Meta.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/framework-cats/shared/src/test/scala/Meta.scala b/modules/framework-cats/shared/src/test/scala/Meta.scala index 7ab883bd..90ddd5c8 100644 --- a/modules/framework-cats/shared/src/test/scala/Meta.scala +++ b/modules/framework-cats/shared/src/test/scala/Meta.scala @@ -2,7 +2,7 @@ package weaver package framework package test -import scala.annotation.nowarn +import org.typelevel.scalaccompat.annotation._ import cats.effect._ @@ -14,7 +14,7 @@ object Meta { object Boom extends Error("Boom") with scala.util.control.NoStackTrace - @nowarn("msg=dead code following this construct") + @nowarn2("cat=w-flag-dead-code") object CrashingSuite extends SimpleIOSuite { throw Boom } From 705c8331acaa7aa6178ac84e09dfee17c6afcd35 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 12 Mar 2024 16:11:36 +0000 Subject: [PATCH 25/31] Mark runner in DogFoodCompat as unused. --- modules/framework/jvm/src/main/scala/DogFoodCompat.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/framework/jvm/src/main/scala/DogFoodCompat.scala b/modules/framework/jvm/src/main/scala/DogFoodCompat.scala index eb864379..2c3480fa 100644 --- a/modules/framework/jvm/src/main/scala/DogFoodCompat.scala +++ b/modules/framework/jvm/src/main/scala/DogFoodCompat.scala @@ -5,6 +5,7 @@ import cats.effect.Resource import cats.effect.implicits._ import sbt.testing._ +import org.typelevel.scalaccompat.annotation.unused private[weaver] trait DogFoodCompat[F[_]] { self: DogFood[F] => @@ -13,11 +14,10 @@ private[weaver] trait DogFoodCompat[F[_]] { self: DogFood[F] => def blocker: BlockerCompat[F] def runTasksCompat( - runner: WeaverRunner[F], + @unused runner: WeaverRunner[F], eventHandler: EventHandler, logger: Logger, maxParallelism: Int)(tasks: List[sbt.testing.Task]): F[Unit] = { - val _ = runner effect.void { val r = tasks.toVector.parTraverseN[F, Unit](maxParallelism) { task => blocker.block(discard[Array[Task]](task.execute(eventHandler, From 901504ed1fe44b4585928609c16f789ef048a183 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 12 Mar 2024 16:22:43 +0000 Subject: [PATCH 26/31] Use tupleLeft. --- modules/framework/jvm/src/main/scala/RunnerCompat.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/framework/jvm/src/main/scala/RunnerCompat.scala b/modules/framework/jvm/src/main/scala/RunnerCompat.scala index 0fb0f393..d4834c5e 100644 --- a/modules/framework/jvm/src/main/scala/RunnerCompat.scala +++ b/modules/framework/jvm/src/main/scala/RunnerCompat.scala @@ -59,7 +59,7 @@ trait RunnerCompat[F[_]] { self: sbt.testing.Runner => val waitForResourcesShutdown = new java.util.concurrent.Semaphore(0) val tasksAndSuites = (taskDefs.toList.mapFilter { taskDef => - suiteLoader(taskDef).map(loader => (taskDef, loader)) + suiteLoader(taskDef).tupleLeft(taskDef) }) def makeTasks( From 13400cbf91c2ffa9b97a1a058f39ec0e42b99caa Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Tue, 12 Mar 2024 16:39:54 +0000 Subject: [PATCH 27/31] Add `RunWith` annotation (and fail CI pipeline). --- modules/core/shared/src/main/scala/weaver/suites.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/shared/src/main/scala/weaver/suites.scala b/modules/core/shared/src/main/scala/weaver/suites.scala index 1ece7c2d..975ebbf7 100644 --- a/modules/core/shared/src/main/scala/weaver/suites.scala +++ b/modules/core/shared/src/main/scala/weaver/suites.scala @@ -8,6 +8,7 @@ import cats.syntax.all._ import fs2.Stream import org.portablescala.reflect.annotation.EnableReflectiveInstantiation +import org.junit.runner.RunWith // Just a non-parameterized marker trait to help SBT's test detection logic. @EnableReflectiveInstantiation @@ -59,6 +60,7 @@ object EffectSuite { } +@RunWith(classOf[weaver.junit.WeaverRunner]) abstract class RunnableSuite[F[_]] extends EffectSuite[F] { implicit protected def effectCompat: UnsafeRun[EffectType] private[weaver] def getEffectCompat: UnsafeRun[EffectType] = effectCompat From 3fe2d7bf4e2f6cd86394f08fbc5a853a2e306276 Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Wed, 13 Mar 2024 13:20:36 +0000 Subject: [PATCH 28/31] Add optional JUnit dependency to cats-core. --- build.sbt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.sbt b/build.sbt index 383259c1..23c927e3 100644 --- a/build.sbt +++ b/build.sbt @@ -108,6 +108,11 @@ lazy val frameworkNative = framework.native lazy val coreCats = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("modules/core-cats")) .dependsOn(core) + .settings( + libraryDependencies ++= Seq( + "junit" % "junit" % Version.junit % Optional + ) + ) .settings(name := "cats-core") lazy val coreCatsJS = coreCats.js From 6b0fd1c676086779b547e33036500900a7f8d23b Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Wed, 13 Mar 2024 13:33:07 +0000 Subject: [PATCH 29/31] Use ScalaDocTool configuration. --- build.sbt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 23c927e3..a57a6272 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,5 @@ +import sbt.librarymanagement.Configurations.ScalaDocTool + // https://typelevel.org/sbt-typelevel/faq.html#what-is-a-base-version-anyway ThisBuild / tlBaseVersion := "0.0" // your current series x.y @@ -110,7 +112,7 @@ lazy val coreCats = crossProject(JVMPlatform, JSPlatform, NativePlatform) .dependsOn(core) .settings( libraryDependencies ++= Seq( - "junit" % "junit" % Version.junit % Optional + "junit" % "junit" % Version.junit % ScalaDocTool ) ) .settings(name := "cats-core") From bcc7d34856c9882047522425dbb495b8d4a73eea Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Wed, 13 Mar 2024 13:52:08 +0000 Subject: [PATCH 30/31] Remove unused index from LazyAccessSequential test. --- .../framework-cats/jvm/src/test/scala/MetaJVM.scala | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala b/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala index f9d23b94..e49e0d2d 100644 --- a/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala +++ b/modules/framework-cats/jvm/src/test/scala/MetaJVM.scala @@ -2,8 +2,6 @@ package weaver package framework package test -import org.typelevel.scalaccompat.annotation.unused - import java.io.File import cats.effect._ @@ -134,7 +132,7 @@ object MetaJVM { } } - abstract class LazyAccessSequential(global: GlobalRead, @unused index: Int) + abstract class LazyAccessSequential(global: GlobalRead) extends IOSuite { type Res = LazyState def sharedResource: Resource[IO, Res] = { @@ -159,10 +157,10 @@ object MetaJVM { // Using sleeps to force sequential runs of suites class LazyAccessSequential0(global: GlobalRead) - extends LazyAccessSequential(global, 0) + extends LazyAccessSequential(global) class LazyAccessSequential1(global: GlobalRead) - extends LazyAccessSequential(global, 1) + extends LazyAccessSequential(global) class LazyAccessSequential2(global: GlobalRead) - extends LazyAccessSequential(global, 2) + extends LazyAccessSequential(global) } From 03d98b2a282ed8a06c055196f5db9f887dad6bcf Mon Sep 17 00:00:00 2001 From: zainab-ali Date: Wed, 13 Mar 2024 13:55:42 +0000 Subject: [PATCH 31/31] Use GlobalResourceF.Read in scaladoc. --- .../shared/src/main/scala/weaver/framework/Fingerprints.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala index f36982cf..75b6d0a5 100644 --- a/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala +++ b/modules/framework/shared/src/main/scala/weaver/framework/Fingerprints.scala @@ -76,7 +76,7 @@ abstract class WeaverFingerprints[F[_]](implicit F: Sync[F]) { /** * A fingerprint that searches only for classes extending * [[weaver.EffectSuite]]. that have a constructor that takes a single - * `weaver.GlobalResources.Read` parameter. + * [[weaver.GlobalResourceF.Read]] parameter. */ object ResourceSharingSuiteFingerprint extends WeaverFingerprint { def isModule() = false