[QA] Resetting database to original state after tests

Nikolas Everett neverett at wikimedia.org
Wed Mar 5 20:27:28 UTC 2014


I don't know if this is the case for MediaWiki but often the kinds of APIs
that you are talking about aren't possible to implement cleanly without
more effort then just trashing the database and rebuilding it from
scratch.  That whole process is really short for mediawiki.  Not short
enough I'd recommend it between every test but we do it on every submitted
patch just to run tests already.


Having a standing instance that can be burnt down to a base install might
be useful but its not a whole lot different from vagrant which you can
rebuild from scratch in a few minutes.

Nik


On Wed, Mar 5, 2014 at 3:23 PM, Chris McMahon <christopher.mcmahon at gmail.com
> wrote:

>
> I have had a couple of (very preliminary) conversations with Rob Lanphier
> along these lines.
>
> Today we support (for some value of "support") two test environments:
>  beta labs and test2wiki.  What might be possible in the future is to
> support a set of test environments beyond just beta and test2wiki.  (One
> example would be a test environment on bare metal, for performance-test
> reasons.)
>
> I think a beta-esque test env with a db that returns to a snapshot state
> at particular times would be really useful.
>
> -Chris
>
>
> On Wed, Mar 5, 2014 at 12:55 PM, Juliusz Gonera <jgonera at wikimedia.org>wrote:
>
>> Hi,
>>
>> I briefly talked with Kaldari about an idea of having different "modes"
>> or "environments" in MediaWiki. By "modes" I mean something that is usually
>> present in modern web frameworks: production, development and test mode.
>>
>> This could be useful to expose a particular API only in dev and test
>> modes. An API like that could, for example, reset the whole database to its
>> initial state which would be useful for tests for the following reasons:
>>
>> * Using mediawiki_api to clean up after a test (e.g. delete a page
>> created during the test) is prone to errors. We have to remember to do it
>> and when we do, we'll end up with weird Cucumber steps like "And the page X
>> is deleted after the test" which don't really belong to tests.
>>
>> * Deleting some things might be either really hard or impossible. I don't
>> think there is an API for deleting users.
>>
>> Obviously, we'd need a dedicated MW instance for those tests, possibly
>> one that could not be accessed externally. We also would not be able to run
>> all the tests in production, but I think that's fine.
>>
>> What do you think? I could draft an RFC and post to wikitech if you like
>> the idea.
>>
>> --
>> Juliusz
>>
>> _______________________________________________
>> QA mailing list
>> QA at lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/qa
>>
>
>
> _______________________________________________
> QA mailing list
> QA at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/qa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20140305/da93c8f0/attachment.html>


More information about the QA mailing list