Problem/Motivation

see https://git.drupalcode.org/project/automatic_updates/-/merge_requests/60...

We may want to use for kernel tests also

But we don't have access to the stage directory in functional tests so it is currently more complicated

Steps to reproduce

Proposed resolution

TBD

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tedbow created an issue. See original summary.

wim leers’s picture

wim leers’s picture

Title: Create an easy for functional tests to simulate an update » Create an easy way for functional tests to simulate an update (and update kernel tests to use the same)

Hopefully this too 🤞

wim leers’s picture

tedbow’s picture

Status: Active » Needs work

This is rough start now to see how this might work.

This relies on trait being shared between a test module and test classes which I am not sure is good idea or can even work. But it does provide the same way to simulate stage changes, updates, adds and removals, in both kernel and functional tests. And removes the need for listeners in kernel tests to make these changes which is complicated and not easy to understand.

wim leers’s picture

Left a bunch of questions to hopefully help shepherd this in a good direction 🤞

tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

Unassigning for myself

@Wim Leers if you want to review that would be good but if you want to wait till I can work on it thats fine to. Feel free to unassign back to me if you would rather

wim leers’s picture

Assigned: wim leers » tedbow
Status: Needs review » Needs work

Responded to all your MR comments 🤓

tedbow’s picture

Assigned: tedbow » wim leers
wim leers’s picture

Assigned: wim leers » tedbow

tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review
tedbow’s picture

@Wim Leers thanks for the long pairing on this.

I started what we discussed. Probably some test with fail. Feel free to look it over to make sure it is what you had in mind. Otherwise I will assign back to myself next time I have a chance to work on it.

wim leers’s picture

Assigned: wim leers » tedbow
1) Drupal\Tests\package_manager\Kernel\FixtureManipulatorTest::testNoCommitExpected
LogicException: This fixture manipulator was not yet ready to commit! Please call setReadyToCommit() to signal all necessary changes are queued.

🤩

Pushed commits that should make this green — the good news is that the test failures force us to structure the tests just as we had discussed! 👍🥳

IMHO this now just needs cleaning up. Either you can do that today and I review it on Monday, or I can do that early on Monday. Either way, we should able to land this on Monday! 😊

tedbow’s picture

Assigned: tedbow » Unassigned
wim leers’s picture

Assigned: Unassigned » tedbow
Status: Needs review » Needs work
tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

See MR comments

wim leers’s picture

Assigned: wim leers » tedbow
Status: Needs review » Reviewed & tested by the community

11 remarks on the MR: a bunch of nits, and just a few celebrations 🤩😄

tedbow’s picture

@Wim Leers thanks. Fixed nits. will merge when green

  • 4b31d57 committed on 8.x-2.x
    Issue #3322913 by tedbow, Wim Leers: Create an easy way for functional...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed

😁🎉

wim leers’s picture

tedbow’s picture

Issue tags: +core-mvp
wim leers’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.