From 96c4b03535218b8bd88bfae858a5bbd1f0931b16 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Mon, 5 Sep 2022 15:26:37 +0200 Subject: [PATCH] Mark some tests as pending for Oracle with legacy dao (#674) * Mark some tests as pending for Oracle with legacy dao * one more --- .../jdbc/query/CurrentEventsByTagTest.scala | 6 ++++++ .../jdbc/query/EventAdapterTest.scala | 4 ++++ .../persistence/jdbc/query/EventsByTagTest.scala | 16 ++++++++++++++++ .../persistence/jdbc/query/QueryTestSpec.scala | 8 ++++++++ 4 files changed, 34 insertions(+) diff --git a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala b/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala index 4e25ddb97..2591349e9 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala +++ b/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala @@ -45,6 +45,8 @@ abstract class CurrentEventsByTagTest(config: String) extends QueryTestSpec(conf } it should "find all events by tag" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => (actor1 ? withTags(1, "number")).futureValue @@ -92,6 +94,8 @@ abstract class CurrentEventsByTagTest(config: String) extends QueryTestSpec(conf } it should "persist and find a tagged event with multiple tags" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => withClue("Persisting multiple tagged events") { @@ -165,6 +169,8 @@ abstract class CurrentEventsByTagTest(config: String) extends QueryTestSpec(conf it should "complete without any gaps in case events are being persisted when the query is executed" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new JavaDslJdbcReadJournalOperations(system) import system.dispatcher withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala b/core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala index 6f487d892..7e89e9b01 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala +++ b/core/src/test/scala/akka/persistence/jdbc/query/EventAdapterTest.scala @@ -74,6 +74,8 @@ abstract class EventAdapterTest(config: String) extends QueryTestSpec(config) { } it should "apply event adapters when querying events by tag from an offset" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => (actor1 ? TaggedEvent(Event("1"), "event")).futureValue @@ -137,6 +139,8 @@ abstract class EventAdapterTest(config: String) extends QueryTestSpec(config) { } it should "apply event adapters when querying all current events by tag" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => (actor1 ? TaggedEvent(Event("1"), "event")).futureValue diff --git a/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala b/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala index d0be014db..239e3f638 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala +++ b/core/src/test/scala/akka/persistence/jdbc/query/EventsByTagTest.scala @@ -48,6 +48,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con } it should "find all events by tag" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => (actor1 ? withTags(1, "number")).futureValue @@ -120,6 +122,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con } it should "deliver EventEnvelopes non-zero timestamps" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val testStartTime = System.currentTimeMillis() val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => @@ -155,6 +159,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con } it should "select events by tag with exact match" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => @@ -195,6 +201,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con it should "find all events by tag even when lots of events are persisted concurrently" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) val msgCountPerActor = 20 val numberOfActors = 100 @@ -224,6 +232,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con } it should "find events by tag from an offset" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new JavaDslJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => (actor1 ? withTags(1, "number")).futureValue @@ -249,6 +259,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con } it should "persist and find tagged event for one tag" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new JavaDslJdbcReadJournalOperations(system) withTestActors() { (actor1, actor2, actor3) => journalOps.withEventsByTag(10.seconds)("one", NoOffset) { tp => @@ -294,6 +306,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con } it should "persist and find tagged events when stored with multiple tags" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => (actor1 ? withTags(1, "one", "1", "prime")).futureValue @@ -371,6 +385,8 @@ abstract class EventsByTagTest(config: String) extends QueryTestSpec(config, con def timeoutMultiplier: Int = 1 it should "show the configured performance characteristics" in withActorSystem { implicit system => + pendingIfOracleWithLegacy() + import system.dispatcher val journalOps = new ScalaJdbcReadJournalOperations(system) withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => diff --git a/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala b/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala index 8d4ab5280..307b86c6a 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala +++ b/core/src/test/scala/akka/persistence/jdbc/query/QueryTestSpec.scala @@ -286,6 +286,14 @@ abstract class QueryTestSpec(config: String, configOverrides: Map[String, Config } } + def pendingIfOracleWithLegacy(): Unit = { + if ( + profile == slick.jdbc.OracleProfile && readJournalConfig.pluginConfig.dao == classOf[ + akka.persistence.jdbc.query.dao.legacy.ByteArrayReadJournalDao].getName + ) + pending // TODO https://github.com/akka/akka-persistence-jdbc/issues/673 + } + def setupEmpty(persistenceId: Int, replyToMessages: Boolean)(implicit system: ActorSystem): ActorRef = { system.actorOf(Props(new TestActor(persistenceId, replyToMessages))) }