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

Add Test Jar for Collate Testing #14010

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions openmetadata-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,17 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,24 @@ public static void createApplication() throws Exception {
sqlContainer.withConnectTimeoutSeconds(240);
sqlContainer.start();

final String flyWayMigrationScripsLocation =
final String flyWayMigrationScriptsLocation =
ResourceHelpers.resourceFilePath("db/sql/migrations/flyway/" + sqlContainer.getDriverClassName());
final String nativeMigrationScripsLocation = ResourceHelpers.resourceFilePath("db/sql/migrations/native/");
final String nativeMigrationScriptsLocation = ResourceHelpers.resourceFilePath("db/sql/migrations/native/");

// Extension Config
String extensionMigrationScripsLocation = "";
try {
extensionMigrationScripsLocation = ResourceHelpers.resourceFilePath("extension/sql/migrations/");
configOverrides.add(
ConfigOverride.config("migrationConfiguration.extensionPath", extensionMigrationScripsLocation));
} catch (Exception ex) {
LOG.info("Extension migrations not found");
}
Flyway flyway =
Flyway.configure()
.dataSource(sqlContainer.getJdbcUrl(), sqlContainer.getUsername(), sqlContainer.getPassword())
.table("DATABASE_CHANGE_LOG")
.locations("filesystem:" + flyWayMigrationScripsLocation)
.locations("filesystem:" + flyWayMigrationScriptsLocation)
.sqlMigrationPrefix("v")
.cleanDisabled(false)
.load();
Expand All @@ -127,8 +137,8 @@ public static void createApplication() throws Exception {
overrideDatabaseConfig(sqlContainer);

// Migration overrides
configOverrides.add(ConfigOverride.config("migrationConfiguration.flywayPath", flyWayMigrationScripsLocation));
configOverrides.add(ConfigOverride.config("migrationConfiguration.nativePath", nativeMigrationScripsLocation));
configOverrides.add(ConfigOverride.config("migrationConfiguration.flywayPath", flyWayMigrationScriptsLocation));
configOverrides.add(ConfigOverride.config("migrationConfiguration.nativePath", nativeMigrationScriptsLocation));

ConfigOverride[] configOverridesArray = configOverrides.toArray(new ConfigOverride[0]);
APP = new DropwizardAppExtension<>(OpenMetadataApplication.class, CONFIG_PATH, configOverridesArray);
Expand All @@ -141,8 +151,8 @@ public static void createApplication() throws Exception {
jdbi,
config,
ConnectionType.from(sqlContainer.getDriverClassName()),
nativeMigrationScripsLocation,
null,
nativeMigrationScriptsLocation,
extensionMigrationScripsLocation,
false);
APP.before();
createClient();
Expand Down
Loading