From b9f45123693be1169444e2a51fd8d548ce84835c Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Tue, 28 Jan 2025 12:27:33 +0100 Subject: [PATCH] use previous dump as base for a new dump --- ...LiquibaseCompatibilityIntegrationTest.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/migration/LiquibaseCompatibilityIntegrationTest.java b/src/test/java/net/hostsharing/hsadminng/hs/migration/LiquibaseCompatibilityIntegrationTest.java index 385594fd..30ab0505 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/migration/LiquibaseCompatibilityIntegrationTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/migration/LiquibaseCompatibilityIntegrationTest.java @@ -32,14 +32,24 @@ import static org.springframework.test.context.jdbc.Sql.ExecutionPhase.BEFORE_TE *

The test needs a dump, ideally from the version of the lastest prod-release:

* *
    - *
  1. 1. clean the database:
    + *
  2. clean the database:
    * pg-sql-reset + *
  3. * - *
  4. populate the database:
    - * ./gradlew bootRun --args='--spring.profiles.active=only-office' + *
  5. restote the database from latest dump
    + *
    
    + *      docker exec -i hsadmin-ng-postgres psql -U postgres postgres \
    + *          
    + *
  6. + * + *
  7. run the missing migrations:
    + * gw bootRun --args='--spring.profiles.active=only-office' + *
  8. * *
  9. create the reference-schema SQL-file with some initializations:
  10. - *
    cat >src/test/resources/db/prod-only-office-schema-with-test-data.sql <
    + * cat >src/test/resources/db/prod-only-office-schema-with-test-data.sql <
    + * * *
  11. add the dump to that reference-schema SQL-file:

    *
    docker exec -i hsadmin-ng-postgres /usr/bin/pg_dump \
      * --column-inserts --disable-dollar-quoting -U postgres postgres \
      * >>src/test/resources/db/prod-only-office-schema-with-test-data.sql
      * 
    + *
  12. *
* *

The generated dump has to be committed to git and will be used in future test-runs