diff --git a/CHANGELOG.md b/CHANGELOG.md index 2513a80be2..bfd2eddf99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added capability of SystemParticipants to handle flexibility [#308](https://github.com/ie3-institute/simona/issues/308) - Added smart charging logic [#31](https://github.com/ie3-institute/simona/issues/31) and flex calculation in `EvcsAgent` [#332](https://github.com/ie3-institute/simona/issues/332) - Enhance output quotes of `RunSimona` [#743](https://github.com/ie3-institute/simona/issues/743) +- Printing logs of failed tests [#747](https://github.com/ie3-institute/simona/issues/747) ### Changed - Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index b2c5260199..79b160e703 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -1,27 +1,25 @@ - + %highlight%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n - - OFF - + test/logs/simona/simona_tests.log - test/logs/simona/archive/simona_tests-%d{yyyyMMdd'T'HHmmss}-${bySecond}.log - + test/logs/simona/archive/simona_tests-%d{yyyyMMdd'T'HHmmss}.log + 10 3GB @@ -32,8 +30,30 @@ DEBUG - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala b/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala index ede6b3043b..58f545e21d 100644 --- a/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala +++ b/src/test/scala/edu/ie3/simona/agent/ValueStoreSpec.scala @@ -7,11 +7,10 @@ package edu.ie3.simona.agent import edu.ie3.simona.test.common.UnitSpec -import org.scalatest.PrivateMethodTester import scala.collection.SortedMap -class ValueStoreSpec extends UnitSpec with PrivateMethodTester { +class ValueStoreSpec extends UnitSpec { "An empty value store" should { val emptyValueStore: ValueStore[String] = ValueStore[String](Long.MaxValue) diff --git a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala index 03d3545389..b2f8393ace 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerKafkaSpec.scala @@ -31,8 +31,8 @@ import scala.language.postfixOps class RuntimeEventListenerKafkaSpec extends ScalaTestWithActorTestKit - with KafkaSpecLike with UnitSpec + with KafkaSpecLike with GivenWhenThen with TableDrivenPropertyChecks { private var testConsumer: KafkaConsumer[Bytes, SimonaEndMessage] = _ diff --git a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala index f547693e08..92186149bc 100644 --- a/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala +++ b/src/test/scala/edu/ie3/simona/event/listener/RuntimeEventListenerSpec.scala @@ -24,11 +24,9 @@ import edu.ie3.simona.event.RuntimeEvent.{ Ready, Simulating, } +import edu.ie3.simona.test.common.UnitSpec import edu.ie3.simona.util.TickUtil._ import edu.ie3.util.TimeUtil -import org.scalatest.PrivateMethodTester -import org.scalatest.matchers.should -import org.scalatest.wordspec.AnyWordSpecLike import org.slf4j.event.Level import java.util.concurrent.{LinkedBlockingQueue, TimeUnit} @@ -42,9 +40,7 @@ class RuntimeEventListenerSpec ConfigValueFactory.fromAnyRef("30s"), ) ) - with AnyWordSpecLike - with should.Matchers - with PrivateMethodTester { + with UnitSpec { // global variables val startDateTimeString = "2011-01-01 00:00:00" diff --git a/src/test/scala/edu/ie3/simona/test/common/UnitSpec.scala b/src/test/scala/edu/ie3/simona/test/common/UnitSpec.scala index a61f4b7879..5cbf725051 100644 --- a/src/test/scala/edu/ie3/simona/test/common/UnitSpec.scala +++ b/src/test/scala/edu/ie3/simona/test/common/UnitSpec.scala @@ -6,15 +6,17 @@ package edu.ie3.simona.test.common -import java.util.Locale import com.typesafe.scalalogging.LazyLogging import edu.ie3.simona.test.matchers.{QuantityMatchers, SquantsMatchers} import edu.ie3.util.scala.quantities.{QuantityUtil => PSQuantityUtil} +import org.apache.pekko.actor.testkit.typed.scaladsl.LogCapturing import org.scalatest._ import org.scalatest.matchers.should import org.scalatest.prop.TableDrivenPropertyChecks import org.scalatest.wordspec.AnyWordSpecLike +import java.util.Locale + /** Base class to be used with all scala unit tests. All data that should be * commonly available to all unit tests should be placed here instead of mixing * a lot of traits together. See @@ -28,6 +30,7 @@ trait UnitSpec with QuantityMatchers with SquantsMatchers with AnyWordSpecLike + with LogCapturing with OptionValues with Inside with Inspectors