Bug 1308925

Summary: Support MariaDB in engine tests
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Edson Tirelli <etirelli>
Status: CLOSED EOL QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.3.0CC: kverlaen, lpetrovi, rrajasek
Target Milestone: ER3   
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:08:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Winkler 2016-02-16 13:24:35 UTC
Description of problem:

Drools and jBPM engine tests do not support MariaDB:

- org.drools.persistence.util.PersistenceUtil
- org.jbpm.persistence.util.PersistenceUtil

I would like to ask about the SQL scripts [1] and [2]: 

It seems that SQL scripts are defined for each hibernate dialect (and NOT for each database). Since MySQL and MariaDB share the same Hibernate dialect, is it safe to assume that the same SQL script would be used for both?

Based on that decision, we might need to revisit [3].

[1] https://github.com/droolsjbpm/jbpm/tree/master/jbpm-installer/db/ddl-scripts
[2] https://github.com/droolsjbpm/jbpm/tree/master/jbpm-installer/db/upgrade-scripts
[3] https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/src/test/java/org/jbpm/persistence/scripts/util/TestsUtil.java#L78

Version-Release number of selected component (if applicable):
BRMS 6.3.0 DR1

Steps to Reproduce:
1. run drools/jbpm tests with MariaDB

Actual results:
Datasource cannot be created.

Expected results:
Datasource is created successfully.

Comment 1 Marek Winkler 2016-02-16 13:51:54 UTC
I see that

- org.drools.persistence.util.PersistenceUtil
- org.jbpm.persistence.util.PersistenceUtil

no longer exist on master (but do on 6.4.x). Would backporting the change from master be possible?

Comment 2 Marek Winkler 2016-02-16 13:55:05 UTC
I see that the class PersistenceUtil has been moved to kie-test-util on master.

Comment 3 Marek Winkler 2016-02-16 14:02:55 UTC
Created PR adding support for MariaDB to engine tests: https://github.com/droolsjbpm/drools/pull/649

The question about DDL scripts is still open.

Comment 5 Petr Široký 2016-03-17 22:30:37 UTC
Marek, am I assuming correctly that we need the same change in https://github.com/droolsjbpm/jbpm/blob/master/jbpm-persistence-jpa/src/test/java/org/jbpm/persistence/util/PersistenceUtil.java#L181 ? Since jBPM does not (yet) use the PersistenceUtil from kie-test-util, but rather has its own copy.

Comment 6 Marek Winkler 2016-03-18 06:34:14 UTC
Petr, yes, we need it there as well, thanks!

Comment 7 Petr Široký 2016-03-21 18:43:37 UTC
Fixed in Drools and jBPM repos. This should hopefully be enough. Marek, if you could double check there isn't anything missing, that would be great.

Commits (6.4.x):
https://github.com/droolsjbpm/drools/commit/a4205d786efb
https://github.com/droolsjbpm/jbpm/commit/613301ccbe8f

Commits (master):
https://github.com/droolsjbpm/drools/commit/1bd53e663d40
https://github.com/droolsjbpm/jbpm/commit/b9b0758c00f8

Comment 8 Marek Winkler 2016-04-01 13:51:54 UTC
The changes have helped, but it seems we have missed one more occurrence [1]. Sorry for not getting to this sooner.

[1] https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/test/java/org/jbpm/services/task/identity/DBUserGroupCallbackImplTest.java

Comment 9 Petr Široký 2016-04-04 22:40:34 UTC
Fixed the (hopefully) last occurrence.

6.4.x:
https://github.com/droolsjbpm/jbpm/commit/4f25f93f37142985

master:
https://github.com/droolsjbpm/jbpm/commit/4d1ef8d51be4cdce

Comment 10 Marek Winkler 2016-04-18 13:08:11 UTC
Verified in BRMS 6.3.0 ER3.