{"action":"created","issue":{"url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/issues/36","labels_url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/issues/36/comments","events_url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/issues/36/events","html_url":"https://github.com/karma-runner/karma-junit-reporter/pull/36","id":60620392,"number":36,"title":"Fix: Modified how classname is generated to be usable in sonar","user":{"login":"mozimos","id":5645284,"avatar_url":"https://avatars.githubusercontent.com/u/5645284?v=3","gravatar_id":"","url":"https://api.github.com/users/mozimos","html_url":"https://github.com/mozimos","followers_url":"https://api.github.com/users/mozimos/followers","following_url":"https://api.github.com/users/mozimos/following{/other_user}","gists_url":"https://api.github.com/users/mozimos/gists{/gist_id}","starred_url":"https://api.github.com/users/mozimos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozimos/subscriptions","organizations_url":"https://api.github.com/users/mozimos/orgs","repos_url":"https://api.github.com/users/mozimos/repos","events_url":"https://api.github.com/users/mozimos/events{/privacy}","received_events_url":"https://api.github.com/users/mozimos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/labels/needs:%20feedback-from-author","name":"needs: feedback-from-author","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"Dignifiedquire","id":790842,"avatar_url":"https://avatars.githubusercontent.com/u/790842?v=3","gravatar_id":"","url":"https://api.github.com/users/Dignifiedquire","html_url":"https://github.com/Dignifiedquire","followers_url":"https://api.github.com/users/Dignifiedquire/followers","following_url":"https://api.github.com/users/Dignifiedquire/following{/other_user}","gists_url":"https://api.github.com/users/Dignifiedquire/gists{/gist_id}","starred_url":"https://api.github.com/users/Dignifiedquire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dignifiedquire/subscriptions","organizations_url":"https://api.github.com/users/Dignifiedquire/orgs","repos_url":"https://api.github.com/users/Dignifiedquire/repos","events_url":"https://api.github.com/users/Dignifiedquire/events{/privacy}","received_events_url":"https://api.github.com/users/Dignifiedquire/received_events","type":"User","site_admin":false},"milestone":null,"comments":15,"created_at":"2015-03-11T07:27:57Z","updated_at":"2015-07-10T15:51:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/pulls/36","html_url":"https://github.com/karma-runner/karma-junit-reporter/pull/36","diff_url":"https://github.com/karma-runner/karma-junit-reporter/pull/36.diff","patch_url":"https://github.com/karma-runner/karma-junit-reporter/pull/36.patch"},"body":"These changes will allow assigning of relative path to classnames. Relative path of the test file will be constructed using sonar.tests property and junitReporter \"suite\" property.  I also applied the xml schema change to use this \r\nformat (from https://github.com/karma-runner/karma-junit-reporter/pull/26):\r\n```\r\n< testcase >\r\n< error / >\r\n< /testcase >\r\n< testcase >\r\n< failure />\r\n< /testcase >  \r\n```\r\nIn the case below, test files are located in site-main-php/src/main/webapp/public/js/tests/models directory.\r\n\r\nSonar property example:\r\n```\r\nsonar.projectName=js\r\nsonar.sources=site-main-php/src/main/webapp/public/js\r\nsonar.projectBaseDir=.\r\nsonar.exclusions=site-main-php/src/main/webapp/public/js/lib/*.js,site-main-php/src/main/webapp/public/js/tests/**/*.php,site-main-php/src/main/webapp/public/js/tests/**/*.js,site-main-php/src/main/webapp/public/js/ec3.3/vendor/**\r\nsonar.javascript.lcov.reportPath=site-main-php/target/coverage/lcov.info\r\nsonar.javascript.jstestdriver.reportsPath=site-main-php/target/surefire-reports/\r\nsonar.tests=site-main-php/src/main/webapp/public/js/tests\r\n```\r\nGrunt file reporters property example:\r\n```\r\nreporters: ['junit', 'coverage', 'progress'],\r\njunitReporter: {\r\n    outputDir: $junitResults,\r\n    suite: 'models'\r\n},\r\ncoverageReporter: {\r\n    type: 'lcov',\r\n    dir: $coverageOutputDir,\r\n    subdir: '.'\r\n},\r\npreprocessors: {\r\n    'src/main/webapp/public/js/ec3.3/**/*.js': 'coverage',\r\n    'src/main/webapp/public/js/ec3/**/*.js': 'coverage'\r\n},\r\nplugins: [\r\n    'karma-jasmine',\r\n    'karma-phantomjs-launcher',\r\n    'ec-karma-junit-reporter23',\r\n    'karma-coverage'\r\n]\r\n```\r\nExample junit xml report:\r\n```\r\n<?xml version=\"1.0\"?>\r\n<testsuite name=\"PhantomJS 1.9.8 (Linux)\" package=\"models\" timestamp=\"2015-03-10T13:59:23\" id=\"0\" hostname=\"admin\" tests=\"629\" errors=\"0\" failures=\"0\" time=\"11.452\">\r\n  <properties>\r\n    <property name=\"browser.fullName\" value=\"Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34\"/>\r\n  </properties>\r\n <testcase name=\"(C.2) Checks if an empty object is returned when error 404 is encountered\" time=\"0.01\" classname=\"PhantomJS_1_9_8_(Linux).models.ReportCardDialogService_test\"/>\r\n <testcase name=\"(C.3) Checks if an empty array is returned when error 405 is encountered\" time=\"0.013\" classname=\"PhantomJS_1_9_8_(Linux).models.ReportCardDialogService_test\"/>\r\n</testsuite>\r\n```"},"comment":{"url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/issues/comments/120442300","html_url":"https://github.com/karma-runner/karma-junit-reporter/pull/36#issuecomment-120442300","issue_url":"https://api.github.com/repos/karma-runner/karma-junit-reporter/issues/36","id":120442300,"user":{"login":"mozimos","id":5645284,"avatar_url":"https://avatars.githubusercontent.com/u/5645284?v=3","gravatar_id":"","url":"https://api.github.com/users/mozimos","html_url":"https://github.com/mozimos","followers_url":"https://api.github.com/users/mozimos/followers","following_url":"https://api.github.com/users/mozimos/following{/other_user}","gists_url":"https://api.github.com/users/mozimos/gists{/gist_id}","starred_url":"https://api.github.com/users/mozimos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozimos/subscriptions","organizations_url":"https://api.github.com/users/mozimos/orgs","repos_url":"https://api.github.com/users/mozimos/repos","events_url":"https://api.github.com/users/mozimos/events{/privacy}","received_events_url":"https://api.github.com/users/mozimos/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T15:51:23Z","updated_at":"2015-07-10T15:51:23Z","body":"Hello done with the rebase to the latest master."}}