@@ -86,27 +86,23 @@ final class ZTestRunnerJVM(val args: Array[String], val remoteArgs: Array[String
86
86
private [sbt] def tasksZ (
87
87
defs : Array [TaskDef ],
88
88
console : zio.Console
89
- )(implicit trace : Trace ): Array [ZTestTask [ExecutionEventSink ]] = {
89
+ )(implicit trace : Trace ): Array [ZTestTask [Any ]] = {
90
90
val testArgs = TestArgs .parse(args)
91
91
92
92
renderer = testArgs.testRenderer // Ensures summary is pretty in same style as rest of the test output
93
- val sharedSinkLayer = ExecutionEventSink .live(console, testArgs.testEventRenderer)
94
93
95
94
val specTasks : Array [ZIOSpecAbstract ] = defs.map(disectTask(_, testClassLoader))
96
95
val sharedLayerFromSpecs : ZLayer [Any , Any , Any ] =
97
96
(Scope .default ++ ZIOAppArgs .empty) >>> specTasks
98
97
.map(_.bootstrap)
99
98
.foldLeft(ZLayer .empty: ZLayer [ZIOAppArgs , Any , Any ])(_ +!+ _)
100
99
101
- val sharedLayer : ZLayer [Any , Any , ExecutionEventSink ] =
102
- sharedLayerFromSpecs +!+ sharedSinkLayer
103
-
104
- val runtime : Runtime .Scoped [ExecutionEventSink ] =
105
- zio.Runtime .unsafe.fromLayer(sharedLayer)(Trace .empty, Unsafe .unsafe)
100
+ val runtime =
101
+ zio.Runtime .unsafe.fromLayer(sharedLayerFromSpecs)(Trace .empty, Unsafe .unsafe)
106
102
107
103
shutdownHook = Some (() => runtime.unsafe.shutdown()(Unsafe .unsafe))
108
104
109
- defs.map(ZTestTask (_, testClassLoader, sendSummary, testArgs, runtime))
105
+ defs.map(ZTestTask (_, testClassLoader, sendSummary, testArgs, runtime, console ))
110
106
}
111
107
112
108
private def disectTask (taskDef : TaskDef , testClassLoader : ClassLoader ): ZIOSpecAbstract = {
@@ -127,19 +123,21 @@ final class ZTestTask[T](
127
123
sendSummary : SendSummary ,
128
124
testArgs : TestArgs ,
129
125
spec : ZIOSpecAbstract ,
130
- runtime : zio.Runtime [T ]
131
- ) extends BaseTestTask (taskDef, testClassLoader, sendSummary, testArgs, spec, runtime)
126
+ runtime : zio.Runtime [T ],
127
+ console : zio.Console
128
+ ) extends BaseTestTask (taskDef, testClassLoader, sendSummary, testArgs, spec, runtime, console)
132
129
133
130
object ZTestTask {
134
131
def apply [T ](
135
132
taskDef : TaskDef ,
136
133
testClassLoader : ClassLoader ,
137
134
sendSummary : SendSummary ,
138
135
args : TestArgs ,
139
- runtime : zio.Runtime [T ]
136
+ runtime : zio.Runtime [T ],
137
+ console : zio.Console
140
138
): ZTestTask [T ] = {
141
139
val zioSpec = disectTask(taskDef, testClassLoader)
142
- new ZTestTask (taskDef, testClassLoader, sendSummary, args, zioSpec, runtime)
140
+ new ZTestTask (taskDef, testClassLoader, sendSummary, args, zioSpec, runtime, console )
143
141
}
144
142
145
143
private def disectTask (taskDef : TaskDef , testClassLoader : ClassLoader ): ZIOSpecAbstract = {
0 commit comments