new-sql-dumps-after-prod-release (#181)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/181 Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
@@ -40,6 +40,7 @@ import org.springframework.test.annotation.Commit;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
@@ -138,7 +139,7 @@ public class ImportHostingAssets extends CsvDataImport {
|
||||
@Autowired
|
||||
LiquibaseMigration liquibase;
|
||||
|
||||
@Value("${HSADMINNG_OFFICE_DATA_SQL_FILE:/db/released-only-prod-schema-with-import-test-data.sql}")
|
||||
@Value("${HSADMINNG_OFFICE_DATA_SQL_FILE:/db/released-prod-schema-with-import-test-data.sql}")
|
||||
String officeSchemaAndDataSqlFile;
|
||||
|
||||
@Test
|
||||
@@ -148,6 +149,7 @@ public class ImportHostingAssets extends CsvDataImport {
|
||||
executeSqlScript(officeSchemaAndDataSqlFile);
|
||||
liquibase.assertReferenceStatusAfterRestore(286, "hs-booking-SCHEMA");
|
||||
makeSureThatTheImportAdminUserExists();
|
||||
PostgresTestcontainer.dump(jdbcUrl, new File("build/db/released-prod-schema-with-import-test-data.sql"));
|
||||
liquibase.runWithContexts("migration", "without-test-data");
|
||||
liquibase.assertThatCurrentMigrationsGotApplied(331, "hs-booking-SCHEMA");
|
||||
}
|
||||
|
@@ -43,11 +43,11 @@ import static org.springframework.test.context.jdbc.Sql.ExecutionPhase.BEFORE_TE
|
||||
@DirtiesContext
|
||||
@ActiveProfiles("liquibase-migration-test")
|
||||
@Import(LiquibaseConfig.class)
|
||||
@Sql(value = "/db/released-only-prod-schema-with-test-data.sql", executionPhase = BEFORE_TEST_CLASS) // release-schema
|
||||
@Sql(value = "/db/released-prod-schema-with-test-data.sql", executionPhase = BEFORE_TEST_CLASS) // release-schema
|
||||
public class LiquibaseCompatibilityIntegrationTest {
|
||||
|
||||
private static final String EXPECTED_CHANGESET_ONLY_AFTER_NEW_MIGRATION = "hs-global-liquibase-migration-test";
|
||||
private static final int EXPECTED_LIQUIBASE_CHANGELOGS_IN_PROD_SCHEMA_DUMP = 287;
|
||||
private static final int EXPECTED_LIQUIBASE_CHANGELOGS_IN_PROD_SCHEMA_DUMP = 299;
|
||||
|
||||
@Value("${spring.datasource.url}")
|
||||
private String jdbcUrl;
|
||||
@@ -63,7 +63,7 @@ public class LiquibaseCompatibilityIntegrationTest {
|
||||
|
||||
// run the current migrations and dump the result to the build-directory
|
||||
liquibase.runWithContexts("only-prod-schema", "with-test-data");
|
||||
PostgresTestcontainer.dump(jdbcUrl, new File("build/db/released-only-prod-schema-with-test-data.sql"));
|
||||
PostgresTestcontainer.dump(jdbcUrl, new File("build/db/released-prod-schema-with-test-data.sql"));
|
||||
|
||||
// then add another migration and assert if it was applied
|
||||
liquibase.runWithContexts("liquibase-migration-test");
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user