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.
The system module uses test class members with underscored names. Some examples are big_user, web_user and admin_user, but there could be others. According to our coding conventions, these should be renamed to bigUser, webUser and adminUser. In addition, some properties are undefined but should be.
See the parent issue #1811638: [meta] Clean-up Test members - ensure property definition and use of camelCase naming convention.
Beta phase evaluation
Issue category | Task, because this is a coding standards change. |
---|---|
Issue priority | Not critical because coding standard changes are not critical. |
Unfrozen changes | Unfrozen because it only changes automated tests. |
Disruption | There is no disruption expected from this sort of change. |
Comment | File | Size | Author |
---|---|---|---|
#74 | 2389455_74.patch | 115.58 KB | Mile23 |
#73 | clean_up_system_module-2389455-73.patch | 115.57 KB | AjitS |
#71 | clean_up_system_module-2389455-71.patch | 115.74 KB | hussainweb |
#71 | interdiff.txt | 905 bytes | hussainweb |
#69 | clean_up_system_module-2389455-69.patch | 115.16 KB | hussainweb |
Comments
Comment #1
Mile23phpcs
tells me that there are 293 files with coding standards errors.I went through all of them with netbeansdrupalcomposed and looked for underscore errors and refactored them to be camelCase.
When I found a
var
declaration (not@var
, butvar
), I changed it to public or protected, based on the outcome running the test.MailTest
had an unused private static property calledsent_message
which I deleted.Comment #2
Mile23Comment #4
Mile23Well that certainly didn't work.
Try try again...
Comment #5
Mile23Reverted all files not in
core/modules/system/src/Tests
. NetBeans must have burped on them.Comment #7
Mile23A few false-positives and a few false-negatives, and a
var
that should have beenpublic
instead ofprotected
.Also a rebase since
JavaScriptTest.php
is now history.Comment #8
tibbsa CreditAttribution: tibbsa commentedSome more camelCasing, some undeclared vars, and the removal of a bunch of web_user/admin_user properties that served no purpose.
Comment #11
subhojit777Comment #12
subhojit777Comment #13
subhojit777Patch rerolled
Comment #14
hussainweb@subhojit777: I think you uploaded the same patch as #8 again.
Comment #15
hussainwebThis is a reroll of #8. I think #13 was the same patch as #8 as I couldn't apply it manually.
Comment #16
subhojit777man!!! I rerolled the patch but didnt obtained the diff, and uploaded the old one. Here is the rerolled patch that should have been uploaded in #13
Comment #17
hussainwebThe patch in #16 is not a correct reroll as it brings back a property which was removed in HEAD (hence the conflict). See the current source of ThemeTest.php and you will find that the property
$strictConfigSchema
is not there, nor in the patch in #8. That patch only adds the$adminUser
property whereas the patch in #16 adds two.Comment #22
Mile23Just in case anyone needs it, here's how to do a reroll: https://www.drupal.org/patch/reroll
It's really rather amazing that with patches of this size, the only changes between #15 and #16 are these:
So apparently #16 only adds that docblock.
Let's re-test #16 and see if the testbot still barks at us. Then we can move forward from there.
Comment #24
hussainweb@Mile23: Yes, it seems like a random failure. And it's not just a docblock, but also a property definition which was removed in HEAD but came back because of the conflict. I will attach patch in #15 again to avoid confusion. I have named it 24 to keep it consistent but it is the same patch as #15.
Comment #25
subhojit777Go this result on execution of command
egrep -rl '\$this\->[a-z]+_[a-z_]+' core/modules/system/src/Tests/
Manually checked those files but variables with underscores were only local variables, so no problem with that. Patch looks good and applied cleanly on the HEAD.
Moving this to RTBC
Comment #28
hussainwebIt was a random failure - database connection failed.
Comment #29
hussainwebBack to RTBC as per #25 after random fail.
Comment #31
hussainwebRerolling
Comment #32
Mile23I would RTBC this but it's my issue and I wrote some of the code.
Still though, phpcs says there aren't any test class property camel case issues.
Comment #36
tibbsa CreditAttribution: tibbsa commentedHave to look back at this and see what is going on. I could not find a previous commit to which patch #31 would apply, so there might be something funky with that.
Comment #37
hussainwebComment #38
Mile23You'll never guess.... It needs a reroll.
Comment #39
hussainwebGuess what? I rerolled again. :P
Comment #40
hussainwebThe last RTBC was over a month ago as per #25. I am letting it be to Needs review as lot might have changed.
Comment #41
Mile23Yup, needs a reroll again.
Comment #42
piyuesh23 CreditAttribution: piyuesh23 commentedComment #43
Ayesh CreditAttribution: Ayesh commentedComment #46
Mile23Yup, that's what 'needs reroll' means. :-)
You can find out if the patch applies by trying to apply it. Re-testing means we lose the information that it passed at a certain date, which makes it harder to reroll.
Comment #47
Ayesh CreditAttribution: Ayesh commentedSorry about that, Mile23.
Attached is a rerolled one that applies to 8.0.x.
Comment #49
AjitSworking on it now
Comment #50
AjitSThe patch is no longer applicable. Will have to reroll it first.
Comment #51
AjitSSeeing if the testbot is able to apply the patch. Will resolve the errors from #47 after that.
Comment #53
AjitSTried to cover all the errors mentioned. Finger's crossed!
Comment #55
AjitSHope, I am doing it right this time :-)
Comment #58
AjitSThe test passes at local, giving it another try.
Comment #60
AjitSI am not sure why the test is failing. I did a quick
egrep -rl '\$this\->[a-z]+_[a-z_]+' core/modules/system/src/Tests/
and found out the one file was missed out from the implementation.I do not think if that was causing the test to fail, but I think it will be worth trying to fix it.
Comment #62
BerdirYou lost a line here in the test, that's causing those test fails. Probably a merge that went wrong.
Hint: Review patches like this with "git diff --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+'" ( I have an alias for this), that makes it much easier to catch the difference there.
Comment #63
AjitS@Berdir Thank you for the review! And also for the tip on reviewing, very helpful. I have also created an alias for the same, and will use it from now on.
Retrying the patch after adding the missed line.
Comment #64
AjitSTa Da! It feels so good! Hope this goes through. I will make any changes suggested.
Comment #65
Mile23Thanks for sticking with it, @AjitS! :-)
Needed a reroll, thanks to changes in EntityCacheTagsTestBase.
Just a reminder that you can use a phpcs one-liner like this one to review patches in this meta: https://gist.github.com/paul-m/bdb4c44ecd1de8f934cd
And according to that, there are no more underscore/camel case errors within the scope of this issue.
Consider this RTBC if the testbot is happy.
Comment #67
Mile23Clearly I got it wrong on EntityCacheTagsTestBase.
Comment #68
hussainwebLooking into this. @Mile23, are you still looking at this? I checked on IRC but couldn't find you.
Comment #69
hussainwebTrying a reroll from #63 again.
Comment #71
hussainwebFixing the failure.
Comment #72
Mile23Sigh... :-)
Comment #73
AjitSRerolling. Hope this finds its way in soon!
Comment #74
Mile23Reroll from #73.
Comment #75
Mile23Setting RTBC so the maintainers can end this death march. :-)
If the test fails, it should set to 'needs work.'
Comment #76
alexpottCommitted f0c731f and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Let's get a followup to remove CacheTestBase and merge its functionality into ClearTest.
Also someone should have created followups to document the undocumented properties.
Comment #78
hussainwebCreated a followup at #2464383: Remove CacheTestBase and merge its functionality into ClearTest.