-
-
Notifications
You must be signed in to change notification settings - Fork 829
Switch replaceGreetingTokens over #21790
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
Switch replaceGreetingTokens over #21790
Conversation
(Standard links)
|
We just forked but discussed putting the large token-patches into the 'token-release' 5.43 so people only have to focus on one release |
4a286f9
to
b279c15
Compare
Well it seems to be failing really quickly now.... |
d56bbbb
to
f43917d
Compare
f43917d
to
e8935b2
Compare
Currently failing on testApi4CustomEntityACL - still something around caching |
There's also a test failure in
I guess there are a couple potential weak-links in the chain. It could be the mocked entity ("Use a real entity - or make full class for the mock one!"). Or it could be the join-scan ("Writing to one table shouldn't require scanning all tables!"). Or it could have a guard during the scanning ("Only scan extant classes!"). |
@totten ok thanks - let's see how it goes - that feels like a different gotcha to the one I was looking at so if we are lucky it's the same one but I suspect there is more than one |
@totten still not finishing :-( |
28e2281
to
db2f85e
Compare
the worst of the fails seem to be in this zone RUN:[[./scripts/phpunit --tap --log-junit '/home/jenkins/workspace/CiviCRM-Core-PR@2/junit/Civi\AllTests.xml' '--exclude-group' 'ornery' 'Civi\AllTests']] ok 1 - Civi\API\Event\PrepareEventTest::testOnPrepare with data set #0 ('onPrepare_null', array('Widget', 'frobnicate', array(98, 'green', 3)), array('frob[green]')) Installing core21790sdjftest_g5eol databaseok 2 - Civi\API\Event\PrepareEventTest::testOnPrepare with data set #1 ('onPrepare_wrapApi', array('Widget', 'frobnicate', array(98, 'green', 3)), array('frob[go green] and frob[who green]')) |
@eileenmcnaughton - I went to the hardware store to ask if they had a fix for the Fake DAO failures. They offered a sledgehammer, which I pushed up to the branch. |
@totten I think I might cry in the corner for a bit... |
It's finishing! I think the last 3 might be caching within the processor - but it was the first one I got stuck on
api_v3_ACLPermissionTest.testApi4CustomEntityACL |
Yeah, I went poking around
So... (1) i'd wouldn't have thought to test joining from My only theory is some kind of caching issue? Like the mechanism of token-valuation causes some cache to hydrate (or not hydrate), and the same cache is somehow important to the Happy to see some other failures in |
Pushed up a patch which should fix these. Each test registers more hook-listeners, and the hook-listeners aren't getting called at the needful time (due to As for why the PR caused a change... I guess that the test invokes @eileenmcnaughton The patch removes the static-cache because that seemed simple -and because I'm not sure it's frequent enough to need the static-cache. But I'm not wedded to that change. If you can figure a better way, then that's cool. Hopefully this at least points toward the issue. |
@totten so re the static cache - my understanding is that if you had a job or mailing that rendered 5000 messages that function would be called 5000 times. I guess the \Civi tests don't call the function to set up hooks that clears the cache & hence they fail whereas the ones in CRM are happily clearing the static. |
This should fix a failure in `TokenConsistencyTest`. Setting a breakpoint and monitoring `$contactDetails`, it appears that the data would come in multiple formats. (Sometimes as a nested array; sometimes as a flatter array.) This makes it work with both cases.
The tests are being a being a brittle because someone wants to load these non-existent classes: * CRM_Fake_DAO_FakeFile * CRM_Fake_DAO_Widget * CRM_Fake_DAO_Forbidden * CRM_Fake_DAO_Sprocket
66e050d
to
0e3ab56
Compare
Only real fail is the one we want @colemanw to help with -
|
When adding/removing custom groups, the schema map changes. Civi already flushes the metadata cache when this happens, but the APIv4 SchemaMap was being cached in memory (in a container service). This changes it to be stored in the metadata cache like everything else.
Whew @eileenmcnaughton that was a doozy but I think I fixed it. |
@colemanw thanks - I totally think we should merge if this fixes it - |
Also note #21912 is the next in the line of this piece of work - it simplifies the function to set greetings close to the point where we don't have to call this function 3 times to replace 3 tokens |
Yea if all tests pass then I just want to do a little class cleanup - my commit changes some service classes into just-plain-php classes so I should move them out of the |
Nevermind, I tried moving the classes but it wasn't an improvement. |
woohoo! |
I note the latest test run only took 2 hours - which eases my concern that this was slowing stuff down - however - we can still speed it up I think- #21912 is the key step towards that as it gets the update out of that function |
Overview
Another attempt at #21701 - note this replaces
replaceGreetingTokens
but if it works I would then stop calling & deprecate that function & move the love up to processGreetingTemplate & then up one more level@colemanw I'm a bit stuck tracking down an apiv4 caching issue
is failing because the apiv4 cache is loaded before the custom field is added
so this test fails
not ok 602 - Failure: CRM_Contact_Form_Task_AddToGroupTest::testAddToNewGroupWithCustomField
message: new_custom_group.Custom_Field element exists?
severity: fail
Before
legacy call to the hook replace
After
calls the token processor
Technical Details
Comments