
The same goes for scripts that are tested on different nodes. So collecting coverage becomes a non-trivial task. If you run your application via Webserver (Apache, Nginx, PHP WebServer) you don’t have a direct access to tested code, XML clover reports are used by IDEs (like PHPStorm) or Continuous Integration servers (like Jenkins). The best way to review report is to open index.html from tests/_output/coverage in your browser. XML and HTML reports are stored to the _output directory. Php vendor/bin/codecept run -coverage -coverage-xml -coverage-html
Visual studio code coverage does not show all modules code#
To enable code coverage put these lines in the global configuration file codeception.yml:

But Codeception supports remote codecoverage as well as local. It may look hard to collect code coverage for Selenium tests or PhpBrowser tests. Or locally but running through web server. Remote tests may be executed on different nodes, Great for debugging, but too slow when collecting coverageįast and accurate, but no debug functionality - perfect for CIĬoverage data can be collected manually for both local and remote tests. The required information is provided by SebastianBergmann\CodeCoverage, and you can use any of the supported drivers. Because even 100% code coverage rate doesn’t save you from fatal errors and crashes.

In the ideal world you should get 100% code coverage, but in reality 80% is really enough.

The ratio between all lines in script and all touched lines is a main coverage criterion. You will receive statistics of all classes, methods, and lines triggered by these tests. When you execute your tests to collect coverage report, Just for this case the CodeCoverage is used. Read for 4.x Code CoverageĪt some point you want to review which parts of your application are tested well and which are not. 💡 You are reading docs for latest Codeception 5.
