[SERVER-85043] [CQF] Code coverage Created: 16/May/23  Updated: 12/Jan/24  Resolved: 17/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Hana Pearlman Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive optimizer code coverage.zip    
Issue Links:
Related
is related to SERVER-79791 [CQF] Add testing coverage for arbitr... Closed
is related to SERVER-79879 [CQF] Remove dead code in optimizer Closed
is related to SERVER-79883 Additional testing coverage for path ... Closed
Sprint: QO 2023-08-07, QO 2023-08-21
Participants:

 Description   

This ticket tracks running some kind of coverage tool over Bonsai code, ideally using both unit tests and jstests. As a result of this effort, we may identify dead code or areas that need test coverage.



 Comments   
Comment by Nicholas Zolnierz [ 17/Aug/23 ]

Closing as I've filed and linked relevant tickets to either remove code or add coverage. If we decided to re-run this task later in the project then we can reopen this ticket.

Comment by Nicholas Zolnierz [ 04/Aug/23 ]

The process I used to generate the cumulative code coverage for the optimizer was as follows:

1. Build binaries with gcov enabled (mongod, unit test targets)
2. For each binary:

  • Run relevant tests (e.g. unit test binary, integration test suites)
  • Generate coverage info via lcov -t optimizer_test -o coverage.info -c -d ./build/<path-to-gcda-files> --derive-func-data
  • Save coverage.info for later use

3. Once all of the .info files are built, merge them via

lcov --add-tracefile coverage1.info ... -o merged.info

4. Generate html files

genhtml -s -o html-directory -t "Code Coverage" --highlight merged.info

I only ran the following integration test suites: cqf, cqf_parallel, cqf_disabled_pipeline_opt, cqf_experimental_aggregation_passthrough, cqf_experimental_jscore_passthrough, optimizer_test, core (w/ CQF enabled), aggregation (w/ CQF enabled)

Notably left out: no_passthrough, sbe_abt_test, translation tests, sharding*, cqf_experimental_no_passthrough (no_passthrough takes waaaay too long to run locally)

Generated at Thu Feb 08 06:56:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.