Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rhkp committed Dec 18, 2024
1 parent 0be3e14 commit 634ade2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 29 deletions.
2 changes: 1 addition & 1 deletion packages/kogito-db-migrator-tool/env/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env");

module.exports = composeEnv([require("@kie-tools/root-env/env")], {
module.exports = composeEnv([require("@kie-tools/root-env/env"), require("@kie-tools/maven-base/env")], {
vars: varsWithName({}),
get env() {
return {
Expand Down
9 changes: 2 additions & 7 deletions packages/kogito-db-migrator-tool/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require("

setupMavenConfigFile(
`
--batch-mode
-Dstyle.color=always
-Drevision=${env.devDeploymentQuarkusApp.version}
-Dversion.quarkus=${env.versions.quarkus}
-Dversion.org.kie.kogito=${env.versions.kogito}
-Drevision=${env.kogitoDBMigratorTool.version}
-Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()}
`,
{ ignoreDefault: true } // Can't have special <repositories> configuration that only works inside this repo.
`
);
1 change: 1 addition & 0 deletions packages/kogito-db-migrator-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"build:prod": "pnpm pre-build && run-script-os",
"build:prod:darwin:linux": "mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)",
"build:prod:win32": "pnpm powershell \"mvn clean install `-DskipTests=$(build-env tests.run --not) `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)\"",
"install": "node install.js",
"pre-build": "mvn dependency:unpack"
},
"dependencies": {
Expand Down
7 changes: 1 addition & 6 deletions packages/kogito-db-migrator-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<modelVersion>4.0.0</modelVersion>
<groupId>org.kie.kogito</groupId>
<artifactId>sonataflow-db-migrator</artifactId>
<artifactId>kogito-db-migrator-tool</artifactId>

<dependencies>
<dependency>
Expand Down Expand Up @@ -61,11 +61,6 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
package org.kie.kogito.postgresql.migrator;

import io.quarkus.test.Mock;
import org.junit.Rule;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand All @@ -33,8 +31,6 @@
import static org.mockito.Mockito.times;

class DBMigratorTest {
@Rule
final ExpectedSystemExit exitRule = ExpectedSystemExit.none();

@Mock
MigrationService migrationService;
Expand All @@ -55,7 +51,6 @@ void testMigratorWithNoMigrations() throws Exception {
dbMigrator.migrateDataIndex = false;
dbMigrator.migrateJobsService = false;

exitRule.expectSystemExitWithStatus(0);
dbMigrator.run();
verify(dbConnectionChecker, times(0)).checkDataIndexDBConnection();
verify(dbConnectionChecker, times(0)).checkJobsServiceDBConnection();
Expand All @@ -70,7 +65,6 @@ void testMigratorWithAllMigrations() throws Exception {
dbMigrator.dbConnectionChecker = dbConnectionChecker;
dbMigrator.service = migrationService;

exitRule.expectSystemExitWithStatus(0);
dbMigrator.run();
verify(dbConnectionChecker, times(1)).checkDataIndexDBConnection();
verify(dbConnectionChecker, times(1)).checkJobsServiceDBConnection();
Expand All @@ -87,7 +81,6 @@ void testDataIndexMigrationWithException() throws Exception {

doThrow(new SQLException()).when(dbConnectionChecker).checkDataIndexDBConnection();

exitRule.expectSystemExitWithStatus(-1);
dbMigrator.run();
verify(migrationService, times(0)).migrateDataIndex();
verify(migrationService, times(0)).migrateJobsService();
Expand All @@ -102,7 +95,6 @@ void testJobsServiceWithException() throws Exception {

doThrow(new SQLException()).when(dbConnectionChecker).checkJobsServiceDBConnection();

exitRule.expectSystemExitWithStatus(-2);
dbMigrator.run();
verify(migrationService, times(0)).migrateDataIndex();
verify(migrationService, times(0)).migrateJobsService();
Expand Down
7 changes: 0 additions & 7 deletions packages/maven-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
<version.org.kie.j2cl.tools.yaml.mapper>0.4</version.org.kie.j2cl.tools.yaml.mapper>
<version.j2cl.maven.plugin>0.23.0</version.j2cl.maven.plugin>
<version.jacoco.maven.plugin>0.8.12</version.jacoco.maven.plugin>
<version.com.github.stefanbirkner.systemrules>1.19.0</version.com.github.stefanbirkner.systemrules>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -265,12 +264,6 @@
<version>${version.org.mockito}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>${version.com.github.stefanbirkner.systemrules}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 634ade2

Please sign in to comment.