{"action":"created","issue":{"url":"https://api.github.com/repos/paratestphp/paratest/issues/344","repository_url":"https://api.github.com/repos/paratestphp/paratest","labels_url":"https://api.github.com/repos/paratestphp/paratest/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/paratestphp/paratest/issues/344/comments","events_url":"https://api.github.com/repos/paratestphp/paratest/issues/344/events","html_url":"https://github.com/paratestphp/paratest/issues/344","id":371893700,"node_id":"MDU6SXNzdWUzNzE4OTM3MDA=","number":344,"title":"Coverage reports are different from PHPUnit","user":{"login":"refucktor","id":13856522,"node_id":"MDQ6VXNlcjEzODU2NTIy","avatar_url":"https://avatars2.githubusercontent.com/u/13856522?v=4","gravatar_id":"","url":"https://api.github.com/users/refucktor","html_url":"https://github.com/refucktor","followers_url":"https://api.github.com/users/refucktor/followers","following_url":"https://api.github.com/users/refucktor/following{/other_user}","gists_url":"https://api.github.com/users/refucktor/gists{/gist_id}","starred_url":"https://api.github.com/users/refucktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refucktor/subscriptions","organizations_url":"https://api.github.com/users/refucktor/orgs","repos_url":"https://api.github.com/users/refucktor/repos","events_url":"https://api.github.com/users/refucktor/events{/privacy}","received_events_url":"https://api.github.com/users/refucktor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-19T10:13:17Z","updated_at":"2018-10-23T08:55:48Z","closed_at":null,"author_association":"NONE","body":"#### The test results from running **paratest** differs from the report that **phpunit** generate. \r\n\r\n- I have 2 **testsuites**: One for integration test, and another for unit tests.\r\n- I run **paratest** like this: `./vendor/bin/paratest --configuration phpunit.xml --log-junit .phpunit/tests.xml`\r\n- My integration test are using *in_memory* db, and from the configuration point of view everything is well optimized.\r\n- This is my **phpunit.xml** configuration\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<phpunit backupGlobals=\"false\"\r\n         backupStaticAttributes=\"false\"\r\n         bootstrap=\"vendor/autoload.php\"\r\n         colors=\"true\"\r\n         convertErrorsToExceptions=\"true\"\r\n         convertNoticesToExceptions=\"true\"\r\n         convertWarningsToExceptions=\"true\"\r\n         processIsolation=\"false\"\r\n         stopOnFailure=\"false\">\r\n    <testsuites>\r\n        <testsuite name=\"Unit\">\r\n            <directory suffix=\"Test.php\">./tests/Unit</directory>\r\n        </testsuite>\r\n\r\n        <testsuite name=\"Feature\">\r\n            <directory suffix=\"Test.php\">./tests/Feature</directory>\r\n        </testsuite>\r\n\r\n    </testsuites>\r\n    <filter>\r\n        ...\r\n    </filter>\r\n    <php>\r\n        ...\r\n    </php>\r\n    <logging>\r\n        <log type=\"coverage-clover\" target=\".phpunit/coverage.xml\"/>\r\n        <log type=\"junit\" target=\".phpunit/tests.xml\"/>\r\n    </logging>\r\n</phpunit>\r\n```\r\n\r\n- Example of the log output:\r\n_**PHPUnit coverage report for a class (pay attention to the metrics)**_\r\n```\r\n<class name=\"App\\Exceptions\\Handler\" namespace=\"App\\Exceptions\">\r\n    <metrics complexity=\"13\" methods=\"7\" coveredmethods=\"7\" conditionals=\"0\" coveredconditionals=\"0\" statements=\"79\" coveredstatements=\"79\" elements=\"86\" coveredelements=\"86\"/>\r\n</class>\r\n```\r\n_**paratest coverage report for the same class (metrics show 0 coverage)**_\r\n```\r\n<class name=\"App\\Exceptions\\Handler\" namespace=\"App\\Exceptions\">\r\n    <metrics complexity=\"13\" methods=\"7\" coveredmethods=\"0\" conditionals=\"0\" coveredconditionals=\"0\" statements=\"79\" coveredstatements=\"0\" elements=\"86\" coveredelements=\"0\"/>\r\n</class>\r\n```\r\n\r\nI really like what **paratest** is offerening cause now my tests run **2x, 3x, even 4x** faster, which helps a lot specially in CI/CD. BUT at the moment we **want** to keep a good QA reports and if there is a way to produce the same results would be nice to know.\r\nAny help is higly appreciated."},"comment":{"url":"https://api.github.com/repos/paratestphp/paratest/issues/comments/432158647","html_url":"https://github.com/paratestphp/paratest/issues/344#issuecomment-432158647","issue_url":"https://api.github.com/repos/paratestphp/paratest/issues/344","id":432158647,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjE1ODY0Nw==","user":{"login":"refucktor","id":13856522,"node_id":"MDQ6VXNlcjEzODU2NTIy","avatar_url":"https://avatars2.githubusercontent.com/u/13856522?v=4","gravatar_id":"","url":"https://api.github.com/users/refucktor","html_url":"https://github.com/refucktor","followers_url":"https://api.github.com/users/refucktor/followers","following_url":"https://api.github.com/users/refucktor/following{/other_user}","gists_url":"https://api.github.com/users/refucktor/gists{/gist_id}","starred_url":"https://api.github.com/users/refucktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refucktor/subscriptions","organizations_url":"https://api.github.com/users/refucktor/orgs","repos_url":"https://api.github.com/users/refucktor/repos","events_url":"https://api.github.com/users/refucktor/events{/privacy}","received_events_url":"https://api.github.com/users/refucktor/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T08:55:48Z","updated_at":"2018-10-23T08:55:48Z","author_association":"NONE","body":"After some struggling I found out that there is actually no problem with the library generating the reports:\r\n1. I run the `paratest` with the options to make the reports directly in the command line\r\n```\r\n./vendor/bin/paratest --configuration phpunit.xml --log-junit .phpunit/tests.xml --coverage-clover .phpunit/coverage.xml\r\n```\r\n2. After checking the results you can see that these reports are matching the reports from the `phpunit` reports\r\n3. As a final conclusion the **REAL ISSUE** in this case, is that `paratest` is not handling properly the phpunit configuration file, especially in the **_logs_** section:\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<phpunit backupGlobals=\"false\"\r\n        ...\r\n    <logging>\r\n        <log type=\"coverage-clover\" target=\".phpunit/coverage.xml\"/>\r\n        <log type=\"junit\" target=\".phpunit/tests.xml\"/>\r\n    </logging>\r\n</phpunit>\r\n```\r\nI didn't have time to go dipper and give a propper solution, but I will kindly ask to the development team to take a look on it. Once I get less workload, I will gladly contribute to the solution.\r\n"}}
{"actor":{"display_login":"refucktor"}}