The migrate module is still considered an experimental module. As a result, its code and tests have been reviewed less than other more mature code. Attach are changes noted during a review of the tests in core/modules/migrate/tests/src/Unit/*.php. These changes include adding docblocks, missing @param/@var/@return descriptions and a few coding style changes.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | 2621486-25-migrate-tests-src-unit-d8.patch | 29.68 KB | lars toomre |
| #2 | 2621486-2-phpcs-before-after.txt | 30.35 KB | lars toomre |
Comments
Comment #2
lars toomre commentedAttached is an initial patch with changes to core/modules/migrate/tests/src/Unit/*.php to bring them more in compliance with Drupal's coding and documentation standards. This patch has been generated with -U6 switch to give more context to the docblock additions/changes that require review of the method call definition.
Attached also is a text file summarizing the results of running the Drupal standard PHP_CodeSniffer before this patch is applied and the results afterwards. The intent is to also create issues against the Coder module to cover various errors encountered as well as for missing and/or inconsistent sniffs encountered while generating this patch.
Comment #4
lars toomre commentedOn my current development computer, I do not have a testing environment set up. Hence, I cannot run the test suite locally and must rely on the test bot.
From the error report generated by the test bot, I am at a loss on what the problem with the patch in #2 might be. Can someone offer some guidance? Thanks in advance for your assistance.
Comment #5
lars toomre commentedAs I explained in #4, I am unsure what the problem with the patch in #2 is. The error messages from the test bot are not that helpful so I am wondering if somehow I changed the line endings to Windows format. Here is the patch again with each file explicitly set to Unix line endings. Let's see what the test bot says.
Comment #7
lars toomre commentedCreated #2624558: Create sniff for missing @param directive when other @param tags exist to add a sniff for the missing final @param directive in the constructor method of TestSqlIdMap.php
Comment #8
lars toomre commentedLet's try to correct the final two test files. I was glad to see the number of errors drop from 142 to 4.
Comment #9
lars toomre commentedWhoops. Forget to change the status to Needs review.
Comment #11
lars toomre commentedI am really puzzled by why MigrateExecutableTest.php has failed. The only changes to that file are documentation changes. I have saved that file again with Unix line endings so let see what the bot thinks this time.
Comment #13
lars toomre commentedReverted the changes to MigrateExecutableTest.php. I am hoping this version of the patch now passes the test bot.
Comment #15
lars toomre commentedVery puzzling... The patch in #13 does not include any changes to MigrateExecutableTest.php and yet it is that unit test that is failing just like in #11. Anyone have an idea what is going on?
Comment #16
quietone commentedLars Toomre, thx for your fixes. I've found them quite helpful.
Looks like the error is caused by adding the type hint.
Here the error output:
Comment #17
lars toomre commentedThank you @quietone for the tip in #16. This patch removes that type hint and adds back the changes to MigrateExecutableTest.php. Let's see what the test bot thinks now. My fingers are crossed!
Comment #18
benjy commentedLooks pretty good, just one question:
Should't we have one item per line? Is this valid to put 3 items on one line?
Comment #19
lars toomre commentedThanks for the review @benjy. I was unsure about the organization of the sub-arrays in that function. Attached are an interdiff and new patch breaking out each element onto its own line. Let me know if you see any other issues.
Comment #20
benjy commentedGreat, thanks.
Comment #22
lars toomre commentedHere is a re-roll to get the patch to apply again.
Comment #23
quietone commentedSince there was a change I doubled checked and did a diff between the last two patches. I didn't see any issues. And, I agree with benjy, this is great. So, back to RTBC.
Comment #24
alexpottComment #25
lars toomre commentedHere is a re-roll of the patch from #21.
Comment #26
lars toomre commentedBack to RTBC based on #23 and re-rolled patch in #25.
Comment #27
tvb commentedI could apply the patch, so no reroll is needed.
Comment #28
alexpottCommitted 05f8dfc and pushed to 8.0.x and 8.1.x. Thanks!