-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Integration testing: list of ideas of improvement #1465
Comments
(In [2877]) Refs #1465 Adding a file that loads and displays in the browser all widgets that are registered in the Piwik install.
|
Random notes: Tracking algorithm could test that
|
Moving "Tracker should set cookies in the request and have a different IP at each request. Test that unique visitors counts is correct." to #1912 |
Are Javascript tests run in Hudson at the moment? I assume they are not, since Webtest doesn't have a proper browser? |
Correct, not running in Hudson. (This is mentioned in #1470.) I'll be looking into using Selenium. |
I've got an idea on how to implement the integration tests for widgets/Controllers. The integration tests could be split up into smaller files similar to:
IntegrationTestBase (or whatever it'll be called) will define a test_main() method that runs tests based on the results of getApiToTest() & getControllersToTest(). I think it could also be possible to simply add a method similar to the callGetApiCompareOutput method, but this would result in less readable code. Sound like a good idea? |
Refactoring Main.test.php in several files would be a good idea for sure. But, maybe this is not required for this feature. For example, the same way we call callGetApiCompareOutput() we could callWidgetsCompareOutput() which would load a given set of widgets (or load ALL widgets) and compare the HTML output with the pre-recorded output. You are welcome to do the refactoring but I wanted to point out the "Direct" way as well ;) |
I thought of the 'direct' way too, but I thought I could kill two birds w/ one stone. |
(In [5666]) Refs #1465. Added ability to test controller actions to integration tests. Added two controller tests, one that tests MultiSites.index & another that tests all testable controller methods. Notes:
|
(In [5667]) Refs #1465. Fixing the build (hopefully). |
(In [5668]) Refs #1465. Refactored integration tests by splitting each individual test in Main.test.php up into separate files. NOTES:
|
capedfuzz, thanks for the improvements and contributions! Code review:
|
Replying to matt:
Right now I added a test that tested all methods, but doesn't compare the widget output (its in the OneVisitorTwoVisits test). This could be changed, but that would mean looking through all the controller output, which I didn't have time for. If you think it'd be ok to assume what's generated right now is correct, I can make the change right now.
That code isn't in tearDown, it's in the createWebsite function.
It's been a bit since I made the changes, so I'll have to look it over again, but I remember only making a few changes to the CsvExport tests (regarding changing the language). Also, the tests all passed w/o modification and I was able to explain the increase in passes. I'll look through the commit to double check, though.
I guess I could add a test group for this? Or maybe just a file like all_tests.php that only looks for integration tests? A little while ago I wrote a small alternative to all_tests.php that ran each test via AJAX so you would be able to run tests individually and see each test's progress after it finished. I was going to email it in case it was useful, but before I do, I could add a way to run all integration tests. |
Please enable this feature for now (I will disable later if need be). You can copy all the widgets output as long as they seem to work and return data.
Perfect idea to add a script to trigger only integration tests. However, if you also enable HTML Widget comparisons, would it make sense to have run_integration_tests script to run either Widget HTML compare, API html compare, or both (which would be the default mode)? Thanks!! |
(In [5739]) * Refs #534 Removing exit_rate from metadata API, it was added in the standard processed metrics causing other reports to display it with 0% values
|
(In [5743]) Refs #1465 Fixes bug that a subset of the previous tests were ignored. |
(In [5747]) Refs #1465. Added all_integration_tests.php script that invokes all integration tests and nothing else, and refactored all_tests.php. Also added the ability to disable API integration tests & modify the widget testing level via the browser. NOTES:
|
Just committed a change that allows you to execute all integration tests, but nothing else. Also, its possible to disable API testing & modify the widget testing level by setting the apiTestingLevel & widgetTestingLevel query params. So, /tests/all_integration_tests.php?apiTestingLevel=none&widgetTestingLevel=compare_output will skip the API tests & compare widget output. These are the possible values for both params:
|
(In [5752]) Refs #1465
|
(In [5764]) Refs #1465, disabled widget comparison in order to get jenkins build to pass. Can't reproduce the errors jenkins gets. |
After r5764, I "downgraded" the CI server from PHP5.4.0RC5 to PHP5.3.10 since that's a security release and needs to be tested. Not sure if that's coincidental with the build currently failing though. |
(In [5768]) refs #1465 - comment out output buffering; appears to be a side effect of r5752
|
The CI build is currently "passing" with php5.3.10 (after reverting r5703) but this might be a false positive because I'm seeing what looks like an error in the build's console log. Will need to diagnose that before testing on php5.4.0rc7. |
(In [5770]) refs #1465 - revert r5768; add paintMethodEnd() to flush buffers intermittently |
Widget HTML compare feature moved to its own ticket: #2908 |
(In [5783]) Refs #1465 Trying to remove the message reported by Anthon in http://qa.piwik.org:8080/jenkins/job/Piwik/2837/consoleFull |
(In [5785]) Refs #1465 Completely disabling widget testing since it fails for mysqli for some unknown reasons (to be investigated later) eg. See log in http://qa.piwik.org:8080/jenkins/job/Piwik/2838/consoleFull |
@vipsoft Tests now pass on mysqli without the message after disabling widget output compare |
adding reference to #3323 |
all these items are now done IMHO The only remaining idea is to enable integration test for widgets covered in #2908 |
This ticket is a placeholder for improvements related to integration tests and tests in general.
Check out existing tests (Main.test.php or Integration.test.php)
Improve tests and increase coverage:
See also related ticket and comments for more ideas: #1470
The text was updated successfully, but these errors were encountered: