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
Phpunit speedtrap #12763
Phpunit speedtrap #12763
Conversation
ResultsSystemTests
|
Something very fundamental takes ~50 seconds per unit test |
Thank you @szepeviktor for creating your first PR, that's really useful 👍 making our tests faster has become a top priority as the System tests often fail as they exceed 40min. From this output it looks like possibly
edit: @szepeviktor would it be maybe possible to display the top 100 slow tests instead of top 10? |
@mattab Do you have a 1 page summary on how to get from cloning matomo repo to running tests? |
this might help: https://github.com/matomo-org/matomo/blob/3.x-dev/tests/README.md |
I think I need to create a Dockerfile to be able to breath |
Could you help me how |
Adding comments to the testing system (travis.yml, shell scripts) may help a lot. |
@szepeviktor I use docker half of the time for development: https://github.com/diosmosis/matomo-docker-dev . It's definitely not official, so it may or may not work for you, I can't promise any real support and I will make changes to it as I need them. Use As for how the test database is populated, it is created, setup & filled by the https://github.com/matomo-org/matomo/blob/3.x-dev/tests/PHPUnit/Framework/Fixture.php class and its descendants. (Fair warning, it sets up the entire matomo test environment, and so is a very large, hard to read class, and may make your eyes bleed.) Some test setup code is located elsewhere like in the https://github.com/matomo-org/matomo/blob/3.x-dev/tests/PHPUnit/Framework/TestingEnvironmentManipulator.php class. |
Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The minimum execution time threshold needs to be increased for system tests, as they will always be slower than unit tests. Not sure what the best value is since some will always be long running. Perhaps it would be good to make the speed trap listener optional in some way.
- There's a conflict in the composer file that needs to be fixed.
sudo: false | ||
- php: 5.5.33 | ||
env: TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-second-half-only" | ||
sudo: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes need to be reverted before this PR can be merged.
Thank you @diosmosis! This PR is a rather like a debugging session. |
@szepeviktor Gotcha, will remove this from the current milestone then, feel free to create PRs when you find some optimizations :) |
Thanks @szepeviktor for creating this PR. I've added a comment in the related issue here: #12691 (comment) |
The purpose of this Pr is to measure long-running unit tests.
Was #12760