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

Ensure that class-index is up-to-date after toggling extensions #24774

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

port #24743

@civibot
Copy link

civibot bot commented Oct 20, 2022

(Standard links)

@civibot civibot bot added the 5.54 label Oct 20, 2022
@totten
Copy link
Member

totten commented Oct 21, 2022

Interesting that those failures occur on 5.54-stable but not 5.55-rc. I skimmed the commit log (git log origin/5.54..origin/5.55 -- CRM/Extension/), and perhaps c76bdfc makes the difference?

eileenmcnaughton and others added 4 commits October 25, 2022 11:02
This fixes an issue in E2E testing. Suppose you have a test like this:

  1: function testFoo() {
  2:   civicrm_api3('Extension', 'enable', ['key' => 'foo']);
  3:   assertTrue(Civi::container()->has('foo_service'));
  4:   civicrm_api3('Extension', 'disable', ['key' => 'foo']);
  5:   assertFalse(Civi::container()->has('foo_service'));
  6: }

The assertion at line 5 would fail -- because the 'disable' step did not
fully reset the `Container`.  This problem could then apply to anything that
lives in the container, such as the dispatcher and its listeners.

There is test-coverage in `mixin/scan-classes@1/example` and
`E2E_Shimmy_LifecycleTest::testLifecycleWithLocalFunctions()`.
The test doesn't specifically mention `Container`, but it focuses on one
important service (*the dispatcher*) that lives in the container.

I'm not sure if the problem affected headless tests.
@eileenmcnaughton
Copy link
Contributor Author

I've added c76bdfc per the above

@eileenmcnaughton
Copy link
Contributor Author

@totten this is passing now - should be mergeable

@totten totten merged commit 57ed26a into civicrm:5.54 Oct 27, 2022
@totten totten deleted the class_index branch October 27, 2022 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants