I was looking into a different issue that I wanted to submit a patch for, and I noticed that the unit tests are currently failing. I noticed the following issues:
RootPackageBuilderTest.php
$this->assertCount(2, $root_package['repositories']);
This fails due to test item 3 in the fixture not having any requirements. This means it gets bypassed in RootPackageBuilder at the below section, and only one repository gets added:
if (empty($extension_package['name']) || ((empty($extension_package['require']) && empty($extension_package['require-dev'])))) {
// Each package must have a name and at least one requirement.
continue;
}
ExtensionDiscoveryTest.php
This fails during setUp
due to the fix implemented for #2473969: composer drupal-rebuild fails with "Required prefix configuration is missing". That said, I'm not sure WHY it fails, as the configuration is set in BaseExtensionDiscovery
, and I'd assume the test would use that configuration as it's testing that class.
Comment | File | Size | Author |
---|---|---|---|
#2 | composer_manager-failing_tests_latest_dev-2551145-1.patch | 2.55 KB | chapabu |
Comments
Comment #2
chapabu CreditAttribution: chapabu as a volunteer commentedI've attached a patch that gets all tests passing again. I added a fourth test extension package in
RootPackageBuilderTest.php
as I didn't really want to have to refactor the other tests in case we ended up with false positives. This is also the reason the new test extension has the same contents as$extension_packages['test2']
.I also had to amend line 131 in
RootPackageBuilderTest.php
, as$extension_packages['test3']
gets bypassed as per the issue summary.I'm not 100% convinced that the fix in
ExtensionDiscoveryTest.php
is the right way to go. It feels like it should be a mock.Comment #3
chapabu CreditAttribution: chapabu as a volunteer commentedComment #5
bojanz CreditAttribution: bojanz at Centarro commentedBig thanks for the test fixes!
I'm fine with the current state of the patch, I just tweaked a code comment.