{"action":"created","issue":{"url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/179","repository_url":"https://api.github.com/repos/scoverage/sbt-scoverage","labels_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/179/comments","events_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/179/events","html_url":"https://github.com/scoverage/sbt-scoverage/issues/179","id":173136120,"number":179,"title":"sbt-scoverage + specs2 not working; no tests discovered during analysis","user":{"login":"zbeckman","id":5351337,"avatar_url":"https://avatars.githubusercontent.com/u/5351337?v=3","gravatar_id":"","url":"https://api.github.com/users/zbeckman","html_url":"https://github.com/zbeckman","followers_url":"https://api.github.com/users/zbeckman/followers","following_url":"https://api.github.com/users/zbeckman/following{/other_user}","gists_url":"https://api.github.com/users/zbeckman/gists{/gist_id}","starred_url":"https://api.github.com/users/zbeckman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbeckman/subscriptions","organizations_url":"https://api.github.com/users/zbeckman/orgs","repos_url":"https://api.github.com/users/zbeckman/repos","events_url":"https://api.github.com/users/zbeckman/events{/privacy}","received_events_url":"https://api.github.com/users/zbeckman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-25T07:52:21Z","updated_at":"2016-09-02T18:57:01Z","closed_at":null,"body":"I am unable to get sbt-scoverage to discover and analyze our tests. We should have pretty good test coverage (at least 80%); all tests run and pass fine. But the scoverage report shows nearly zero coverage (~ 3%).\r\n\r\nThe only thing I can think of, is that we are using specs2 (and also scalacheck). Most of the examples I've seen use ScalaTest.\r\n\r\nFor example: We have four classes in the models package. They are showing zero coverage, even though the test results show that they have been tested thoroughly:\r\n\r\n```\r\n[info] Compiling 5 Scala sources to /Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/test-classes...\r\n[info] TestCreditModel\r\n[info]    + Given a credit\r\n[info]      When validation is performed\r\n[info]      Then credits between 1 and 60 should be acceptable\r\n[info]    + And credits less than 1 or greater than 60 should not\r\n[info]\r\n[info]    + Given a category and attribute credits\r\n[info]      When validation is performed\r\n[info]      Then we should get validated category credits\r\n[info]    + And we should get validated attribute credits\r\n[info]    + And invalid category credits should not pass validation\r\n[info]    + And invalid attribute credits should not pass validation\r\n[info]\r\n[info] Total for specification TestCreditModel\r\n[info] Finished in 86 ms\r\n[info] 6 examples, 600 expectations, 0 failure, 0 error\r\n[info]\r\n[info] TestCategoryModel\r\n[info]    + Given a well formed category\r\n[info]      When validation is performed\r\n[info]      Categories with good abbreviations and descriptions should be valid\r\n[info]    + And those with invalid abbreviations should not\r\n[info]    + And those with invalid descriptions should not\r\n[info]\r\n[info]\r\n[info] Total for specification TestCategoryModel\r\n[info] Finished in 167 ms\r\n[info] 3 examples, 300 expectations, 0 failure, 0 error\r\n```\r\n\r\nBut I see scoverage is definitely running:\r\n\r\n```\r\n[info] Compiling 11 Scala sources and 1 Java source to /Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/classes...\r\n[info] [info] Cleaning datadir [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/scoverage-data]\r\n[info] [info] Beginning coverage instrumentation\r\n[info] [info] Instrumentation completed [31 statements]\r\n[info] [info] Wrote instrumentation file [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/scoverage-data/scoverage.coverage.xml]\r\n[info] [info] Will write measurement data to [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/scoverage-data]\r\n```\r\n\r\nBut the coverage report is clearly not picking up the classes that we are testing:\r\n\r\n```\r\n[IDC] $ coverageReport\r\n[info] Waiting for measurement data to sync...\r\n[info] Reading scoverage instrumentation [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/scoverage-data/scoverage.coverage.xml]\r\n[info] Reading scoverage measurements...\r\n[info] Generating scoverage reports...\r\n[info] Written Cobertura report [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/coverage-report/cobertura.xml]\r\n[info] Written XML coverage report [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/scoverage-report/scoverage.xml]\r\n[info] Written HTML coverage report [/Users/zbeckman/Projects/Accenture/Trident_IDC_Training/target/scala-2.11/scoverage-report/index.html]\r\n[info] Statement coverage.: 3.23%\r\n[info] Branch coverage....: 100.00%\r\n[info] Coverage reports completed\r\n[error] Coverage is below minimum [3.23% < 80.0%]\r\n[trace] Stack trace suppressed: run last *:coverageReport for the full output.\r\n[error] (*:coverageReport) Coverage minimum was not reached\r\n[error] Total time: 1 s, completed Aug 25, 2016 1:11:27 PM\r\n```\r\n\r\nWhen viewing the report, I see the four classes in the models package show completely untested.\r\n\r\nWe have the following in our built.sbt:\r\n\r\n```\r\ncoverageEnabled := true\r\n\r\ncoverageMinimum := 80\r\n\r\ncoverageFailOnMinimum := true\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/comments/244459816","html_url":"https://github.com/scoverage/sbt-scoverage/issues/179#issuecomment-244459816","issue_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/179","id":244459816,"user":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars.githubusercontent.com/u/743706?v=3","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T18:57:01Z","updated_at":"2016-09-02T18:57:01Z","body":"I'm not sure how to get macro support. The plugin would have to apply after macro expansion has taken place, but before the regular compilation. I can't see a macro phase in the compiler, so I don't know if it just \"does it all at the same time\". I'll have a play at some point."}}
{"actor":{"display_login":"sksamuel"}}