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

Fix(Core): Renamed Task241009CreatePostgresJobQueueTables because of dates inconsistencies with previous tasks preventing the task to run #31000

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* implementation. This task creates the job_queue, job, and job_history tables along with their
* associated indexes.
*/
public class Task241009CreatePostgresJobQueueTables implements StartupTask {
public class Task241220CreatePostgresJobQueueTables implements StartupTask {

@Override
public boolean forceRun() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
import com.dotmarketing.startup.runonce.Task240513UpdateContentTypesSystemField;
import com.dotmarketing.startup.runonce.Task240530AddDotAIPortletToLayout;
import com.dotmarketing.startup.runonce.Task240606AddVariableColumnToWorkflow;
import com.dotmarketing.startup.runonce.Task241009CreatePostgresJobQueueTables;
import com.dotmarketing.startup.runonce.Task241220CreatePostgresJobQueueTables;
import com.dotmarketing.startup.runonce.Task241013RemoveFullPathLcColumnFromIdentifier;
import com.dotmarketing.startup.runonce.Task241014AddTemplateValueOnContentletIndex;
import com.dotmarketing.startup.runonce.Task241015ReplaceLanguagesWithLocalesPortlet;
Expand Down Expand Up @@ -572,11 +572,11 @@ public static List<Class<?>> getStartupRunOnceTaskClasses() {
.add(Task240513UpdateContentTypesSystemField.class)
.add(Task240530AddDotAIPortletToLayout.class)
.add(Task240606AddVariableColumnToWorkflow.class)
.add(Task241009CreatePostgresJobQueueTables.class)
.add(Task241013RemoveFullPathLcColumnFromIdentifier.class)
.add(Task241014AddTemplateValueOnContentletIndex.class)
.add(Task241015ReplaceLanguagesWithLocalesPortlet.class)
.add(Task241016AddCustomLanguageVariablesPortletToLayout.class)
.add(Task241016AddCustomLanguageVariablesPortletToLayout.class)
.add(Task241220CreatePostgresJobQueueTables.class)
.build();
return ret.stream().sorted(classNameComparator).collect(Collectors.toList());
}
Expand Down
5 changes: 2 additions & 3 deletions dotcms-integration/src/test/java/com/dotcms/MainSuite2b.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
import com.dotmarketing.startup.runonce.Task240513UpdateContentTypesSystemFieldTest;
import com.dotmarketing.startup.runonce.Task240530AddDotAIPortletToLayoutTest;
import com.dotmarketing.startup.runonce.Task240606AddVariableColumnToWorkflowTest;
import com.dotmarketing.startup.runonce.Task241009CreatePostgresJobQueueTablesTest;
import com.dotmarketing.startup.runonce.Task241220CreatePostgresJobQueueTablesTest;
import com.dotmarketing.startup.runonce.Task241013RemoveFullPathLcColumnFromIdentifierTest;
import com.dotmarketing.startup.runonce.Task241015ReplaceLanguagesWithLocalesPortletTest;
import com.dotmarketing.startup.runonce.Task241016AddCustomLanguageVariablesPortletToLayoutTest;
Expand Down Expand Up @@ -397,8 +397,7 @@
SimpleJUnit4InjectionIT.class,
LegacyJSONObjectRenderTest.class,
Task241013RemoveFullPathLcColumnFromIdentifierTest.class,
Task241009CreatePostgresJobQueueTablesTest.class,

Task241220CreatePostgresJobQueueTablesTest.class,
UniqueFieldDataBaseUtilTest.class,
DBUniqueFieldValidationStrategyTest.class,
Task241013RemoveFullPathLcColumnFromIdentifierTest.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import org.junit.Test;

/**
* Test class for {@link Task241009CreatePostgresJobQueueTables}.
* Test class for {@link Task241220CreatePostgresJobQueueTables}.
* <p>
* This test class ensures that the job queue tables are properly created by the upgrade task.
* <p>
* The test first drops the tables if they exist, then executes the upgrade task and validates that
* the tables were successfully created.
*/
public class Task241009CreatePostgresJobQueueTablesTest extends IntegrationTestBase {
public class Task241220CreatePostgresJobQueueTablesTest extends IntegrationTestBase {

/**
* Initializes the test environment and ensures the job queue tables do not exist.
Expand Down Expand Up @@ -66,8 +66,8 @@ private void dropTablesIfExist() {
}

/**
* Method to test {@link Task241009CreatePostgresJobQueueTables#executeUpgrade()} and
* {@link Task241009CreatePostgresJobQueueTables#forceRun()}.
* Method to test {@link Task241220CreatePostgresJobQueueTables#executeUpgrade()} and
* {@link Task241220CreatePostgresJobQueueTables#forceRun()}.
* <p>
* Given Scenario: The job queue tables do not exist.
* <p>
Expand Down Expand Up @@ -98,8 +98,8 @@ public void executeTaskUpgrade() throws SQLException, DotDataException, DotSecur
}

/**
* Method to test {@link Task241009CreatePostgresJobQueueTables#executeUpgrade()} and
* {@link Task241009CreatePostgresJobQueueTables#forceRun()}.
* Method to test {@link Task241220CreatePostgresJobQueueTables#executeUpgrade()} and
* {@link Task241220CreatePostgresJobQueueTables#forceRun()}.
* <p>
* Given Scenario: The job queue tables do not exist, and the upgrade task is run twice.
* <p>
Expand Down Expand Up @@ -130,7 +130,7 @@ public void executeTaskUpgradeTwice()
// Run the upgrade task again, should not fail
LocalTransaction.wrap(() -> {
try {
final var task = new Task241009CreatePostgresJobQueueTables();
final var task = new Task241220CreatePostgresJobQueueTables();
task.executeUpgrade();
} catch (Exception e) {
final var message = "The upgrade task should not fail when the tables already exist";
Expand All @@ -149,7 +149,7 @@ public void executeTaskUpgradeTwice()
private static void executeUpgradeAndValidate()
throws SQLException, DotDataException, DotSecurityException {

final var task = new Task241009CreatePostgresJobQueueTables();
final var task = new Task241220CreatePostgresJobQueueTables();
final Connection connection = DbConnectionFactory.getConnection();
final DotDatabaseMetaData databaseMetaData = new DotDatabaseMetaData();

Expand Down
Loading