-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix migration dev center schema dump by run db-specific initializatio…
…n script (#18984) * Run db-specific initialization script * Refactor code * Use constants * Add unit test for dev center
- Loading branch information
Showing
15 changed files
with
103 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...b/src/test/java/io/airbyte/db/instance/configs/ConfigsDatabaseMigrationDevCenterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.db.instance.configs; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import io.airbyte.commons.io.IOs; | ||
import io.airbyte.db.instance.DatabaseConstants; | ||
import io.airbyte.db.instance.development.MigrationDevCenter; | ||
import java.nio.file.Path; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class ConfigsDatabaseMigrationDevCenterTest { | ||
|
||
/** | ||
* This test ensures that the dev center is working correctly end-to-end. If it fails, it means | ||
* either the migration is not run properly, or the database initialization is incorrect in the dev | ||
* center implementation. | ||
*/ | ||
@Test | ||
void testSchemaDump() { | ||
final MigrationDevCenter devCenter = new ConfigsDatabaseMigrationDevCenter(); | ||
final String schemaDump = IOs.readFile(Path.of(DatabaseConstants.CONFIGS_SCHEMA_DUMP_PATH)); | ||
assertEquals(schemaDump.trim(), devCenter.dumpSchema(false)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
.../db-lib/src/test/java/io/airbyte/db/instance/jobs/JobsDatabaseMigrationDevCenterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.db.instance.jobs; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import io.airbyte.commons.io.IOs; | ||
import io.airbyte.db.instance.DatabaseConstants; | ||
import io.airbyte.db.instance.development.MigrationDevCenter; | ||
import java.nio.file.Path; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class JobsDatabaseMigrationDevCenterTest { | ||
|
||
/** | ||
* This test ensures that the dev center is working correctly end-to-end. If it fails, it means | ||
* either the migration is not run properly, or the database initialization is incorrect. | ||
*/ | ||
@Test | ||
void testSchemaDump() { | ||
final MigrationDevCenter devCenter = new JobsDatabaseMigrationDevCenter(); | ||
final String schemaDump = IOs.readFile(Path.of(DatabaseConstants.JOBS_SCHEMA_DUMP_PATH)); | ||
assertEquals(schemaDump.trim(), devCenter.dumpSchema(false)); | ||
} | ||
|
||
} |
Oops, something went wrong.