Wikia/app — pull request #2770 by kvas-damian (2014-02-13 14:50:44+00:00)
Title: CON-542 | Fast and local phpunit test suite

**Please, don't merge before 01/24/14**, we're collecting feedback.

Fast test suite is a way to run only those tests that are faster than x amount of time. Right now this threshold was set to 10ms per test case (this number can be adjusted in future), by that currently we are able to *run 748 tests in less than 10sec*. Additionally we removed dependency on DB and memcache from our phpunit running stack and now we're able to run unit tests on local machine (more info below).

**Some technical informations:**
* Slow tests were marked in code by adding group ```Slow``` in docblock for that function, additional Annotator script puts there execution time.
* Tests that are using DB were marked with group ```UsingDB``` manually

**Running fast test suite**
In ```tests``` directory type in ```./php-fast```

**Updating threshold for testsAnnotator**
This number can be found in https://github.com/Wikia/app/blob/CON-542/includes/wikia/tests/core/WikiaTestSpeedAnnotator.class.php#L4

**Running testsAnnotator**
To enable testsAnnotator you need to set environment variable to ```1``` and then run full tests suite.
````
ANNOTATE_TEST_SPEED=1 ./php-all
````

**Running unit tests on local machine**
We've run phpunit tests locally only on linux machines, requirements:
* php 5.4+
* phpunit http://phpunit.de/
* modified test_helpers - https://github.com/Wikia/php-test-helpers
* runkit http://php.net/manual/en/book.runkit.php
* config ( https://github.com/Wikia/config ) repo cloned into /usr/wikia/source/config

Please ping me if you run it on Windows :)

**Future**
Part of tests that were marked as slow aren't **unit** tests because they're using response from not mocked objects. That's why they need to be reworked or marked as integration tests.