Runtime Implementation #2

Merged
pfm merged 13 commits from runtime into main 2026-04-05 13:42:38 +00:00
8 changed files with 26 additions and 26 deletions
Showing only changes of commit a2f046e860 - Show all commits

View file

@ -1,4 +1,4 @@
val scala3: String = "3.7.3" val scala3: String = "3.8.3"
ThisBuild / scalaVersion := scala3 ThisBuild / scalaVersion := scala3
ThisBuild / versionScheme := Some("semver-spec") ThisBuild / versionScheme := Some("semver-spec")
@ -27,24 +27,24 @@ val sharedSettings = Seq(
val Deps = new { val Deps = new {
val Cats = new { val Cats = new {
val Core: ModuleID = "org.typelevel" %% "cats-core" % "2.13.0" val Core: ModuleID = "org.typelevel" %% "cats-core" % "2.13.0"
val Effect: ModuleID = "org.typelevel" %% "cats-effect" % "3.6.3" val Effect: ModuleID = "org.typelevel" %% "cats-effect" % "3.7.0"
} }
val Fs2 = new { val Fs2 = new {
val Core: ModuleID = "co.fs2" %% "fs2-core" % "3.12.0" val Core: ModuleID = "co.fs2" %% "fs2-core" % "3.13.0"
} }
val Natchez = new { val Natchez = new {
val Core: ModuleID = "org.tpolecat" %% "natchez-core" % "0.3.8" val Core: ModuleID = "org.tpolecat" %% "natchez-core" % "0.3.9"
} }
val Gs = new { val Gs = new {
val Uuid: ModuleID = "gs" %% "gs-uuid-v0" % "0.4.1" val Uuid: ModuleID = "gs" %% "gs-uuid-v0" % "0.4.1"
val Timing: ModuleID = "gs" %% "gs-timing-v0" % "0.1.2" val Timing: ModuleID = "gs" %% "gs-timing-v0" % "0.1.3"
val Datagen: ModuleID = "gs" %% "gs-datagen-core-v0" % "0.3.3" val Datagen: ModuleID = "gs" %% "gs-datagen-core-v0" % "0.4.1"
} }
val MUnit: ModuleID = "org.scalameta" %% "munit" % "1.1.1" val MUnit: ModuleID = "org.scalameta" %% "munit" % "1.2.4"
} }
lazy val testSettings = Seq( lazy val testSettings = Seq(

View file

@ -263,14 +263,14 @@ object TestGroup:
* The function this test will execute. * The function this test will execute.
*/ */
def pure(unitOfWork: => Either[TestFailure, Unit]): Unit = def pure(unitOfWork: => Either[TestFailure, Unit]): Unit =
effectful(Async[F].pure(unitOfWork)) apply(Async[F].pure(unitOfWork))
/** Finalize and register this test with an effectful unit of work. /** Finalize and register this test with an effectful unit of work.
* *
* @param unitOfWork * @param unitOfWork
* The function this test will execute. * The function this test will execute.
*/ */
def effectful( def apply(
unitOfWork: natchez.Trace[F] ?=> F[Either[TestFailure, Any]] unitOfWork: natchez.Trace[F] ?=> F[Either[TestFailure, Any]]
): Unit = ): Unit =
registry.register( registry.register(
@ -291,7 +291,7 @@ object TestGroup:
* @param unitOfWork * @param unitOfWork
* The function this test will execute. * The function this test will execute.
*/ */
def apply( def eitherT(
unitOfWork: natchez.Trace[F] ?=> EitherT[F, TestFailure, Any] unitOfWork: natchez.Trace[F] ?=> EitherT[F, TestFailure, Any]
): Unit = ): Unit =
registry.register( registry.register(
@ -422,7 +422,7 @@ object TestGroup:
* @param unitOfWork * @param unitOfWork
* The function this test will execute. * The function this test will execute.
*/ */
def effectful( def apply(
unitOfWork: natchez.Trace[F] ?=> Input => F[Either[TestFailure, Any]] unitOfWork: natchez.Trace[F] ?=> Input => F[Either[TestFailure, Any]]
): Unit = ): Unit =
registry.register( registry.register(
@ -445,7 +445,7 @@ object TestGroup:
* @param unitOfWork * @param unitOfWork
* The function this test will execute. * The function this test will execute.
*/ */
def apply( def eitherT(
unitOfWork: natchez.Trace[F] ?=> Input => EitherT[F, TestFailure, Any] unitOfWork: natchez.Trace[F] ?=> Input => EitherT[F, TestFailure, Any]
): Unit = ): Unit =
registry.register( registry.register(

View file

@ -104,7 +104,7 @@ def pass(): Either[TestFailure, Unit] = Right(())
* final class Example extends TestGroup.IO: * final class Example extends TestGroup.IO:
* override def name: String = "example" * override def name: String = "example"
* *
* test(pid"ex", "Example Test").effectful { passF() } * test(pid"ex", "Example Test") { passF() }
* }}} * }}}
* *
* @return * @return
@ -123,7 +123,7 @@ def passF[F[_]: Applicative](): F[Either[TestFailure, Unit]] =
* final class Example extends TestGroup.IO: * final class Example extends TestGroup.IO:
* override def name: String = "example" * override def name: String = "example"
* *
* test(pid"ex", "Example Test") { passT() } * test(pid"ex", "Example Test").eitherT { passT() }
* }}} * }}}
* *
* @return * @return

View file

@ -2,7 +2,7 @@ package gs.test.v0.runtime.engine
import cats.effect.IO import cats.effect.IO
import gs.datagen.v0.Gen import gs.datagen.v0.Gen
import gs.datagen.v0.generators.Size import gs.datagen.v0.generators.Range
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import munit.* import munit.*
import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration.FiniteDuration
@ -61,7 +61,7 @@ class EngineStatsTests extends IOSuite:
val duration = Generators.testDuration() val duration = Generators.testDuration()
val size = 4 val size = 4
val executions = val executions =
Gen.list(Size.fixed(size), Generators.GenTestExecutionPassed).gen() Gen.list(Range.fixed(size), Generators.GenTestExecutionPassed).gen()
for for
stats <- EngineStats.initialize[IO] stats <- EngineStats.initialize[IO]
_ <- stats.updateForGroup(duration, executions) _ <- stats.updateForGroup(duration, executions)

View file

@ -175,7 +175,7 @@ object TestEngineTests:
override def name: String = "single-passing-test" override def name: String = "single-passing-test"
test(pid"engine:g1", "show that true is true") { test(pid"engine:g1", "show that true is true") {
check(true).isTrueT() check(true).isTrueF()
} }
end G1 end G1
@ -184,7 +184,7 @@ object TestEngineTests:
override def name: String = "single-failing-test" override def name: String = "single-failing-test"
test(pid"engine:g2", "this will fail") { test(pid"engine:g2", "this will fail") {
check(1).isEqualToT(2) check(1).isEqualToF(2)
} }
end G2 end G2

View file

@ -1,7 +1,7 @@
package support package support
import gs.datagen.v0.* import gs.datagen.v0.*
import gs.datagen.v0.generators.Size import gs.datagen.v0.generators.Range
import gs.test.v0.api.* import gs.test.v0.api.*
import scala.concurrent.duration.FiniteDuration import scala.concurrent.duration.FiniteDuration
@ -15,14 +15,14 @@ object Generators:
given Generated[TestExecution.Id] = Generated.of(GenTestExecutionId) given Generated[TestExecution.Id] = Generated.of(GenTestExecutionId)
val GenPermanentId: Gen[PermanentId] = val GenPermanentId: Gen[PermanentId] =
Gen.string.alphaNumeric(Size.Fixed(12)).map(x => PermanentId(s"pid-$x")) Gen.string.alphaNumeric(Range.Fixed(12)).map(x => PermanentId(s"pid-$x"))
given Generated[PermanentId] = Generated.of(GenPermanentId) given Generated[PermanentId] = Generated.of(GenPermanentId)
val GenTag: Gen[Tag] = val GenTag: Gen[Tag] =
Gen.string.alphaNumeric(Size.Fixed(6)).map(x => Tag(s"tag-$x")) Gen.string.alphaNumeric(Range.Fixed(6)).map(x => Tag(s"tag-$x"))
val GenTagList: Gen[List[Tag]] = Gen.list(Size.between(0, 8), GenTag) val GenTagList: Gen[List[Tag]] = Gen.list(Range.between(0, 8), GenTag)
given Generated[Tag] = Generated.of(GenTag) given Generated[Tag] = Generated.of(GenTag)
@ -77,7 +77,7 @@ object Generators:
val GenTestSuite: Gen[TestSuite] = val GenTestSuite: Gen[TestSuite] =
for for
pid <- GenPermanentId pid <- GenPermanentId
name <- Gen.string.alphaNumeric(Size.fixed(8)) name <- Gen.string.alphaNumeric(Range.fixed(8))
yield TestSuite(pid, name, None) yield TestSuite(pid, name, None)
given Generated[TestSuite] = Generated.of(GenTestSuite) given Generated[TestSuite] = Generated.of(GenTestSuite)

View file

@ -1 +1 @@
sbt.version=1.11.6 sbt.version=1.12.8

View file

@ -28,6 +28,6 @@ externalResolvers := Seq(
"Garrity Software Releases" at "https://maven.garrity.co/gs" "Garrity Software Releases" at "https://maven.garrity.co/gs"
) )
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.3.1") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.4")
addSbtPlugin("gs" % "sbt-garrity-software" % "0.6.0") addSbtPlugin("gs" % "sbt-garrity-software" % "0.7.0")
addSbtPlugin("gs" % "sbt-gs-semver" % "0.3.0") addSbtPlugin("gs" % "sbt-gs-semver" % "0.3.0")