This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scalaz.concurrent.Task | |
import scalaz.effect.{IO, LiftIO} | |
implicit val taskIO: LiftIO[Task] = new LiftIO[Task] { | |
override def liftIO[A](ioa: IO[A]): Task[A] = | |
Task.delay(ioa.unsafePerformIO()) | |
} | |
import au.com.iag.dataeng.retries.instances.TaskInstances |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.specs2.data.Tag | |
import org.specs2.matcher.MatchResult | |
import org.specs2.scalacheck.ScalaCheckFunction1 | |
import org.specs2.specification.core.SpecStructure | |
import org.specs2.{ ScalaCheck, Specification } | |
class IntegrationTest extends Specification with ScalaCheck { self => | |
// The test requires external environment. In this case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Take a look at the snippet. This is just a sample. You might have more/less steps as part of docker compose up | |
object DockerUtil { | |
lazy val makeDockerFile = taskKey[Seq[ImageName]]("Make a docker image for the app.") | |
lazy val makeDockerComposeFile = taskKey[File]("Make docker compose file for the project in resource managed location.") | |
lazy val dockerComposeUp = taskKey[File]("docker-compose up for the project") | |
def relativeDockerComposePath(resPath: File) = resPath / "docker" / "bin" / "docker-compose.yml" | |
def settings = Seq( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val myProject = | |
(project in file("myProject")) | |
.enablePlugins(DockerPlugin, DockerComposePlugin) | |
.config(DockerTest) | |
.settings(inConfig(DockerTest)(Defaults.testTasks): _*) | |
.settings(testOptions in DockerTest := Seq(Tests.Argument(TestFrameworks.Specs2, "include", | |
"DockerComposeTag"))) | |
// We exclude in other tests | |
.settings(testOptions in Test := Seq( | |
Tests.Argument(TestFrameworks.Specs2, "exclude", "DockerComposeTag")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val myProject = | |
(project in file("myProject")) | |
.enablePlugins(DockerPlugin, DockerComposePlugin) | |
.config(DockerTest) | |
.settings(inConfig(DockerTest)(Defaults.testTasks): _*) | |
.settings(testOptions in DockerTest := Seq( | |
Tests.Argument(TestFrameworks.Specs2, "include", "DockerComposeTag")) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val DockerTest = config("docker-int") extend Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.free.Free | |
import cats.{ Monad, ~>} | |
import iota._ | |
import TListK.::: | |
import cats.implicits._ | |
// A monkey patching that was possible with Free Monad, where logging is | |
// never a part of the algebra/interface/interpreter. | |
// Unlike dozens of blogs and patterns, here Log is never a part of the coproduct of algebras | |
// (which can clutter the business-logic/monadic-for-comprehension). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.telstra.dxmodel.api.interop | |
import cats.data.{EitherT, Kleisli, Writer, WriterT} | |
import cats.free.Free | |
import cats.implicits._ | |
import cats.~> | |
import scalaz.zio.IO | |
import com.telstra.dxmodel.instances.AllMonadInstances._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.data.{EitherT, Writer, WriterT} | |
import cats.free.Free | |
import cats.implicits._ | |
import cats.{~>} | |
import scalaz.zio.IO | |
// Technique to build a computation description which should accumulate info on each execution step | |
// which is to be returned to the user regardless of failure or success. |