-
Notifications
You must be signed in to change notification settings - Fork 15
coverage: add Ferrocene Rust coverage tool and docs #102
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
coverage: add Ferrocene Rust coverage tool and docs #102
Conversation
dcalavrezo-qorix
commented
Jan 26, 2026
- add ferrocene_report orchestration and repo-local wrapper rule
- support line-coverage parsing and gating
- default reports to bazel-bin/coverage and add overall summary
- improve path remapping, crate resolutio and runfiles handling
- update README/docs for developers and integrators
- add ferrocene_report orchestration and repo-local wrapper rule - support line-coverage parsing and gating - default reports to bazel-bin/coverage and add overall summary - improve path remapping, crate resolutio and runfiles handling - update README/docs for developers and integrators Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
Fixed formatting, updated version Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
split the python scripts into separate files added some tests updated worfklow split shell script into a template Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
Fixing formatting issues Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com>
MaximilianSoerenPollak
left a comment
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.
This is a first pass.
Further improvements & changes will be made after implementation is known.
| for root in roots: | ||
| try: | ||
| return p.relative_to(root).as_posix() | ||
| except ValueError: |
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.
That seems kind of not ideal, to just swallow an error without informatin or even a comment on why
| except Exception: | ||
| return None |
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 shouldn't blanket except Exception without even knowing what the exception is imo.
| except Exception: | |
| return None | |
| except Exception as e: | |
| logging.error(f"Error: {e}") | |
| return None |
| @@ -0,0 +1,58 @@ | |||
| #!/usr/bin/env python3 | |||
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.
Probably should have a logger
| except ValueError: | ||
| pass |
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.
Shouldn't swallow errors silently
| with json_path.open("r", encoding="utf-8") as fh: | ||
| data = json.load(fh) | ||
|
|
||
| def relativize(p: Path): |
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.
Return typehint missing
| except FileNotFoundError: | ||
| sys.exit(1) | ||
|
|
||
| m = re.search(r'([0-9]+(?:\.[0-9]+)?)%\s*\((\d+)/(\d+)\s+lines\)', text) |
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.
What exactly is this regex looking for, do you have an example?
|
|
||
| output="$(python3 "${parser}" "${fixture}")" | ||
|
|
||
| if [[ "${output}" != "100.00 8 8" ]]; then |
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.
That seems random magical.
Could you explain this?
| def _shell_quote(value): | ||
| if value == "": | ||
| return "''" | ||
| return "'" + value.replace("'", "'\"'\"'") + "'" |
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.
Don't quiet understand this.
| @@ -0,0 +1,869 @@ | |||
| #!/usr/bin/env bash | |||
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.
I'm guessing this file is now old / outdated, as much logic has moved to standalone python files?