question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Semantic production code coverage information in sqlite database

See original GitHub issue

The sqlite database table “context” already contains semantic information “context”. As far as I know the type of the context is limited to “test” right now.

context_id context
1 test_some_method
2 test_some_function

The sqlite database tables “line” and “arc” contain line/branch based production code coverage information.

Could we add production code coverage information with semantic meaning? This could be done either as (option a) a separate table “semantic” or as (option b) part of the line and arc table as additional info?

option a (separate “semantic” table):

file_id context_id module class method function
1 1 some_module SomeClass some_method
2 2 some_module some_function

option b (line table with additional info):

file_id context_id module class method function lineno
1 1 some_module SomeClass some_method 17
1 1 some_module SomeClass some_method 18
2 2 some_module some_function 34
2 2 some_module some_function 35

For some consistent, exemplary database table content refer to python-tia/coveragepy_database_tables.ipynb.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nedbatcommented, Oct 9, 2019

The pytest-cov plugin now provides good support for tracking test ids: https://nedbatchelder.com/blog/201910/pytestcov_support_for_whotestswhat.html . I’m going to close this for now, let me know what you find when you try the latest code.

1reaction
nedbatcommented, May 17, 2019

Coverage.py 5.0a5 now supports context plugins and an API entry point for test runners to use to set the context. There’s a branch of pytest-cov that sets the pytest test id, and phase (setup, call, teardown) as the context. Is that getting closer to what you want? https://nedbatchelder.com/blog/201905/coveragepy_50a5_pytest_contexts.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

How SQLite Is Tested
There are numerous test cases that verify that SQLite is able to deal with malformed database files. These tests first build a well-formed...
Read more >
Don't test with SQLite when you use Postgres in Production
I use the pure JS version of SQLite (sql.js in npm). The server is fairly small, having the bulk of the code in...
Read more >
[Feat] Store extended metadata as JSON in DB #1938 - GitHub
Please describe. Esp. in a TGIS context it would be very useful if extended metadata was stored in the DB so it can...
Read more >
Detecting Logical Bugs of DBMS with Coverage-based ...
Abstract. Database management systems (DBMSs) are critical compo- nents of modern data-intensive applications. Developers have.
Read more >
Full predicate coverage for testing SQL database queries
This criterion has demonstrated its utility in previous work, such as [51] (for testing SQL queries) and [42] (for testing the user-database ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found