{"html_url": "https://github.com/simonw/datasette/issues/847#issuecomment-650819895", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/847", "id": 650819895, "node_id": "MDEyOklzc3VlQ29tbWVudDY1MDgxOTg5NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-28T20:50:21Z", "updated_at": "2020-06-28T20:50:21Z", "author_association": "OWNER", "body": "I'm happy enough with https://codecov.io/gh/simonw/datasette that I'm not going to spend any more time on this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638259643, "label": "Take advantage of .coverage being a SQLite database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/847#issuecomment-643704730", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/847", "id": 643704730, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MzcwNDczMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-14T01:28:34Z", "updated_at": "2020-06-14T01:28:34Z", "author_association": "OWNER", "body": "Here's the plugin that adds those custom SQLite functions:\r\n```python\r\nfrom datasette import hookimpl\r\nfrom coverage.numbits import register_sqlite_functions\r\n\r\n\r\n@hookimpl\r\ndef prepare_connection(conn):\r\n register_sqlite_functions(conn)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638259643, "label": "Take advantage of .coverage being a SQLite database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/847#issuecomment-643704565", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/847", "id": 643704565, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MzcwNDU2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-14T01:26:56Z", "updated_at": "2020-06-14T01:26:56Z", "author_association": "OWNER", "body": "On closer inspection, I don't know if there's that much useful stuff you can do with the data from `.coverage` on its own.\r\n\r\nConsider the following query against a `.coverage` run against Datasette itself:\r\n\r\n```sql\r\nselect file_id, context_id, numbits_to_nums(numbits) from line_bits\r\n```\r\n\"_coverage__select_file_id__context_id__numbits_to_nums_numbits__from_line_bits\"\r\n\r\nIt looks like this tells me which lines of which files were executed during the test run. But... without the actual source code, I don't think I can calculate the coverage percentage for each file. I don't want to count comment lines or whitespace as untested for example, and I don't know how many lines were in the file.\r\n\r\nIf I'm right that it's not possible to calculate percentage coverage from just the `.coverage` data then I'll need to do something a bit more involved - maybe parsing the `coverage.xml` report and loading that into my own schema?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638259643, "label": "Take advantage of .coverage being a SQLite database"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/847#issuecomment-643702715", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/847", "id": 643702715, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MzcwMjcxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-14T01:03:30Z", "updated_at": "2020-06-14T01:03:40Z", "author_association": "OWNER", "body": "Filed a related issue with some ideas against `coveragepy` here: https://github.com/nedbat/coveragepy/issues/999", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 638259643, "label": "Take advantage of .coverage being a SQLite database"}, "performed_via_github_app": null}