Skip to main content

No project description provided

Project description

codecov-rs

Actions codecov

Library for processing code coverage reports.

Supported formats include:

  • codecov-rs's SQLite format described in src/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 use direnv) to set up a virtual environment. Update development dependencies with pip 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 report
  • sql_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 functionality
  • bindings/: Rust crate with PyO3 bindings for core/
  • test_utils/: Rust crate with utilities for Rust tests and sample data for any tests
    • test_utils/fixtures: Checked-in sampled data. Large samples are checked in with Git LFS
  • python/codecov_rs: Python code using/typing the Rust crate in bindings/
  • 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codecov_rs-0.1.0.tar.gz (81.2 kB view details)

Uploaded Source

Built Distributions

codecov_rs-0.1.0-cp312-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12+ Windows x86-64

codecov_rs-0.1.0-cp312-abi3-win32.whl (1.0 MB view details)

Uploaded CPython 3.12+ Windows x86

codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl (6.9 MB view details)

Uploaded CPython 3.12+ musllinux: musl 1.2+ x86-64

codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_i686.whl (7.0 MB view details)

Uploaded CPython 3.12+ musllinux: musl 1.2+ i686

codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl (6.7 MB view details)

Uploaded CPython 3.12+ musllinux: musl 1.2+ ARM64

codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.1 MB view details)

Uploaded CPython 3.12+ manylinux: glibc 2.17+ x86-64

codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.8 MB view details)

Uploaded CPython 3.12+ manylinux: glibc 2.17+ ARM64

codecov_rs-0.1.0-cp312-abi3-manylinux_2_5_i686.manylinux1_i686.whl (6.8 MB view details)

Uploaded CPython 3.12+ manylinux: glibc 2.5+ i686

codecov_rs-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12+ macOS 11.0+ ARM64

codecov_rs-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12+ macOS 10.12+ x86-64

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

Hashes for codecov_rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a638887222232883c570cea5b5f9db2292267253810807a653f851aa8870e315
MD5 88930e2bdebb1402504133555ce4dd4f
BLAKE2b-256 e734d67963cd68c2909869ba01bba67eb7e079a31b0dddcd7615adb329ef4504

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e413fbd94ba7fb00f92a951283f0b60af8928b6e9a3ddb1abe5cd4842ec34e9b
MD5 c1953d02c19cf8ee8fae43da12c02d4b
BLAKE2b-256 54ee3e94ff278371ad2946d73610e98feb7d83b6ec457a1d4cb703111bc1866e

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-win32.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-win32.whl
Algorithm Hash digest
SHA256 2aa8121d5c68847e2b512186413de2882d9b2aa836ae29d906faaf7b50babae2
MD5 6601d3d4d827cf2a3bbc80b4e4b4fd0b
BLAKE2b-256 c16b1a8a1ce8819ff63d2632daad851d9bf276d1f3e2b2eaf9f777b62d91ac89

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 552139d530a30debf4c3a80c07c2653b161c8ae55a5ab45dd2f1d3d544e65096
MD5 5c75b95a4c8edeef208b4018aa34809c
BLAKE2b-256 bc4e54d36d4c7cf1d4f8297a28cf18893e92eeff65702bb5880c782dcbf5e462

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 5da828313178848a1c5e60d3226493152a2a7b245d5851ebc0e4f028c2364d56
MD5 bebb75f595eed86f182f66048f26499c
BLAKE2b-256 1cb13bab9086016c6dea53aad23ee046e386413b51fe8c2dc47134a4e99534db

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4aaadaf1e3f912bfd44bae8b1d5387355000f81f2b135ed4392fefabcc2e9c43
MD5 ebe3c29639f3483df80901f0c49f218f
BLAKE2b-256 e7d608709b99137950cb63fe5f0c427296fbb50247f580116e86b36f17d3f501

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4dab93e7e66102e95b4a3f4c1b5dffa86c41de4293f06601975f2546c3bff4f5
MD5 ffada0ecb00d25e91492f7e6f5895a75
BLAKE2b-256 bc8598669a00ed0369cd88c9ffcacc942aecea3a90dd9ec7ce5d5d364924f7e4

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a17a1f73d958e00ff13c8f23ec0b95f02b6f1bba682e90e4c9f3a5f068adfff2
MD5 7658e64a44327791c0a66c4b78759fd9
BLAKE2b-256 97d1a528772b51972a8f8e96e44b66d18ef497c94fcd3c1cc4d95330da1737b5

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 15c31135f4703ba2c5b7d157721ad9a3faf3d2d3ce50d4655354279c8cb04142
MD5 9ceede6f628842db5c4b9af48a03026b
BLAKE2b-256 d2d50e163082f4c31a0c2afb54e20a1bad5fe547b0b3b8c902e13f33939f3b63

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e7310426bb46eb6c227cfde08749a23f3e866657273b821dc64f81fa530e58d
MD5 9742ed0eb039b08189d6bc4d5b88fab8
BLAKE2b-256 a1855afe441b372e9c601a33465a5a921f1103cc1ec86a2865fef013b5cef152

See more details on using hashes here.

File details

Details for the file codecov_rs-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for codecov_rs-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ab8245c8beafd79aeaafcc1b56188256b79f087160272633432275a4b8d2c98b
MD5 a65129bda02ff3830e566fdd19f5d130
BLAKE2b-256 31be39d49430ece31c0424cfc2de8830beac410fe118b65bc58ad787611df3f3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page