Runtime Implementation #2
8 changed files with 26 additions and 26 deletions
14
build.sbt
14
build.sbt
|
|
@ -1,4 +1,4 @@
|
|||
val scala3: String = "3.7.3"
|
||||
val scala3: String = "3.8.3"
|
||||
|
||||
ThisBuild / scalaVersion := scala3
|
||||
ThisBuild / versionScheme := Some("semver-spec")
|
||||
|
|
@ -27,24 +27,24 @@ val sharedSettings = Seq(
|
|||
val Deps = new {
|
||||
val Cats = new {
|
||||
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 Core: ModuleID = "co.fs2" %% "fs2-core" % "3.12.0"
|
||||
val Core: ModuleID = "co.fs2" %% "fs2-core" % "3.13.0"
|
||||
}
|
||||
|
||||
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 Uuid: ModuleID = "gs" %% "gs-uuid-v0" % "0.4.1"
|
||||
val Timing: ModuleID = "gs" %% "gs-timing-v0" % "0.1.2"
|
||||
val Datagen: ModuleID = "gs" %% "gs-datagen-core-v0" % "0.3.3"
|
||||
val Timing: ModuleID = "gs" %% "gs-timing-v0" % "0.1.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(
|
||||
|
|
|
|||
|
|
@ -263,14 +263,14 @@ object TestGroup:
|
|||
* The function this test will execute.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param unitOfWork
|
||||
* The function this test will execute.
|
||||
*/
|
||||
def effectful(
|
||||
def apply(
|
||||
unitOfWork: natchez.Trace[F] ?=> F[Either[TestFailure, Any]]
|
||||
): Unit =
|
||||
registry.register(
|
||||
|
|
@ -291,7 +291,7 @@ object TestGroup:
|
|||
* @param unitOfWork
|
||||
* The function this test will execute.
|
||||
*/
|
||||
def apply(
|
||||
def eitherT(
|
||||
unitOfWork: natchez.Trace[F] ?=> EitherT[F, TestFailure, Any]
|
||||
): Unit =
|
||||
registry.register(
|
||||
|
|
@ -422,7 +422,7 @@ object TestGroup:
|
|||
* @param unitOfWork
|
||||
* The function this test will execute.
|
||||
*/
|
||||
def effectful(
|
||||
def apply(
|
||||
unitOfWork: natchez.Trace[F] ?=> Input => F[Either[TestFailure, Any]]
|
||||
): Unit =
|
||||
registry.register(
|
||||
|
|
@ -445,7 +445,7 @@ object TestGroup:
|
|||
* @param unitOfWork
|
||||
* The function this test will execute.
|
||||
*/
|
||||
def apply(
|
||||
def eitherT(
|
||||
unitOfWork: natchez.Trace[F] ?=> Input => EitherT[F, TestFailure, Any]
|
||||
): Unit =
|
||||
registry.register(
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ def pass(): Either[TestFailure, Unit] = Right(())
|
|||
* final class Example extends TestGroup.IO:
|
||||
* override def name: String = "example"
|
||||
*
|
||||
* test(pid"ex", "Example Test").effectful { passF() }
|
||||
* test(pid"ex", "Example Test") { passF() }
|
||||
* }}}
|
||||
*
|
||||
* @return
|
||||
|
|
@ -123,7 +123,7 @@ def passF[F[_]: Applicative](): F[Either[TestFailure, Unit]] =
|
|||
* final class Example extends TestGroup.IO:
|
||||
* override def name: String = "example"
|
||||
*
|
||||
* test(pid"ex", "Example Test") { passT() }
|
||||
* test(pid"ex", "Example Test").eitherT { passT() }
|
||||
* }}}
|
||||
*
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package gs.test.v0.runtime.engine
|
|||
|
||||
import cats.effect.IO
|
||||
import gs.datagen.v0.Gen
|
||||
import gs.datagen.v0.generators.Size
|
||||
import gs.datagen.v0.generators.Range
|
||||
import java.util.concurrent.TimeUnit
|
||||
import munit.*
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
|
@ -61,7 +61,7 @@ class EngineStatsTests extends IOSuite:
|
|||
val duration = Generators.testDuration()
|
||||
val size = 4
|
||||
val executions =
|
||||
Gen.list(Size.fixed(size), Generators.GenTestExecutionPassed).gen()
|
||||
Gen.list(Range.fixed(size), Generators.GenTestExecutionPassed).gen()
|
||||
for
|
||||
stats <- EngineStats.initialize[IO]
|
||||
_ <- stats.updateForGroup(duration, executions)
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ object TestEngineTests:
|
|||
override def name: String = "single-passing-test"
|
||||
|
||||
test(pid"engine:g1", "show that true is true") {
|
||||
check(true).isTrueT()
|
||||
check(true).isTrueF()
|
||||
}
|
||||
|
||||
end G1
|
||||
|
|
@ -184,7 +184,7 @@ object TestEngineTests:
|
|||
override def name: String = "single-failing-test"
|
||||
|
||||
test(pid"engine:g2", "this will fail") {
|
||||
check(1).isEqualToT(2)
|
||||
check(1).isEqualToF(2)
|
||||
}
|
||||
|
||||
end G2
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package support
|
||||
|
||||
import gs.datagen.v0.*
|
||||
import gs.datagen.v0.generators.Size
|
||||
import gs.datagen.v0.generators.Range
|
||||
import gs.test.v0.api.*
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
||||
|
|
@ -15,14 +15,14 @@ object Generators:
|
|||
given Generated[TestExecution.Id] = Generated.of(GenTestExecutionId)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ object Generators:
|
|||
val GenTestSuite: Gen[TestSuite] =
|
||||
for
|
||||
pid <- GenPermanentId
|
||||
name <- Gen.string.alphaNumeric(Size.fixed(8))
|
||||
name <- Gen.string.alphaNumeric(Range.fixed(8))
|
||||
yield TestSuite(pid, name, None)
|
||||
|
||||
given Generated[TestSuite] = Generated.of(GenTestSuite)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
sbt.version=1.11.6
|
||||
sbt.version=1.12.8
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@ externalResolvers := Seq(
|
|||
"Garrity Software Releases" at "https://maven.garrity.co/gs"
|
||||
)
|
||||
|
||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.3.1")
|
||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.6.0")
|
||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.4.4")
|
||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.7.0")
|
||||
addSbtPlugin("gs" % "sbt-gs-semver" % "0.3.0")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue