{"action":"created","issue":{"url":"https://api.github.com/repos/filerjs/filer/issues/565","repository_url":"https://api.github.com/repos/filerjs/filer","labels_url":"https://api.github.com/repos/filerjs/filer/issues/565/labels{/name}","comments_url":"https://api.github.com/repos/filerjs/filer/issues/565/comments","events_url":"https://api.github.com/repos/filerjs/filer/issues/565/events","html_url":"https://github.com/filerjs/filer/pull/565","id":381917623,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzYxODE4","number":565,"title":"Fixes #422: Add nyc lcov-based code coverage for tests","user":{"login":"humphd","id":427398,"node_id":"MDQ6VXNlcjQyNzM5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/427398?v=4","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-18T01:14:10Z","updated_at":"2018-11-18T01:15:20Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/filerjs/filer/pulls/565","html_url":"https://github.com/filerjs/filer/pull/565","diff_url":"https://github.com/filerjs/filer/pull/565.diff","patch_url":"https://github.com/filerjs/filer/pull/565.patch"},"body":"This adds code coverage support to our tests.  I had originally wanted to do this via Karma when we run our main tests.  The way that we do our bundle, I can't figure out a good solution for getting accurate source line info.\r\n\r\nTo get around this, I've added a separate test run called `coverage`, which uses [nyc](https://github.com/istanbuljs/nyc) with mocha in node.js to do the tests, and instruments the code (unbundled) with Istanbul.  This produces lcov reports, as well as text and HTML.\r\n\r\nI had to adjust a few things in the tests to get the working well in node.js.  The only thing this doesn't instrument is any of our indexeddb or websql provider code.  That's not a huge problem, because we use it 100% in the browser-based Karma tests.  I was more interested to see how things in `src/` were doing.\r\n\r\nI'll attach the report in a sec, but the good news is we're doing really well with test coverage.\r\n\r\n@modeswitch one question I have: do you want me to hook this up to https://codecov.io or https://coveralls.io/ with Travis?  What it would do is give us per-commit reports on coverage.  Here's an example of what the reports look like on CodeCov:\r\n\r\nhttps://codecov.io/gh/mozilla/addons-frontend/src/master/src/core/client/base.js\r\n\r\n[It's easy to do in this PR or later](https://github.com/istanbuljs/nyc#integrating-with-coveralls), if we choose.  Let me know what you think.\r\n\r\ncc'ing @MarkKrutik who started this for us in #464, which I've closed in favour of this."},"comment":{"url":"https://api.github.com/repos/filerjs/filer/issues/comments/439659886","html_url":"https://github.com/filerjs/filer/pull/565#issuecomment-439659886","issue_url":"https://api.github.com/repos/filerjs/filer/issues/565","id":439659886,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTY1OTg4Ng==","user":{"login":"humphd","id":427398,"node_id":"MDQ6VXNlcjQyNzM5OA==","avatar_url":"https://avatars2.githubusercontent.com/u/427398?v=4","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"created_at":"2018-11-18T01:15:20Z","updated_at":"2018-11-18T01:15:20Z","author_association":"CONTRIBUTOR","body":"Here's what our current test coverage looks like:\r\n\r\n```\r\n---------------------------|----------|----------|----------|----------|-------------------|\r\nFile                       |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |\r\n---------------------------|----------|----------|----------|----------|-------------------|\r\nAll files                  |    85.57 |    74.18 |    96.52 |     85.8 |                   |\r\n src                       |    92.09 |    82.99 |    96.23 |    92.34 |                   |\r\n  buffer.js                |      100 |       75 |      100 |      100 |                18 |\r\n  constants.js             |      100 |      100 |      100 |      100 |                   |\r\n  directory-entry.js       |      100 |       50 |      100 |      100 |                 5 |\r\n  encoding.js              |      100 |      100 |      100 |      100 |                   |\r\n  errors.js                |      100 |      100 |      100 |      100 |                   |\r\n  fs-watcher.js            |    92.31 |    76.92 |      100 |    92.31 |             27,31 |\r\n  index.js                 |      100 |      100 |      100 |      100 |                   |\r\n  node.js                  |    91.11 |     92.5 |      100 |    91.11 |       64,65,70,71 |\r\n  open-file-description.js |    93.33 |       75 |      100 |    93.33 |                18 |\r\n  path.js                  |    90.91 |    75.81 |    94.12 |    91.76 |... 02,169,184,191 |\r\n  shared.js                |    70.59 |      100 |       80 |    68.75 |    16,17,18,19,21 |\r\n  stats.js                 |      100 |      100 |      100 |      100 |                   |\r\n  super-node.js            |     87.5 |       90 |      100 |     87.5 |             18,19 |\r\n src/filesystem            |    83.71 |    71.96 |    99.14 |    83.91 |                   |\r\n  implementation.js        |    82.54 |    71.88 |      100 |    82.73 |... 2308,2316,2378 |\r\n  interface.js             |    92.62 |    73.08 |    92.86 |    92.62 |... 77,184,232,257 |\r\n src/shell                 |    87.69 |    76.71 |    86.67 |    87.97 |                   |\r\n  environment.js           |      100 |      100 |      100 |      100 |                   |\r\n  shell.js                 |    87.26 |    75.71 |    85.96 |    87.55 |... 03,520,528,529 |\r\n---------------------------|----------|----------|----------|----------|-------------------|\r\n```\r\n\r\nMost of what isn't covered is stuff we don't really care about (checks on missing callbacks dealt with elsewhere, for example)."}}
{"actor":{"display_login":"humphd"}}