No project description provided
Project description
codecov-rs
Library for processing code coverage reports.
Supported formats include:
codecov-rs
's SQLite format described insrc/report/models.rs
- Codecov's Python report implementation ("pyreport")
See core/src/parsers
or the list of features in core/Cargo.toml
for a complete list. All formats are converted to codecov-rs
's SQLite format (inspired by coverage.py
) and converting back is generally not a goal (pyreport being the exception).
All details (e.g. SQLite schema, code interfaces) subject to breaking changes until further notice. In the future, we will at least use SQLite's schema_version
pragma to attempt backwards compatibility.
Developing
Set up your development environment:
- Install the nightly compiler via rustup. At time of writing,
codecov-rs
requires the nightly compiler for niceties such as#[feature(trait_alias)]
. - To work on the Python bindings, run
source .envrc
(or usedirenv
) to set up a virtual environment. Update development dependencies withpip install -r python/requirements.dev.txt
- Install lint hooks with
pip install pre-commit && pre-commit install
. - Large sample test reports are checked in using Git LFS in
test_utils/fixtures/**/large
directories (e.g.test_utils/fixtures/pyreport/large
). Tests and benchmarks may reference them so installing it yourself is recommended.
codecov-rs
aims to serve as effective documentation for every flavor of every format it supports. To that end, the following are greatly appreciated in submissions:
- Thorough doc comments (
///
//**
). For parsers, include snippets that show what inputs look like - Granular, in-module unit tests
- Integration tests with real-world samples (that are safe to distribute; don't send us data from your private repo)
The core/examples/
directory contains runnable commands for developers including:
parse_pyreport
: converts a given pyreport into a SQLite reportsql_to_pyreport
: converts a given SQLite report into a pyreport (report JSON + chunks file)
You can run an example with cargo run --example <example> <arguments>
. Consider following suit for your own new feature.
Repository structure
core/
: Rust crate with all of the core coverage-processing functionalitybindings/
: Rust crate with PyO3 bindings forcore/
test_utils/
: Rust crate with utilities for Rust tests and sample data for any teststest_utils/fixtures
: Checked-in sampled data. Large samples are checked in with Git LFS
python/codecov_rs
: Python code using/typing the Rust crate inbindings/
python/tests
: Python tests
Cargo.toml
in the root defines a Cargo workspace. pyproject.toml
in the root defines our Python package. Development dependencies for the Python code are in python/requirements.dev.txt
.
Writing new parsers
TBD: Design not settled
New parsers should be optional via Cargo features. Adding them to the default featureset is fine.
Where possible, parsers should not load their entire input or output into RAM. On the input side, you can avoid that with a streaming parser or by using memmap2
to map the input file into virtual memory. SQLite makes it straightforward enough to stream outputs to the database.
Coverage formats really run the gamut so there's no one-size-fits-all framework we can use. Some options:
quick_xml
, a streaming XML parserwinnow
, a parser combinator framework (fork ofnom
)winnow
's docs illustrate how one can write a streaming parser
serde
, a popular serialization/deserialization frameworkserde
's docs illustrate how one can write a streaming parser
Non-XML formats lack clean OOTB support for streaming so codecov-rs
currently relies more on the mmap approach.
Testing
Run tests with:
# Rust tests
$ cargo test
# Python tests
$ pytest
Benchmarks
Run benchmarks with:
$ cargo bench --features testing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file codecov_rs-0.1.0.tar.gz
.
File metadata
- Download URL: codecov_rs-0.1.0.tar.gz
- Upload date:
- Size: 81.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a638887222232883c570cea5b5f9db2292267253810807a653f851aa8870e315 |
|
MD5 | 88930e2bdebb1402504133555ce4dd4f |
|
BLAKE2b-256 | e734d67963cd68c2909869ba01bba67eb7e079a31b0dddcd7615adb329ef4504 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-win_amd64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e413fbd94ba7fb00f92a951283f0b60af8928b6e9a3ddb1abe5cd4842ec34e9b |
|
MD5 | c1953d02c19cf8ee8fae43da12c02d4b |
|
BLAKE2b-256 | 54ee3e94ff278371ad2946d73610e98feb7d83b6ec457a1d4cb703111bc1866e |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-win32.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-win32.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.12+, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aa8121d5c68847e2b512186413de2882d9b2aa836ae29d906faaf7b50babae2 |
|
MD5 | 6601d3d4d827cf2a3bbc80b4e4b4fd0b |
|
BLAKE2b-256 | c16b1a8a1ce8819ff63d2632daad851d9bf276d1f3e2b2eaf9f777b62d91ac89 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.12+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 552139d530a30debf4c3a80c07c2653b161c8ae55a5ab45dd2f1d3d544e65096 |
|
MD5 | 5c75b95a4c8edeef208b4018aa34809c |
|
BLAKE2b-256 | bc4e54d36d4c7cf1d4f8297a28cf18893e92eeff65702bb5880c782dcbf5e462 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_i686.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_i686.whl
- Upload date:
- Size: 7.0 MB
- Tags: CPython 3.12+, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5da828313178848a1c5e60d3226493152a2a7b245d5851ebc0e4f028c2364d56 |
|
MD5 | bebb75f595eed86f182f66048f26499c |
|
BLAKE2b-256 | 1cb13bab9086016c6dea53aad23ee046e386413b51fe8c2dc47134a4e99534db |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.12+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4aaadaf1e3f912bfd44bae8b1d5387355000f81f2b135ed4392fefabcc2e9c43 |
|
MD5 | ebe3c29639f3483df80901f0c49f218f |
|
BLAKE2b-256 | e7d608709b99137950cb63fe5f0c427296fbb50247f580116e86b36f17d3f501 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.1 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dab93e7e66102e95b4a3f4c1b5dffa86c41de4293f06601975f2546c3bff4f5 |
|
MD5 | ffada0ecb00d25e91492f7e6f5895a75 |
|
BLAKE2b-256 | bc8598669a00ed0369cd88c9ffcacc942aecea3a90dd9ec7ce5d5d364924f7e4 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.8 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a17a1f73d958e00ff13c8f23ec0b95f02b6f1bba682e90e4c9f3a5f068adfff2 |
|
MD5 | 7658e64a44327791c0a66c4b78759fd9 |
|
BLAKE2b-256 | 97d1a528772b51972a8f8e96e44b66d18ef497c94fcd3c1cc4d95330da1737b5 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-manylinux_2_5_i686.manylinux1_i686.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-manylinux_2_5_i686.manylinux1_i686.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.12+, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15c31135f4703ba2c5b7d157721ad9a3faf3d2d3ce50d4655354279c8cb04142 |
|
MD5 | 9ceede6f628842db5c4b9af48a03026b |
|
BLAKE2b-256 | d2d50e163082f4c31a0c2afb54e20a1bad5fe547b0b3b8c902e13f33939f3b63 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e7310426bb46eb6c227cfde08749a23f3e866657273b821dc64f81fa530e58d |
|
MD5 | 9742ed0eb039b08189d6bc4d5b88fab8 |
|
BLAKE2b-256 | a1855afe441b372e9c601a33465a5a921f1103cc1ec86a2865fef013b5cef152 |
File details
Details for the file codecov_rs-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: codecov_rs-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab8245c8beafd79aeaafcc1b56188256b79f087160272633432275a4b8d2c98b |
|
MD5 | a65129bda02ff3830e566fdd19f5d130 |
|
BLAKE2b-256 | 31be39d49430ece31c0424cfc2de8830beac410fe118b65bc58ad787611df3f3 |