I'm splitting this off from #319033-23: Weird order of projects listed on updates page because that patch was turning into a huge refactoring of update status tests (originally from #253501: Tests for update.module) just since that bug happened to be the first one we're trying to fix that involves testing update status's handling of contrib modules. The more I think about it, the more we need a more thorough refactoring and redesign of how update status tests work, so I want to just start a new issue for it to work on this. Then we can go back and finish off #319033 with a tiny patch to the code and to add a single new test case. I'll be working on this either later tonight or wednesday during the day, so stay tuned for a patch...
Comment | File | Size | Author |
---|---|---|---|
#5 | 591632-5.update_contrib_tests.patch | 33.54 KB | dww |
#3 | 591632-3.update_contrib_tests.patch | 33.54 KB | dww |
#1 | 591632-1.update_contrib_tests.patch | 33.57 KB | dww |
Comments
Comment #1
dwwA) Splits out shared stuff into a UpdateTestHelper base class that's the parent for both UpdateCoreTestCase and UpdateContribTestCase
B) Adds tons of PHPDoc all over the place.
C) System info is now defined via an array keyed by module or theme name, so you can specify different initial state for each independent module or theme.
D) What to fetch is now defined via an array keyed by project name, and the values in the array indicate the latest available release (e.g. "7_1" for core (version: "7.1"), or "1_0" for contrib ("7.x-1.0" -- the 7.x is irrelevant in the filename). I didn't want to use '.' in there, so the XML files always have the form [project_name].[latest_available].xml.
E) Added a basic test for contrib functionality.
Comment #2
dwwNote to committers, after applying and before committing, you need:
Note: we could also leave out the "7_" part of the core XML files. E.g. just
modules/update/tests/drupal.0.xml
. At least that way the filenames themselves aren't specific to this version of core, which will make it easier to update all of these tests once we make the DRUPAL-7 branch and HEAD becomes 8.x.I was thinking about ways to make these tests easier to "port" to a new version of core, but sadly, it's sort of all about specific version numbers and comparing them. But, we can at least make the filenames themselves not care, which is a start. ;) Thoughts?
Comment #3
dwwI haven't been able to chat to webchick in IRC yet to confirm she agrees with the change, but Dave Reid thought my note in #2 was important, and that it'd be better long term if the filenames didn't have the version of core in them. So, here's a re-roll of #1 without the "7_" in the core XML file names. Otherwise identical. New CVS commands when you're ready to commit:
Comment #5
dwwSorry about that. Now that core's availability scenario can be set to "0", we need isset() instead of !empty() in update_test_mock_page(). ;) Same CVS commands as in #3, this time, all the update status tests actually pass. ;)
Comment #6
chx CreditAttribution: chx commentedLooks better, indeed!
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Comment #8
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD.
Let's move back to the other issue.
Comment #9
dwwYay, thanks, Dries! New patch posted at #319033-25: Weird order of projects listed on updates page