Problem/Motivation
in #3274830: Make ProjectInfo work with legacy version numbers we added \Drupal\Tests\automatic_updates\Kernel\ProjectInfoTest::setReleaseMetadataForProjects() to ensure that requests for the update XML, which return our test XML files, does not rely on request order but rather the path of the request, which changes per project.
Proposed resolution
we should just change `\Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase::setReleaseMetadata` to do this and get rid of \Drupal\Tests\automatic_updates\Kernel\ProjectInfoTest::setReleaseMetadataForProjects()
So, to clarify, right now we do stuff like this in kernel tests:
$this->setReleaseMetadata([__DIR__ . '/../../fixtures/release-history/drupal.9.8.2.xml']);
What would be better is to do what \Drupal\Tests\automatic_updates\Kernel\ProjectInfoTest::setReleaseMetadataForProjects() does, where we specifically say "for this project, return this release metadata". So, I'd like to see something like this:
$this->setReleaseMetadata([
'drupal' => __DIR__ . '/../../fixtures/release-history/drupal.9.8.2.xml',
]);
Remaining tasks
- Move the approach taken by ProjectInfoTest::setReleaseMetadataForProjects() into AutomaticUpdatesKernelTestBase::setReleaseMetadata(), and update its doc comment to reflect the way it now works.
- Change ProjectInfoTest to use setReleaseMetadata(), and remove setReleaseMetadataForProjects().
- Change all the calls to setReleaseMetadata() in our kernel tests to use the new format.
Issue fork automatic_updates-3275316
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
Comment #2
tedbowComment #3
phenaproximaUpdating the issue summary to more carefully explain the requested change here.
Comment #4
kunal.sachdev commentedComment #6
kunal.sachdev commentedComment #7
phenaproximaJust a small typo fix. RTBC otherwise!
Comment #8
phenaproximaLooks great to me. Thanks @kunal.sachdev!
Comment #9
phenaproximaComment #10
phenaproximaRe-titling for clarity.
Comment #12
phenaproximaMerged into 8.x-2.x. Thanks!