Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Adding the patch in #40 here: #2105583: Add some sane strictness to phpunit tests to catch risky tests
...we discover some tests that need attention.
$ ./vendor/bin/phpunit -c core --filter ComposerIntegrationTest -v
.R
Time: 13.47 seconds, Memory: 144.00Mb
There was 1 risky test:
1) Drupal\Tests\ComposerIntegrationTest::testAllModulesReplaced
This test did not perform any assertions
ComposerIntegrationTest::testAllModulesReplaced()
makes a few assumptions that don't show up as fails, if you're not running in strict mode.
Mainly that $composerjson->replace
is an array, when it's an object.
Proposed resolution
Fix the test.
Fixing the test leads to a fail, which we also fix here.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff.txt | 1.18 KB | Mile23 |
#9 | 2597644_9.patch | 2.18 KB | Mile23 |
#2 | 2597644_1.patch | 2.18 KB | Mile23 |
#2 | 2597644_1_test_only.patch | 1.76 KB | Mile23 |
Comments
Comment #2
Mile23The test_only patch fixes the test, the other patch makes the test pass.
Comment #3
Mile23Comment #4
Mile23Comment #6
neclimdulNice! After wrapping my head around it I like the modified assertion.
For future reviewers, this is the key change. Fixing the is_dir() so $module_names is correctly populated and the later assertion in the foreach gets run.
Comment #8
tim.plunkettFixable on commit.
Oops, guess I missed this part.
missing space after the cast
Missing spaces around concatenation
Comment #9
Mile23Actually there's a couple more things that are 'fixable on commit' but I'll get them here. :-)
Comment #10
Mile23Resetting to RTBC, since it's just a comment change, and addresses the other coding standards issues. Sorry if that's presumptuous.
Comment #12
neclimdul+1
Comment #13
tstoecklerLooks good to me too, RTBC++
Comment #14
tstoecklerHmm... is there a reason
ComposerIntegrationTest
is not to be found on https://dispatcher.drupalci.org/job/default/25922/console ?Comment #16
neclimdulMaybe you didn't have it expanded to show the full results?
On that run:
00:24:01 Drupal\Tests\ComposerIntegrationTest 2 passes
On the last run:
11:01:58 Drupal\Tests\ComposerIntegrationTest 2 passes
Comment #17
tstoecklerAhh @neclimdul, thanks! I totally missed that. Yes, searching on https://dispatcher.drupalci.org/job/default/25922/consoleFull yields the expected result. Sorry!
Comment #19
catchComment #20
alexpottCommitted 1e0d343 and pushed to 8.0.x. Thanks!