@@ -28,7 +28,7 @@ object Execute {
2828
2929 def makeCommandProcess (command : List [String ], workingDir : Path ) = {
3030 val results = for {
31- executable <- ZIO .from(command.headOption).orElseFail(RunFailure (s " Example command is invalid " ))
31+ executable <- ZIO .from(command.headOption).orElseFail(RunFailure (" Example command is invalid" ))
3232 arguments = command.drop(1 )
3333 process <- ZIO .acquireRelease(
3434 Command (executable, arguments* )
@@ -48,9 +48,9 @@ object Execute {
4848
4949 def makeRunCommandProcess (example : CodeExample ) = {
5050 for {
51- exampleFilePath <- ZIO .fromOption(example.filepath).orElseFail(RunFailure (s " Example has no path for its content " ))
52- workingDir <- ZIO .fromOption(exampleFilePath.parent).orElseFail(RunFailure (s " Example file path content has no parent directory " ))
53- absoluteFileName <- exampleFilePath.toAbsolutePath.orElseFail(RunFailure (s " Example absolute file path error " ))
51+ exampleFilePath <- ZIO .fromOption(example.filepath).orElseFail(RunFailure (" Example has no path for its content" ))
52+ workingDir <- ZIO .fromOption(exampleFilePath.parent).orElseFail(RunFailure (" Example file path content has no parent directory" ))
53+ absoluteFileName <- exampleFilePath.toAbsolutePath.orElseFail(RunFailure (" Example absolute file path error" ))
5454 command <- ZIO
5555 .from(
5656 example.runWith
@@ -65,8 +65,8 @@ object Execute {
6565
6666 def makeTestCommandProcess (example : CodeExample ) = {
6767 for {
68- exampleFilePath <- ZIO .fromOption(example.filepath).orElseFail(RunFailure (s " Example has no path for its content " ))
69- workingDir <- ZIO .fromOption(exampleFilePath.parent).orElseFail(RunFailure (s " Example file path content has no parent directory " ))
68+ exampleFilePath <- ZIO .fromOption(example.filepath).orElseFail(RunFailure (" Example has no path for its content" ))
69+ workingDir <- ZIO .fromOption(exampleFilePath.parent).orElseFail(RunFailure (" Example file path content has no parent directory" ))
7070 command <- ZIO .succeed(example.testWith.getOrElse(s " sleep ${timeoutDuration.getSeconds()}" ).trim.split(" \\ s+" ).toList)
7171 results <- makeCommandProcess(command, workingDir) @@ annotated(" example-test-command" -> command.mkString(" " ))
7272 } yield results
@@ -79,7 +79,7 @@ object Execute {
7979 runEffect = makeRunCommandProcess(example).disconnect
8080 .timeout(timeoutDuration)
8181 testEffect = makeTestCommandProcess(example)
82- .filterOrFail(result => result.exitCode == 0 )(RunFailure (s " test code is failing " ))
82+ .filterOrFail(result => result.exitCode == 0 )(RunFailure (" test code is failing" ))
8383 .retry(Schedule .exponential(100 .millis, 2 ).jittered && Schedule .recurs(5 ))
8484 .delay(testStartDelay)
8585 .disconnect
@@ -92,7 +92,7 @@ object Execute {
9292 success = exitCodeOption.exists(_ == 0 ) || (example.shouldFail && exitCodeOption.exists(_ != 0 ))
9393 runState = if timeout then " timeout" else if success then " success" else " failure"
9494 _ <- if (results.isLeft) ZIO .logError(s """ Couldn't execute either run or test part\n ${results.swap.toOption.getOrElse(" " )}""" ) else ZIO .succeed(())
95- _ <- if (! success) ZIO .logWarning(s " example run $runState\n Failed cause: \n $output" ) else ZIO .log(s " example run success " )
95+ _ <- if (! success) ZIO .logWarning(s " example run $runState\n Failed cause: \n $output" ) else ZIO .log(" example run success" )
9696 } yield RunStatus (
9797 example = example,
9898 exitCodeOption = exitCodeOption,
0 commit comments