Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ import org.scalatest.{Inside, Inspectors, OptionValues}
case class EnvironmentDefinition(
override val baseConfig: SpliceConfig,
override val testingConfig: TestingConfigInternal = TestingConfigInternal(),
// preSetup and setup run *after* the apps have started, but before tests run.
// preAppStart runs before the apps are started.
preAppStart: SpliceTestConsoleEnvironment => Unit = _ => (),
val preSetup: SpliceTestConsoleEnvironment => Unit = _ => (),
val setup: SpliceTestConsoleEnvironment => Unit = _ => (),
override val teardown: Unit => Unit = _ => (),
Expand Down Expand Up @@ -174,8 +177,7 @@ case class EnvironmentDefinition(
participants: SpliceTestConsoleEnvironment => Seq[ParticipantClientReference]
): EnvironmentDefinition = {
copy(
preSetup = implicit env => {
this.preSetup(env)
preAppStart = implicit env => {
participants(env).foreach { p =>
p.synchronizers.list_connected().foreach { connected =>
val currentVettedPackages = p.topology.vetted_packages.list(
Expand Down Expand Up @@ -471,15 +473,17 @@ case class EnvironmentDefinition(
override def createTestConsole(
environment: SpliceEnvironment,
loggerFactory: NamedLoggerFactory,
): TestConsoleEnvironment[SpliceConfig, SpliceEnvironment] =
new SpliceConsoleEnvironment(
): TestConsoleEnvironment[SpliceConfig, SpliceEnvironment] = {
val env = new SpliceConsoleEnvironment(
environment,
new TestConsoleOutput(loggerFactory),
) with TestEnvironment[SpliceConfig] {
override lazy val actorSystem = super[TestEnvironment].actorSystem
override val actualConfig: SpliceConfig = this.environment.config

}
this.preAppStart(env)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this, but avoids touching canton fork code

env
}
}

object EnvironmentDefinition extends CommonAppInstanceReferences {
Expand Down
Loading