In our migration integration test we used the com.noumenadigital.platform.engine.testing.DBConfig what is the replacement? There is nothing in the documentation
For an in-memory migration, you don’t need the DB config
val migrationHome = File("../../../../npl/src/main")
val engine = EngineMigrationTester(
migrationHome,
MigrationInMemoryTestConfiguration()
)
https://documentation.noumenadigital.com/tools/migrations/testing/#example
I figured it out. I need a persistent migration test and need to use
val config =
MigrationDBTestConfiguration(
systemUnderAudit = "ZEV",
party = "ckw",
testDbConfig =
TestDBConfig(
dbUrl = getenv("ENGINE_DB_URL"),
dbSchema = getenv("ENGINE_DB_SCHEMA"),
dbUser = getenv("ENGINE_DB_USER"),
dbPass = getenv("ENGINE_DB_PASSWORD"),
dbSsl = dbSsl,
),
)
But next issue:
[ERROR] check migration from 141_0 to 142_0 Time elapsed: 0.585 s <<< ERROR!
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
SQL State : 42704
Error Code : 0
Message : ERROR: role "read_model" does not exist
Where: SQL statement "revoke all privileges on table platform.flyway_schema_history from read_model;"
PL/pgSQL function read_model_grants(text,text) line 13 at EXECUTE
Do I need to start the read model also?
Thank you for figuring it out and reporting it, we will include it in the docs. A ticket has been created.
In the database setup, the recommended configuration is described in the system topology > database setup page
https://documentation.noumenadigital.com/deployment/system-topology/#database-setup
Granted that your starting image comes from before the renaming from postgraphile to read model, and the database setup maybe even the addition of the original version of the read model, you might have to create the roles somehow.
I believe the issue with read_model role (changes) comes from the assumption that every customer was using it.
If I remember correctly, you’ve recently had a similar issue with the imaginary password you needed to feed in…
I’d suggest to create a dummy read_model role, as described in the docs:
System topology - Noumena Documentation?
somewhat related, we’ve opened a ticket to support optionality of read model, which would, as a side effect, also speed up the migrations…
I want to get them to start deploying read-model and inspector ASAP, so introducing the read-model as necessary for the migration integration tests is a start to this process
The read model is nice on its own, and a robust party model would be a great pairing
My base image is 2024.2.3, so after the renaming.
Can someone help me with why the read-model is getting this error:
read-model-1 | No READ_MODEL_ISSUER_OVERRIDE set, using default value
read-model-1 | Waiting for the following endpoint(s) to become healthy: http://engine:12000/actuator/health
read-model-1 | Starting the Read Model on :15000
read-model-1 | A serious error occurred when building the initial schema. Exiting because `retryOnInitFail` is not set. Error details:
read-model-1 |
read-model-1 | error: password authentication failed for user "reader"
maybe correct the password here?
READ_MODEL_DB_URL: "postgres://reader:postgres@platform-db:5432/engine"
to
READ_MODEL_DB_URL: "postgres://reader:imaginary_password1@platform-db:5432/engine"
also, not sure if the entire URL is correct, is the DB name engine?
That looks like it; the db name is wrong