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

Replace SimpleTests with PHPUnit #3227

Closed
sgiehl opened this issue Jun 17, 2012 · 93 comments
Closed

Replace SimpleTests with PHPUnit #3227

sgiehl opened this issue Jun 17, 2012 · 93 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@sgiehl
Copy link
Member

sgiehl commented Jun 17, 2012

This is a ticket related to #1470

We are going to migrate all tests to PHPUnit in order to be able to generate code coverage reports.

Note:

  • Before release, update tests/index output to explain the PHPUnit way
  • Update Jenkins to run the PHPUnit tests
  • Update tests/README.TXT
@mattab
Copy link
Member

mattab commented Jun 19, 2012

I can't wait to see code coverage metrics :) Thank you again for tackling this difficult & long project of converting tests to a new framework!

@sgiehl
Copy link
Member Author

sgiehl commented Jun 19, 2012

Already converted all core and plugin tests in the last few days to run with phpunit. But the integration tests are bit hard to migrate. Most of them are somehow still failing.

@sgiehl
Copy link
Member Author

sgiehl commented Jun 22, 2012

(In [6489]) refs #3227 added first phpunit tests and phpunit xml configuration

@sgiehl
Copy link
Member Author

sgiehl commented Jun 22, 2012

(In [6490]) refs #3227 added more phpunit tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 22, 2012

(In [6491]) refs #3227 added test files

@sgiehl
Copy link
Member Author

sgiehl commented Jun 23, 2012

(In [6493]) refs #3227 added/improved some more tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 23, 2012

(In [6494]) refs #3227 added/improved some more tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 23, 2012

(In [6495]) refs #3227 more and more tests completely converted :)

@sgiehl
Copy link
Member Author

sgiehl commented Jun 24, 2012

(In [6496]) refs #3227 more tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 24, 2012

(In [6497]) refs #3227 more tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 24, 2012

(In [6498]) refs #3227 datatable renderer tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 24, 2012

(In [6499]) refs #3227 more tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 24, 2012

(In [6502]) refs #3227 added first database tests

@sgiehl
Copy link
Member Author

sgiehl commented Jun 26, 2012

(In [6504]) refs #3227 more tests converted to PHPUnit

@sgiehl
Copy link
Member Author

sgiehl commented Jun 28, 2012

(In [6505]) refs #3227 optimized/added phpunit tests

@sgiehl
Copy link
Member Author

sgiehl commented Jul 2, 2012

(In [6507]) refs #3227 fixed some tests

@sgiehl
Copy link
Member Author

sgiehl commented Jul 4, 2012

(In [6508]) refs #3227 fixed tests expecting an exception, as current phpunit version doesn't support expecting standard exceptions

@sgiehl
Copy link
Member Author

sgiehl commented Jul 13, 2012

(In [6511]) refs #3227 added tests for uncovered methods

@sgiehl
Copy link
Member Author

sgiehl commented Jul 15, 2012

(In [6512]) refs #3227 wrote some tests for Piwik_Access / added missing tests for Piwik_Unzip

@sgiehl
Copy link
Member Author

sgiehl commented Jul 23, 2012

(In [6536]) refs #3227 added releasechecklist tests

@sgiehl
Copy link
Member Author

sgiehl commented Jul 23, 2012

(In [6537]) refs #3227 prevent svn to replace the inline $Id's

@sgiehl
Copy link
Member Author

sgiehl commented Jul 25, 2012

(In [6560]) refs #3227 added first versions of some integration tests. there are still many things to be improved. in order to make them running correct the HTTP_HOST config needs to be changed in phpunit.xml. some of the tests aren't running because of encoding problems. I'll maybe have a look at that later

@sgiehl
Copy link
Member Author

sgiehl commented Jul 26, 2012

(In [6566]) refs #3227 added, improved integration tests

@sgiehl
Copy link
Member Author

sgiehl commented Jul 26, 2012

(In [6568]) refs #3227 added more integration tests

@sgiehl
Copy link
Member Author

sgiehl commented Jul 27, 2012

(In [6571]) refs #3227 added another integration test

@mattab
Copy link
Member

mattab commented Jul 27, 2012

Thanks Stefan!! great changes & new features we will benefit with phpunit...

Looking forward to the end of the project, to enjoy PHPUnit fully and also avoid maintaining both test suites which will would be a challenge long term.

@sgiehl
Copy link
Member Author

sgiehl commented Jul 27, 2012

(In [6574]) refs #3227 added integration test

@robocoder
Copy link
Contributor

(In [6582]) refs #3227 - allow devs to have a local, customized phpunit.xml

@mattab
Copy link
Member

mattab commented Jul 29, 2012

Replying to SteveG:

(In [6560]) refs #3227 added first versions of some integration tests. there are still many things to be improved. in order to make them running correct the HTTP_HOST config needs to be changed in phpunit.xml. some of the tests aren't running because of encoding problems. I'll maybe have a look at that later

Would there be any way not to set the HOST in phpunit.xml and automatically read it from HTTP_HOST?

@sgiehl
Copy link
Member Author

sgiehl commented Jul 29, 2012

As PHPUnit is executed in command line mode the HTTP_HOST variable is set to the hosts name. that might not be the same host apache is listening. It might also be possible you need to adjust REQUEST_URI as piwik might not be located in /piwik

@sgiehl
Copy link
Member Author

sgiehl commented Oct 19, 2012

(In [7242]) refs #3227 removing integration simple tests

@sgiehl
Copy link
Member Author

sgiehl commented Oct 19, 2012

(In [7244]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 19, 2012

(In [7245]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 19, 2012

(In [7246]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 19, 2012

(In [7247]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 19, 2012

(In [7248]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 20, 2012

(In [7249]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 20, 2012

(In [7250]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 20, 2012

(In [7251]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 20, 2012

(In [7252]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 20, 2012

(In [7253]) refs #3227 moving integration result files

@sgiehl
Copy link
Member Author

sgiehl commented Oct 27, 2012

(In [7318]) refs #3227 fixing some tests

@mattab
Copy link
Member

mattab commented Nov 12, 2012

Great it looks like it's very close to closing the ticket!

Code Feedback:

  • Can you confirm you have moved the expected files and so they haven't changed during migration?
  • I notice 4 remaining .test.php files to migrate/delete
  • I wonder about Plugins testability and PHPUnit running $pluginX tests files as a new test group (cf email)

Very nice! I cant wait now to enjoy Jenkins+PHPUnit....!

@sgiehl
Copy link
Member Author

sgiehl commented Nov 12, 2012

(In [7456]) refs #3227 removing old benchmark tests

@sgiehl
Copy link
Member Author

sgiehl commented Nov 19, 2012

(In [7487]) refs #3227 improvements to languagemanager tests; now every language is run as a seperate test case

@sgiehl
Copy link
Member Author

sgiehl commented Nov 26, 2012

(In [7548]) refs #3227 migrated one remaining test

@sgiehl
Copy link
Member Author

sgiehl commented Nov 26, 2012

(In [7549]) refs #3227 migrated last remaining test

@sgiehl
Copy link
Member Author

sgiehl commented Nov 28, 2012

(In [7551]) refs #3227 removing remaining simpletest files

@sgiehl
Copy link
Member Author

sgiehl commented Nov 28, 2012

(In [7553]) refs #3227 removed duplicate file

@sgiehl
Copy link
Member Author

sgiehl commented Nov 28, 2012

Migration nearly finished. Last point on the list should now be: the testability of new plugins (having a official plugin directory in mind). But maybe we should create a seperate ticket for that or handle it as soon as it is realy required.

@mattab
Copy link
Member

mattab commented Dec 13, 2012

Ok we will deal with the testability of Plugins in a new ticket. Could you create it, especially if you have some rought ideas on how it could be done with PHPUnit & ant?

Stefan, Kuddos for leading this project to completion! it's such a pleasure working with PHPUnit!

@mattab
Copy link
Member

mattab commented Dec 16, 2012

Milestone 1.8.x Piwik 1.8.x deleted

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

5 participants