Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve unit tests #8150

Merged
merged 5 commits into from Jun 19, 2015
Merged

Improve unit tests #8150

merged 5 commits into from Jun 19, 2015

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Jun 19, 2015

In the process of getting rid of UnitTestCase that sets up a complete environment, I have changed all tests that extend it:

  • those that were real unit tests are now extending PHPUnit_Framework_TestCase
  • those that were using the global state are moved to integration tests

As a result unit tests are much faster (not because there are less tests, but because there is never an environment set up. To give an idea a test class extending UnitTestCase would run in 2-5s, and without it would run in 100ms.

Locally unit tests have gone from 21s to 6s (no xdebug, no-globals-backup). Judging from travis integration tests are not longer.

The build is green, only UI tests are failing.

@mnapoli mnapoli added c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Jun 19, 2015
@mnapoli mnapoli added this to the 2.14.0 milestone Jun 19, 2015
mnapoli added a commit that referenced this pull request Jun 19, 2015
@mnapoli mnapoli merged commit 740cb5e into master Jun 19, 2015
@mnapoli mnapoli deleted the unit-tests branch June 19, 2015 11:52
@mattab
Copy link
Member

mattab commented Jun 22, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants