Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migrator-integration-test tests not running #191 #192

Merged
merged 14 commits into from
May 21, 2024
4 changes: 4 additions & 0 deletions .github/workflows/mysql-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
- name: Run Integration tests for ${{ matrix.name }}
run: sbt ++2.13 "integration/testOnly org.apache.pekko.persistence.jdbc.integration.MySQL*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Run Migrator Integration tests for ${{ matrix.name }}
if: matrix.name == 'MySQL'
run: sbt ++2.13 "migratorIntegration/testOnly org.apache.pekko.persistence.jdbc.migrator.integration.MySQL*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
4 changes: 4 additions & 0 deletions .github/workflows/oracle-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
- name: Run Integration tests for ${{ matrix.name }}
run: sbt ++2.13 "integration/testOnly org.apache.pekko.persistence.jdbc.integration.Oracle*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Run Migrator Integration tests for ${{ matrix.name }}
if: matrix.name == 'Oracle'
run: sbt ++2.13 "migratorIntegration/testOnly org.apache.pekko.persistence.jdbc.migrator.integration.Oracle*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
4 changes: 4 additions & 0 deletions .github/workflows/postgres-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
- name: Run Integration tests for ${{ matrix.name }}
run: sbt ++2.13 "integration/testOnly org.apache.pekko.persistence.jdbc.integration.Postgres*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Run Migrator Integration tests for ${{ matrix.name }}
if: matrix.name == 'Postgres'
run: sbt ++2.13 "migratorIntegration/testOnly org.apache.pekko.persistence.jdbc.migrator.integration.Postgres*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
4 changes: 4 additions & 0 deletions .github/workflows/sqlserver-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
- name: Run Integration tests for ${{ matrix.name }}
run: sbt ++2.13 "integration/testOnly org.apache.pekko.persistence.jdbc.integration.SqlServer*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Run Migrator Integration tests for ${{ matrix.name }}
if: matrix.name == 'Postgres'
Roiocam marked this conversation as resolved.
Show resolved Hide resolved
run: sbt ++2.13 "migratorIntegration/testOnly org.apache.pekko.persistence.jdbc.migrator.integration.SqlServer*" ${{ matrix.extraOpts }} -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseJVMCICompiler

- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat-log.sh {} \;
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lazy val `pekko-persistence-jdbc` = project
.in(file("."))
.enablePlugins(ScalaUnidocPlugin)
.disablePlugins(MimaPlugin, SitePlugin)
.aggregate(core, migrator, integration, docs)
Roiocam marked this conversation as resolved.
Show resolved Hide resolved
.aggregate(core, migrator, docs)
.settings(
name := "pekko-persistence-jdbc-root",
publish / skip := true)
Expand Down Expand Up @@ -63,7 +63,7 @@ lazy val migratorIntegration = project
.settings(name := "pekko-persistence-jdbc-migrator-integration", libraryDependencies ++= Dependencies.Libraries)
.settings(publish / skip := true, doc / sources := Seq.empty, Test / fork := true)
.disablePlugins(MimaPlugin, SitePlugin)
.dependsOn(core % "compile->compile;test->test")
.dependsOn(core % "compile->compile;test->test", migrator % "compile->compile;test->test")

lazy val themeSettings = Seq(
pekkoParadoxGithub := Some("https://github.com/apache/pekko-persistence-jdbc"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# SPDX-License-Identifier: Apache-2.0

# Oracle does not support returning a column with a case senstive name so all the column names and table names need
# to be caps. See:
# https://github.com/slick/slick/issues/47
# https://groups.google.com/g/scalaquery/c/U431n-Z2cwM

jdbc-snapshot-store {
tables {

legacy_snapshot {
tableName = "LEGACY_SNAPSHOT"
schemaName = "SYSTEM"
columnNames {
persistenceId = "PERSISTENCE_ID"
sequenceNumber = "SEQUENCE_NUMBER"
created = "CREATED"
snapshot = "SNAPSHOT"
}
}


snapshot {
tableName = "SNAPSHOT"
schemaName = "SYSTEM"
columnNames {
persistenceId = "PERSISTENCE_ID"
sequenceNumber = "SEQUENCE_NUMBER"
created = "CREATED"

snapshotPayload = "SNAPSHOT_PAYLOAD"
snapshotSerId = "SNAPSHOT_SER_ID"
snapshotSerManifest = "SNAPSHOT_SER_MANIFEST"

metaPayload = "META_PAYLOAD"
metaSerId = "META_SER_ID"
metaSerManifest = "META_SER_MANIFEST"
}
}
}
}

jdbc-read-journal {
tables {
event_journal {
tableName = "EVENT_JOURNAL"
schemaName = "SYSTEM"
}
legacy_journal {
tableName = "JOURNAL"
schemaName = "SYSTEM"
}
}
}

jdbc-journal {
tables {
legacy_journal {
tableName = "JOURNAL"
schemaName = "SYSTEM"

columnNames {
ordering = "ORDERING"
deleted = "DELETED"
persistenceId = "PERSISTENCE_ID"
sequenceNumber = "SEQUENCE_NUMBER"
created = "CREATED"
tags = "TAGS"
message = "MESSAGE"
}
}

event_journal {
tableName = "EVENT_JOURNAL"
schemaName = "SYSTEM"

columnNames {
ordering = "ORDERING"
deleted = "DELETED"
persistenceId = "PERSISTENCE_ID"
sequenceNumber = "SEQUENCE_NUMBER"
writer = "WRITER",
writeTimestamp = "WRITE_TIMESTAMP"
adapterManifest = "ADAPTER_MANIFEST"
eventPayload = "EVENT_PAYLOAD"
eventSerId = "EVENT_SER_ID"
eventSerManifest = "EVENT_SER_MANIFEST"
metaPayload = "META_PAYLOAD"
metaSerId = "META_SER_ID"
metaSerManifest = "META_SER_MANIFEST"
}
}

event_tag {
tableName = "EVENT_TAG"
schemaName = "SYSTEM"

columnNames {
eventId = "EVENT_ID"
tag = "TAG"
}
}
}

}

jdbc-durable-state-store {
tables {
durable_state {
tableName = "DURABLE_STATE"
schemaName = "SYSTEM"

columnNames {
globalOffset = "GLOBAL_OFFSET"
persistenceId = "PERSISTENCE_ID"
revision = "REVISION"
statePayload = "STATE_PAYLOAD"
stateSerId = "STATE_SERIAL_ID"
stateSerManifest = "STATE_SERIAL_MANIFEST"
tag = "TAG"
stateTimestamp = "STATE_TIMESTAMP"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'"journal"') AND type in (N'U'))
begin
CREATE TABLE journal (
"ordering" BIGINT IDENTITY(1,1) NOT NULL,
"deleted" BIT DEFAULT 0 NOT NULL,
Expand All @@ -9,16 +7,12 @@ CREATE TABLE journal (
"message" VARBINARY(max) NOT NULL,
PRIMARY KEY ("persistence_id", "sequence_number")
)
CREATE UNIQUE INDEX journal_ordering_idx ON journal (ordering)
end;
CREATE UNIQUE INDEX journal_ordering_idx ON journal (ordering);


IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'"snapshot"') AND type in (N'U'))
CREATE TABLE legacy_snapshot (
"persistence_id" VARCHAR(255) NOT NULL,
"sequence_number" NUMERIC(10,0) NOT NULL,
"created" NUMERIC NOT NULL,
"snapshot" VARBINARY(max) NOT NULL,
PRIMARY KEY ("persistence_id", "sequence_number")
);
end;
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ class MySQLJournalMigratorTest extends JournalMigratorTest("mysql-application.co

class OracleJournalMigratorTest extends JournalMigratorTest("oracle-application.conf") with OracleCleaner

class SqlServerJournalMigratorTest extends JournalMigratorTest("sqlserver-application.conf") with SqlServerCleaner
// ignore this because SQLServer didn't support Slick forceInsert
// class SqlServerJournalMigratorTest extends JournalMigratorTest("sqlserver-application.conf") with SqlServerCleaner
Roiocam marked this conversation as resolved.
Show resolved Hide resolved
56 changes: 0 additions & 56 deletions migrator/src/test/resources/schema/h2/h2-create-schema.sql

This file was deleted.

5 changes: 0 additions & 5 deletions migrator/src/test/resources/schema/h2/h2-drop-schema.sql

This file was deleted.

38 changes: 0 additions & 38 deletions migrator/src/test/resources/schema/mysql/mysql-create-schema.sql

This file was deleted.

This file was deleted.

57 changes: 0 additions & 57 deletions migrator/src/test/resources/schema/oracle/oracle-create-schema.sql

This file was deleted.

Loading
Loading