#1380958: Replace $modules list for WebTestBase::setUp() with ::$modules class properties changed how tests declare which modules they depend on. See the change record.

First, assign the issue to yourself, both on the issue and by editing your name into this issue summary table.

For each test class:

  1. Find the setUp() method.
  2. If it passes parent::setUp() an array of modules, add the following at the top of the class, above any other methods or properties:
    <?php
    class FooBase extends WebTestBase {
     
    /**
       * Modules to enable.
       *
       * @var array
       */
     
    public static $modules = array();
    ?>

    Make sure there is a blank line between the class declaration and the docblock.

  3. Note which modules are passed to parent::setUp(), and move them to the $modules array above. Do not remove parent::setUp(); just remove its parameters.
  4. Move any documentation about the enabled modules (in either an inline comment or a docblock) to the docblock for $modules instead.
  5. If the setUp() method is empty except for this line, remove it completely.

You can use this bash command to find relevant setUp() methods: grep -nr "parent::setUp([^)]" *

Module/Directory Assigned Issue link
profiles directory tim.plunkett #1711436: Convert testing profile tests to use ::$modules property instead of parent::setUp($modules)
aggregator module kid_icarus #1711274: Convert aggregator tests to use ::$modules property instead of parent::setUp($modules)
block module kid_icarus #1711286: Convert block tests to use ::$modules property instead of parent::setUp($modules)
book module kid_icarus #1711290: Convert book tests to use ::$modules property instead of parent::setUp($modules)
color module kid_icarus #1711296: Convert color tests to use ::$modules property instead of parent::setUp($modules)
comment module kid_icarus #1711298: Convert comment tests to use ::$modules property instead of parent::setUp($modules)
config module kid_icarus #1711304: Convert config tests to use ::$modules property instead of parent::setUp($modules)
contact module kid_icarus #1711306: Convert contact tests to use ::$modules property instead of parent::setUp($modules)
contextual module kid_icarus #1711308: Convert contextual tests to use ::$modules property instead of parent::setUp($modules)
dblog module kid_icarus #1711310: Convert dblog tests to use ::$modules property instead of parent::setUp($modules)
entity module kid_icarus #1711312: Convert entity tests to use ::$modules property instead of parent::setUp($modules)
field module kid_icarus #1711316: Convert field tests to use ::$modules property instead of parent::setUp($modules)
field_ui module kid_icarus #1711314: Convert field_ui tests to use ::$modules property instead of parent::setUp($modules)
file module zendoodles #1711344: Convert file tests to use ::$modules property instead of parent::setUp($modules)
filter module kid_icarus #1711346: Convert filter tests to use ::$modules property instead of parent::setUp($modules)
forum module kid_icarus #1711348: Convert forum tests to use ::$modules property instead of parent::setUp($modules)
help module kid_icarus #1711350: Convert help tests to use ::$modules property instead of parent::setUp($modules)
image module zendoodles #1711352: Convert image tests to use ::$modules property instead of parent::setUp($modules)
language module tim.plunkett #1711356: Convert language tests to use ::$modules property instead of parent::setUp($modules)
locale module cam8001 #1711394: Convert locale tests to use ::$modules property instead of parent::setUp($modules)
menu module zendoodles #1711396: Convert menu tests to use ::$modules property instead of parent::setUp($modules)
node module tim.plunkett #1710300: Convert node tests to use ::$modules property instead of parent::setUp($modules)
openid module tim.plunkett #1711398: Convert openid tests to use ::$modules property instead of parent::setUp($modules)
overlay module N/A N/A
path module kid_icarus #1711400: Convert path tests to use ::$modules property instead of parent::setUp($modules)
php module kid_icarus #1711402: Convert php tests to use ::$modules property instead of parent::setUp($modules)
poll module kid_icarus #1711404: Convert poll tests to use ::$modules property instead of parent::setUp($modules)
rdf module kid_icarus #1711408: Convert rdf tests to use ::$modules property instead of parent::setUp($modules)
search module xjm #1711418: Convert search tests to use ::$modules property instead of parent::setUp($modules)
shortcut module droplet #1711410: Convert shortcut tests to use ::$modules property instead of parent::setUp($modules)
simpletest module tim.plunkett #1711412: Convert simpletest tests to use ::$modules property instead of parent::setUp($modules)
statistics module droplet #1711414: Convert statistics tests to use ::$modules property instead of parent::setUp($modules)
syslog module kid_icarus #1711416: Convert syslog tests to use ::$modules property instead of parent::setUp($modules)
system module cam8001 #1711424: Convert system tests to use ::$modules property instead of parent::setUp($modules)
taxonomy module xjm #1711426: Convert taxonomy tests to use ::$modules property instead of parent::setUp($modules)
toolbar module N/A N/A
tracker module tim.plunkett #1711428: Convert tracker tests to use ::$modules property instead of parent::setUp($modules)
translation module droplet #1711430: Convert translation tests to use ::$modules property instead of parent::setUp($modules)
update module droplet #1711432: Convert update tests to use ::$modules property instead of parent::setUp($modules)
user module tim.plunkett #1711434: Convert user tests to use ::$modules property instead of parent::setUp($modules)
xmlrpc module droplet #1711440: Convert xmlrpc tests to use ::$modules property instead of parent::setUp($modules)

Once all those are done, commit #1711076: Remove setUp as a means of enabling modules

Files: 
CommentFileSizeAuthor
#14 drupal-1711070-14.patch261.62 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 39,980 pass(es).
[ View ]
#14 interdiff.txt1.37 KBtim.plunkett
#12 drupal-1711070-12.patch260.25 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] 38,217 pass(es), 27 fail(s), and 10 exception(s).
[ View ]
#10 drupal-1711070-10.patch260.12 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: PHP Fatal error encountered during run_tests.sh. See review log for details..
[ View ]
#8 drupal-1711070-8.patch259.19 KBtim.plunkett
PASSED: [[SimpleTest]]: [MySQL] 39,977 pass(es).
[ View ]
#5 drupal-1711070-5.patch259.08 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal-1711070-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Issue summary:View changes

put ol around steps

Title:[meta] Convert tests to use ::$modules instead of ::setUp($modules)[meta] Convert tests to use ::$modules property instead of parent::setUp($modules)
Issue tags:+Novice, +Testing system

Thanks! Slightly adjusting title and tagging.

Issue summary:View changes

added #1711076

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

added kid_icarus

Issue summary:View changes

added instruction about assigning

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Added kid_icarus to comment module

Issue summary:View changes

Added kid_icarus to config module

Issue summary:View changes

Added kid_icarus to contact module

Issue summary:View changes

Added kid_icarus to contextual module

Issue summary:View changes

Added kid_icarus to entity module

Issue summary:View changes

Added kid_icarus to field module

Issue summary:View changes

Added kid_icarus to field_ui module

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Added kid_icarus to filter module

Issue summary:View changes

Added kid_icarus to forum module

Issue summary:View changes

Added kid_icarus to help module

Issue summary:View changes

Added kid_icarus to php module

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Updated the summary with instructions that conform to our coding standards from http://drupal.org/node/1354#classes.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

.

Issue summary:View changes

Assigned myself to the locale module.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Updated issue summary.

Issue summary:View changes

Assigned myself to system.module.

Is there any way we could get just one mega-patch with all of these? This is currently clobbering the RTBC queue with 500 issues that are each going to take 1-2 minutes to process.

Should we wait till they are all RTBC individually, then roll the patches up together?

Issue summary:View changes

Assigned kid_icarus to path module

StatusFileSize
new259.08 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch drupal-1711070-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

All but three of the issues were RTBC, and I personally reviewed and finished those.

Here's the whole thing.

Title:[meta] Convert tests to use ::$modules property instead of parent::setUp($modules)Convert tests to use ::$modules property instead of parent::setUp($modules)
Assigned:Unassigned» tim.plunkett
Status:Active» Needs review

Status:Needs review» Needs work

The last submitted patch, drupal-1711070-5.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new259.19 KB
PASSED: [[SimpleTest]]: [MySQL] 39,977 pass(es).
[ View ]

I also need to roll in #1711076: Remove setUp as a means of enabling modules, waiting for the bot in case I need to clean anything else up.

StatusFileSize
new260.12 KB
FAILED: [[SimpleTest]]: [MySQL] Failed to run tests: PHP Fatal error encountered during run_tests.sh. See review log for details..
[ View ]

This should be the final patch.

Since this was split over many issues, here is the list of people to give credit to:

kid_icarus, tim.plunkett, xjm, droplet, zendoodles and cam8001

Status:Needs review» Needs work

The last submitted patch, drupal-1711070-10.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new260.25 KB
FAILED: [[SimpleTest]]: [MySQL] 38,217 pass(es), 27 fail(s), and 10 exception(s).
[ View ]

Forgot to instantiate $modules in WebTestBase.

Status:Needs review» Needs work

The last submitted patch, drupal-1711070-12.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new1.37 KB
new261.62 KB
PASSED: [[SimpleTest]]: [MySQL] 39,980 pass(es).
[ View ]

My grep search failed! Adjusted to grep -nr "::setUp([^)]" * and caught another one.

CommentNodeAccessTest was doing some weird stuff in avoiding CommentTestBase, I cleaned that up.

One more reminder for committers!
This is the list of those who worked on the individual issues:

kid_icarus, tim.plunkett, xjm, droplet, zendoodles and cam8001

Status:Needs review» Fixed

I did a quick check of the avoid commit conflicts tag and only found two open issues, one for D7 and the other that's NW.

Committed and pushed to 8.x. Thanks a bunch!

The change notice was already covered in the other issue, so this should be able to be just fixed.

Automatically closed -- issue fixed for 2 weeks with no activity.