Feature request: Semantic production code coverage information in sqlite database
See original GitHub issueThe 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:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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