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

dev/core#2895 - Failing test demonstrating case token not resolved #21815

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

demeritcowboy
Copy link
Contributor

Overview

https://lab.civicrm.org/dev/core/-/issues/2895

Before

Sending a case email to a person added to the receipient list after opening the form fails to render case tokens.

After

Sending a case email to a person added to the receipient list after opening the form fails to render case tokens. (See #21801)

Technical Details

This test is against master so should fail until 5.43 is merged up to include 21801

Comments

Has test

@civibot
Copy link

civibot bot commented Oct 13, 2021

(Standard links)

@civibot civibot bot added the master label Oct 13, 2021
@eileenmcnaughton
Copy link
Contributor

test this please

@demeritcowboy
Copy link
Contributor Author

The test fail seems to be real. I can see it passes after #21801 but then it chokes during tearDown(), and the cause is that commit. I mean the test must be doing something that's no longer compatible after that commit. The actual error is:

UPDATE  `civicrm_setting`  SET `name` = 'customPHPPathDir' , `value` = NULL , `domain_id` = 1 , `is_domain` = 1 , `created_date` = 20211013073924 , `created_id` = 18   WHERE (  `civicrm_setting`.`id` = 5 )
[nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_tests_dev`.`civicrm_setting`, CONSTRAINT `FK_civicrm_setting_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]

8 ...\vendor\pear\db\DB\common.php(1234): DB_mysqli->simpleQuery("UPDATE  `civicrm_setting`  SET `name` = 'customPHPPathDir' , `value` = NULL ,...")
9 ...\packages\DB\DataObject.php(2696): DB_common->query("UPDATE  `civicrm_setting`  SET `name` = 'customPHPPathDir' , `value` = NULL ,...")
10 ...\packages\DB\DataObject.php(1539): DB_DataObject->_query("UPDATE  `civicrm_setting`  SET `name` = 'customPHPPathDir' , `value` = NULL ,...")
11 ...\CRM\Core\DAO.php(640): DB_DataObject->update()
12 ...\Civi\Core\SettingsBag.php(431): CRM_Core_DAO->save()
13 ...\Civi\Core\SettingsBag.php(263): Civi\Core\SettingsBag->setDb("customPHPPathDir", NULL)
14 ...\Civi\Core\SettingsBag.php(247): Civi\Core\SettingsBag->set("customPHPPathDir", NULL)
15 ...\CRM\Core\Config\MagicMerge.php(368): Civi\Core\SettingsBag->revert("customPHPPathDir")
16 ...\tests\phpunit\CiviTest\CiviUnitTestCase.php(2148): CRM_Core_Config_MagicMerge->__unset("customPHPPathDir")
17 ...\tests\phpunit\CiviTest\CiviCaseTestCase.php(115): CiviUnitTestCase->customDirectories((Array:1))
18 phar:.../phpunit8/phpunit/Framework/TestCase.php(923): CiviCaseTestCase->tearDown(

@demeritcowboy
Copy link
Contributor Author

The order of teardown in the parent seems backwards. It truncates the contact table and then calls stuff that needs the logged-in user's contact record to exist. It didn't come up before because it already failed before reaching that point. But I don't know why it doesn't come up elsewhere that uses this parent - maybe something about the form-object-iness of this test.

@eileenmcnaughton
Copy link
Contributor

thanks @demeritcowboy

@eileenmcnaughton eileenmcnaughton merged commit 48aaa68 into civicrm:master Oct 13, 2021
@demeritcowboy demeritcowboy deleted the case-token branch October 13, 2021 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants