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

Generate Code Coverage of Piwik test suite #4224

Closed
mattab opened this issue Oct 17, 2013 · 14 comments
Closed

Generate Code Coverage of Piwik test suite #4224

mattab opened this issue Oct 17, 2013 · 14 comments
Assignees
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Oct 17, 2013

It would be fantastic to know how much of the piwik platform source code is covered by tests. With our hundreds of unit tests, [integration tests, and http://piwik.org/blog/2013/10/our-latest-improvement-to-qa-screenshot-testing/ UI screenshot tests, we can hope for a reasonnable code coverage.

Access to code coverage report would help us find out if there are any parts of the code that are not tested at all, and it will help quantify the reach of our QA suite.

@mattab
Copy link
Member Author

mattab commented Oct 17, 2013

  • it would be mostly useful only if it included the coverage from Core+Plugins+Integration
  • and +1 if we had also the UI tests coverage since they hit UI + controllers!

But not sure how/if it is possible to "merge" the code coverage from several phpunit executions?

@mattab
Copy link
Member Author

mattab commented Oct 17, 2013

In 7567afa: Removing code coverage refs #4224

@sgiehl
Copy link
Member

sgiehl commented Oct 17, 2013

I've started to work on that ticket. There is a possibility to "merge" the code coverage.
With phpcov (https://github.com/sebastianbergmann/phpcov) it is possible to merge coverage reports generated in serialized php format (--coverage-php option).
It seems to work so far but it will take quite much ram to combine those reports. 256 MB weren't enough to combine core and plugin tests.

@sgiehl
Copy link
Member

sgiehl commented Oct 20, 2013

In cab7c14: refs #4224 include uncovered files to code coverage

@mattab
Copy link
Member Author

mattab commented Nov 14, 2013

See follow up ticket to this one: #4302 Setup Coveralls for Piwik Code coverage report

@SteveG hopefully your changes to make Code coverage work could be used on coveralls.

@sgiehl
Copy link
Member

sgiehl commented Nov 15, 2013

As far as I've seen coveralls requires some CI tool running, such as jenkins or travis.
It shouldn't be a problem to run that on an jenkins, but we would need to reinstall that again. I'm not sure if we would be able to do that with travis. Currently there are 3GB ram required to merge the code coverage reports - and all tests + code coverage merging is running around 1,5 - 2 hours.

@mattab
Copy link
Member Author

mattab commented Nov 19, 2013

Wow very cool to hear you managed to build it with 3g of ram.

code coverage will not run well on travis, and we cant run it on piwik.org as it would slow down services, maybe we could run this process in a large EC2 instance and shut it down after... would be cheap!

@sgiehl
Copy link
Member

sgiehl commented Dec 20, 2013

In e9f5428: refs #4224 do not check auto prepend/append config in test mode, as it is used to generate full code coverage

@mattab
Copy link
Member Author

mattab commented Jan 13, 2014

@Steve, would it be possible to upgrade the codecoverage report from Nov 22 on 2.0.3 ?

Here is an idea: maybe we could run the whole processus, once a day, generate the coverage at midnight. Maybe we can use the existing travis script to setup webserver+mysql etc. and upload results to codecoverage.piwik.org.

Maybe we could run the script on AWS once a day?

@sgiehl
Copy link
Member

sgiehl commented Jan 13, 2014

@mattab
Copy link
Member Author

mattab commented Jan 21, 2014

@SteveG we have fixed this test error last week, maybe now it works fine for you too?

@mattab mattab added this to the 2.x - The Great Piwik 2.x Backlog milestone Jul 8, 2014
sgiehl pushed a commit that referenced this issue Aug 20, 2014
refs #4224, #4302 - added code coverage report using coveralls.io
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…mode, as it is used to generate full code coverage
@mattab mattab added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Oct 10, 2014
@mattab
Copy link
Member Author

mattab commented Oct 11, 2014

@sgiehl can this be closed now that coverage is enabled? 👍

@sgiehl
Copy link
Member

sgiehl commented Oct 11, 2014

Currently only directly called methods are covered by the report. So all methods called through the tracker/api proxy will not be included. It's not easy to do that. But there is a way, which costs much performance (and will exceed the travis resources). If we don't need that anymore. we can close this ticket.

@mattab
Copy link
Member Author

mattab commented Oct 12, 2014

Kuddos @sgiehl for making it happen.

hopefully more and more devs will in the future find useful improvements to testing thanks to these code coverage reports.

@mattab mattab closed this as completed Oct 12, 2014
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. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants