AnsweredAssumed Answered

Unit tests under Sugar 8 - Jenkins and cas_id field

Question asked by Humberto Ribeiro de Souza on May 24, 2018
Latest reply on Jun 4, 2018 by Humberto Ribeiro de Souza

Hi, 

 

We started to update our Unit tests for SugarCRM 8. However, we are facing some issues. 
They are of utmost importance in order to have the same calculation in the new version.
We use Jenkins as a CI/CD tool. We have an issue so far. It is related to DB. Probably I missed some step here. Should I update something on my tests folder, apart from the PHP and Database versions, and the composer included components?

 

I will post the log of the error we are facing now. 

 

Thank you in advance.

 

---------------
LOG
---------------
PHP Notice: Undefined index: activity_streams_enabled in /usr/local/apache2/htdocs/humberto/sugar8/include/entryPoint.php on line 196
PHP Warning: Declaration of SugarTestDatabaseMock::getOne($sql, $dieOnError = false, $msg = '') should be compatible with DBManager::getOne($sql, $dieOnError = false, $msg = '', $encode = true) in /usr/local/apache2/htdocs/humberto/sugar8/tests/SugarTestDatabaseMock.php on line 273
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.

 

Runtime: PHP 7.1.17
Configuration: /usr/local/apache2/htdocs/humberto/sugar8/tests/phpunit.xml

 

ERRRRRFRRFRRRRFRRFRRRRFRRFRRFFFFFFRERRE 39 / 39 (100%)

 

Time: 25.09 minutes, Memory: 94.00MB

 

There were 3 errors:

 

1) VG_hooksTest::testBeanListLoaded
Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing 'SELECT pmse_bpm_thread.cas_thread_index FROM pmse_bpm_thread WHERE (cas_id=) AND (pmse_bpm_thread.deleted = ?)' with params [0]:

 

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND (pmse_bpm_thread.deleted = ?)' at line 1

 

/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:90
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:128
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:855
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php:120
/usr/local/apache2/htdocs/humberto/sugar8/src/Dbal/Connection.php:63
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:206
/usr/local/apache2/htdocs/humberto/sugar8/include/SugarQuery/SugarQuery.php:683
/usr/local/apache2/htdocs/humberto/sugar8/include/SugarQuery/SugarQuery.php:651
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSECaseFlowHandler.php:714
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSECaseFlowHandler.php:473
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEFlowRouter.php:220
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEExecuter.php:418
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEPreProcessor/PMSEPreProcessor.php:309
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSEAbstractRequestHandler.php:66
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSEHookHandler.php:80
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSEHookHandler.php:101
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSELogicHook.php:29
/usr/local/apache2/htdocs/humberto/sugar8/include/utils/LogicHook.php:280
/usr/local/apache2/htdocs/humberto/sugar8/include/utils/LogicHook.php:167
/usr/local/apache2/htdocs/humberto/sugar8/data/SugarBean.php:6774
/usr/local/apache2/htdocs/humberto/sugar8/data/SugarBean.php:1901
/usr/local/apache2/htdocs/humberto/sugar8/include/SugarObjects/templates/company/Company.php:40
/usr/local/apache2/htdocs/humberto/sugar8/tests/SugarTestAccountUtilities.php:47
/usr/local/apache2/htdocs/humberto/sugar8/tests/modules/METRO_visites_generale/clients/base/views/record/record.php:26
/usr/local/apache2/htdocs/humberto/sugar8/tests/SugarTestHelper.php:295
/usr/local/apache2/htdocs/humberto/sugar8/vendor/phpunit/phpunit/phpunit:52

 

Caused by
Doctrine\DBAL\Driver\Mysqli\MysqliException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND (pmse_bpm_thread.deleted = ?)' at line 1

 

/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php:120
/usr/local/apache2/htdocs/humberto/sugar8/src/Dbal/Mysqli/Connection.php:49
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:844
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php:120
/usr/local/apache2/htdocs/humberto/sugar8/src/Dbal/Connection.php:63
/usr/local/apache2/htdocs/humberto/sugar8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:206
/usr/local/apache2/htdocs/humberto/sugar8/include/SugarQuery/SugarQuery.php:683
/usr/local/apache2/htdocs/humberto/sugar8/include/SugarQuery/SugarQuery.php:651
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSECaseFlowHandler.php:714
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSECaseFlowHandler.php:473
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEFlowRouter.php:220
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEExecuter.php:418
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEPreProcessor/PMSEPreProcessor.php:309
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSEAbstractRequestHandler.php:66
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSEHookHandler.php:80
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSEHandlers/PMSEHookHandler.php:101
/usr/local/apache2/htdocs/humberto/sugar8/modules/pmse_Inbox/engine/PMSELogicHook.php:29
/usr/local/apache2/htdocs/humberto/sugar8/include/utils/LogicHook.php:280
/usr/local/apache2/htdocs/humberto/sugar8/include/utils/LogicHook.php:167
/usr/local/apache2/htdocs/humberto/sugar8/data/SugarBean.php:6774
/usr/local/apache2/htdocs/humberto/sugar8/data/SugarBean.php:1901
/usr/local/apache2/htdocs/humberto/sugar8/include/SugarObjects/templates/company/Company.php:40
/usr/local/apache2/htdocs/humberto/sugar8/tests/SugarTestAccountUtilities.php:47
/usr/local/apache2/htdocs/humberto/sugar8/tests/modules/METRO_visites_generale/clients/base/views/record/record.php:26
/usr/local/apache2/htdocs/humberto/sugar8/tests/SugarTestHelper.php:295
/usr/local/apache2/htdocs/humberto/sugar8/vendor/phpunit/phpunit/phpunit:52

Outcomes