-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start parsing the chunks
file with serde
#31
Open
Swatinem
wants to merge
9
commits into
main
Choose a base branch
from
swatinem/parse-chunks-serde
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
452d71b
Start parsing the `chunks` file with serde
Swatinem e47f552
Use `memchr`-based splitting instead of an iterator/event-based inter…
Swatinem 6f8af38
get closer to the existing parser interface dealing with report builders
Swatinem d6f4a47
Implement missing chunks parser features
Swatinem 70fa498
insert all datapoints
Swatinem 35f0674
rip out old chunks parser
Swatinem c89f46f
remove all winnow-related code
Swatinem 7e40eed
switch to stable rust and reformat imports
Swatinem 56391d0
fix CI failures
Swatinem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,17 +17,19 @@ All details (e.g. SQLite schema, code interfaces) subject to breaking changes un | |
## Developing | ||
|
||
Set up your development environment: | ||
- Install the nightly compiler via [rustup](https://rustup.rs/). 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](https://git-lfs.com/) 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) | ||
|
||
|
@@ -53,9 +55,8 @@ New parsers should be optional via Cargo features. Adding them to the default fe | |
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`](https://crates.io/crates/quick_xml), a streaming XML parser | ||
- [`winnow`](https://crates.io/crates/winnow), a parser combinator framework (fork of [`nom`](https://crates.io/crates/nom)) | ||
- `winnow`'s docs illustrate [how one can write a streaming parser](https://docs.rs/winnow/latest/winnow/_topic/partial/index.html) | ||
- [`serde`](https://serde.rs/), a popular serialization/deserialization framework | ||
- `serde`'s docs illustrate [how one can write a streaming parser](https://serde.rs/stream-array.html) | ||
|
||
|
@@ -64,6 +65,7 @@ Non-XML formats lack clean OOTB support for streaming so `codecov-rs` currently | |
### Testing | ||
|
||
Run tests with: | ||
|
||
``` | ||
# Rust tests | ||
$ cargo test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be |
||
|
@@ -75,6 +77,7 @@ $ pytest | |
### Benchmarks | ||
|
||
Run benchmarks with: | ||
|
||
``` | ||
$ cargo bench --features testing | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![feature(trait_alias)] | ||
|
||
pub mod report; | ||
|
||
pub mod parsers; | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might not use winnow anymore but it is still an option we might use for other parsers in the future (seems like it would be very clean for something like lcov for example). we also don't use
quick_xml
but that's still in this list