View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
19927 | Bug reports | Installation | public | 2025-01-09 12:44 | 2025-01-29 16:36 |
Reporter | Ryszard | Assigned To | tibor.pacalat | ||
Priority | none | Severity | block | ||
Status | resolved | Resolution | fixed | ||
Product Version | 6.6.x | ||||
Summary | 19927: postgres and unit tests | ||||
Description | I have installed the latest version of LimeSurvey 6.10.0. As the first step, I ran the unit tests. When using MySQL, all the tests pass successfully (100%). However, when using PostgreSQL, several errors occur. (2 errors, 4 failures) | ||||
Steps To Reproduce | Steps to reproducegit clone Expected resultUnit tests passed: Actual resultThere were 2 errors: 1) ls\tests\LSYiiValidatorsTest::testLanguageFilters There were 4 failures: 1) ls\tests\GroupHelperTest::testQuestionGroupChangeOnActiveSurvey ERRORS! | ||||
Tags | No tags attached. | ||||
Attached Files | postresql unit tests logs.txt (3,023 bytes)
There were 2 errors: 1) ls\tests\LSYiiValidatorsTest::testLanguageFilters CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "" LINE 1: ...ssions.entity='surveysgroups' AND permissions.uid='') LEFT ... ^ /var/www/html/vendor/yiisoft/yii/framework/db/CDbCommand.php:543 /var/www/html/vendor/yiisoft/yii/framework/db/CDbCommand.php:396 /var/www/html/vendor/yiisoft/yii/framework/db/ar/CActiveRecord.php:1359 /var/www/html/application/models/LSActiveRecord.php:77 /var/www/html/vendor/yiisoft/yii/framework/db/ar/CActiveRecord.php:1478 /var/www/html/application/models/SurveysGroups.php:356 /var/www/html/application/models/Survey.php:518 /var/www/html/vendor/yiisoft/yii/framework/base/CModel.php:284 /var/www/html/vendor/yiisoft/yii/framework/base/CModel.php:260 /var/www/html/vendor/yiisoft/yii/framework/base/CModel.php:158 /var/www/html/application/models/Survey.php:969 /var/www/html/tests/unit/LSYiiValidatorsTest.php:296 /var/www/html/vendor/bin/phpunit:122 2) ls\tests\GroupHelperTest::testQuestionGroupChange CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[42703]: Undefined column: 7 ERROR: column "Q03" does not exist LINE 3: WHERE (title = "Q03") AND (sid=194594) ^ /var/www/html/vendor/yiisoft/yii/framework/db/CDbCommand.php:543 /var/www/html/vendor/yiisoft/yii/framework/db/CDbCommand.php:377 /var/www/html/tests/unit/helpers/GroupHelperTest.php:169 /var/www/html/vendor/bin/phpunit:122 -- There were 4 failures: 1) ls\tests\GroupHelperTest::testQuestionGroupChangeOnActiveSurvey Apparently, the question was moved from one group to another, this should not happen in active surveys. Failed asserting that two strings are identical. --- Expected +++ Actual @@ @@ -'error' +'success' /var/www/html/tests/unit/helpers/GroupHelperTest.php:212 /var/www/html/vendor/bin/phpunit:122 2) ls\tests\CPDImportParticpantsTest::testParticipantWithOneAttributeImportedSucessfully Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'http://www.example.com' +'' /var/www/html/tests/unit/helpers/remotecontrol/CPDImportParticpantsTest.php:145 /var/www/html/vendor/bin/phpunit:122 3) ls\tests\CPDImportParticpantsTest::testParticipantUpdatedSuccessfullyWhenUpdateTrue Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'http://www.example.org' +'' /var/www/html/tests/unit/helpers/remotecontrol/CPDImportParticpantsTest.php:194 /var/www/html/vendor/bin/phpunit:122 4) ls\tests\CPDImportParticpantsTest::testParticipantWithOneEncryptedAttributeImportedSucessfully Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'123456789' +'' /var/www/html/tests/unit/helpers/remotecontrol/CPDImportParticpantsTest.php:283 /var/www/html/vendor/bin/phpunit:122 ERRORS! Tests: 558, Assertions: 1643, Errors: 2, Failures: 4, Skipped: 13. | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | '6.10.0' ('') | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | nope | ||||
Database type & version | postgres 15 | ||||
Server OS (if known) | Debian GNU/Linux 12 (bookworm) | ||||
Webserver software & version (if known) | |||||
PHP Version | 8.3 | ||||
Not related to this issue, but if the permission checking returns false, and somehow, there is no user id logged, the query will fail on postgre (as failed during the test). Not sure when the userId could be empty, maybe if called when survey taking? |
|
I think if we call SurveysGroups list dureing survey taking : it's the issue : no need SurveysGroups list during survey taking Else : in this casee : https://github.com/LimeSurvey/LimeSurvey/blob/5159bbf6ec56de7ab75fa8d1aeb225e0366dd382/application/models/Permission.php#L567 we must return an empty array (same for Survey listing) |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2025-01-09 12:44 | Ryszard | New Issue | |
2025-01-09 12:44 | Ryszard | File Added: postresql unit tests logs.txt | |
2025-01-09 12:46 | Ryszard | Issue Monitored: Ryszard | |
2025-01-09 12:46 | Ryszard | Bug heat | 0 => 2 |
2025-01-09 13:20 | tibor.pacalat | Assigned To | => gabrieljenik |
2025-01-09 13:20 | tibor.pacalat | Status | new => assigned |
2025-01-17 20:55 | gabrieljenik | Assigned To | gabrieljenik => DenisChenu |
2025-01-17 20:55 | gabrieljenik | Status | assigned => ready for code review |
2025-01-17 20:55 | gabrieljenik | Note Added: 81841 | |
2025-01-17 20:55 | gabrieljenik | Bug heat | 2 => 4 |
2025-01-20 17:23 | gabrieljenik | Note Added: 81856 | |
2025-01-20 17:37 | DenisChenu | Note Added: 81860 | |
2025-01-20 17:37 | DenisChenu | Bug heat | 4 => 6 |
2025-01-20 17:37 | DenisChenu | Assigned To | DenisChenu => tibor.pacalat |
2025-01-20 17:37 | DenisChenu | Status | ready for code review => ready for testing |
2025-01-29 16:36 | tibor.pacalat | Status | ready for testing => resolved |
2025-01-29 16:36 | tibor.pacalat | Resolution | open => fixed |