Problem/Motivation

follow-up from #3318625: Remove active composer fixture files in UpdaterFormTest
Remove the staged composer metadata fixture files in\Drupal\Tests\automatic_updates_extensions\Functional\UpdaterFormTest

Steps to reproduce

Proposed resolution

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

kunal.sachdev created an issue. See original summary.

kunal.sachdev’s picture

tedbow’s picture

Issue summary: View changes

kunal.sachdev’s picture

Issue tags: +sprint
kunal.sachdev’s picture

Assigned: Unassigned » kunal.sachdev
kunal.sachdev’s picture

In \Drupal\Tests\automatic_updates_extensions\Functional\UpdaterFormTest $this->container->get('event_dispatcher')->addListener(PreApplyEvent::class, $listener, PHP_INT_MAX); is not working.

wim leers’s picture

That's because you're in a functional test and any container modifications you make only happen to the test runner, not the tested system: your test is making requests to the tested system, so if you want additional things to happen when an event is fired, that code must be installed in the tested site, so that it runs when you make a request.

wim leers’s picture

Title: Remove staged composer fixture files in UpdaterFormTest » [PP-1] Remove staged composer fixture files in UpdaterFormTest
Status: Active » Postponed

#8 addressed one small piece, but not the underlying problem. Discussed that with @tedbow, this is now blocked on #3322913: Create an easy way for functional tests to simulate an update (and update kernel tests to use the same).

wim leers’s picture

Title: [PP-1] Remove staged composer fixture files in UpdaterFormTest » Remove staged composer fixture files in UpdaterFormTest
Status: Postponed » Needs work
kunal.sachdev’s picture

StatusFileSize
new771.79 KB

\Drupal\Tests\automatic_updates_extensions\Functional\UpdaterFormTest::testDisplayUpdates is failing locally with error

Failed asserting that 0 is equal to 2 or is greater than 2.
 /Users/kunal.sachdev/www/d9-autoupdates/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
 /Users/kunal.sachdev/www/d9-autoupdates/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
 /Users/kunal.sachdev/www/d9-autoupdates/modules/contrib/automatic_updates/package_manager/tests/src/Traits/PackageManagerBypassTestTrait.php:32
 /Users/kunal.sachdev/www/d9-autoupdates/modules/contrib/automatic_updates/automatic_updates_extensions/tests/src/Functional/UpdaterFormTest.php:427
 /Users/kunal.sachdev/www/d9-autoupdates/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

and I tried to do page debug which outputs
Only local images are allowed.

kunal.sachdev’s picture

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

Issue tags: +core-mvp
tedbow’s picture

Component: Code » Automatic Updates Extensions
Issue tags: -core-mvp +contrib-only
kunal.sachdev’s picture

Assigned: Unassigned » wim leers
wim leers’s picture

Title: Remove staged composer fixture files in UpdaterFormTest » Remove automatic_updates_extensions/tests/fixtures/stage_composer in favor of using StageFixtureManipulator
Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community

🥳🥳🥳
19 files +5 -307

automatic_updates_extensions/tests/fixtures/stage_composer simply does not exist anymore, so the goal of the issue summary has definitely been met 😄

(Clarifying the issue title though — that was less clear than the issue summary.)

tedbow’s picture

I just removed `\Drupal\Tests\automatic_updates\Functional\AutomaticUpdatesFunctionalTestBase::useFixtureDirectoryAsActive` which is no longer used. Leaving RTBC

tedbow’s picture

I also noticed that `\Drupal\Tests\automatic_updates\Functional\AutomaticUpdatesFunctionalTestBase::useFixtureDirectoryAsActive` is only used 1 place so we could remove that in a follow-up

tedbow’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

tedbow’s picture

Issue tags: -contrib-only +core-mvp

Tagging this as core-mvp because removing the unused `useFixtureDirectoryAsActive` would have needed for core-mvp

wim leers’s picture

#21++

Status: Fixed » Closed (fixed)

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