-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Background
Currently, the overall test coverage of LeanStore is very low. Increasing unit test coverage is essential for detecting bugs early, improving code quality, and providing confidence when making changes. It also serves as documentation, showing how the code is intended to work, and makes the codebase easier to maintain and refactor. Overall, comprehensive unit tests ensure robust, reliable, and maintainable software.
How to generate coverage report in HTML
Mainly, you can follow the build and test steps in the CI workflow to install necessary tools
# generate compile database wich cmake preset
cmake --preset debug_tsan
# build
cmake --build build/debug_tsan -j `nproc`
# run unit tests, generate coverage raw data
TSAN_OPTIONS="suppressions=$(pwd)/tests/tsan.supp" ctest --test-dir build/debug_tsan --output-on-failure -j 2
# generate coverage report in HTML format
gcovr -v -r . --html-details --output=coverage.html --exclude 'build/*' --exclude 'tests/*' --exclude 'benchmarks/*' --verbose
# start a simple HTTP server to view the HTML report.
# then you can view the coverage report in your browser at
# http://localhost:8000/coverage.xml
python3 -m http.server -d .Methods to improve test coverage
- add unit tests in the
testsdirectory, there are lots of test examples - remove unused dead code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers