-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[red-knot] Run py-fuzzer in CI to check for new panics #17719
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
Conversation
|
Or, you could create a dummy PR with either an empty commit or a random change (if it's required) to trigger CI which is stacked on top of this PR. |
f0fa072 to
d9c6708
Compare
8973c1e to
25666ad
Compare
25666ad to
426ca70
Compare
I split this PR into two -- this change is now stacked on top of #17720 (so that there is a baseline binary to download), and CI is passing on the new job 🎉 https://github.com/astral-sh/ruff/actions/runs/14740981444/job/41378854533?pr=17719#step:6:539 |
carljm
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.
Thank you!
| # Only runs on pull requests, since that is the only we way we can find the base version for comparison. | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.red_knot == 'true' }} |
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.
Yeah, and it's most useful to run it on a PR. We also don't run the py-fuzzer on parser on main.
CodSpeed Performance ReportMerging #17719 will improve performances by 4.1%Comparing Summary
Benchmarks breakdown
|
hmmmmm |
* main: [red-knot] Use 'full' salsa backtrace output that includes durability and revisions (#17735) [red-knot] Initial support for protocol types (#17682) [red-knot] Computing a type ordering for two non-normalized types is meaningless (#17734) [red-knot] Include salsa backtrace in check and mdtest panic messages (#17732) [red-knot] Fix control flow for `assert` statements (#17702) [red-knot] Fix recording of negative visibility constraints (#17731) [red-knot] Update salsa (#17730) [red-knot] Support overloads for callable equivalence (#17698) [red-knot] Run py-fuzzer in CI to check for new panics (#17719) Upload red-knot binaries in CI on completion of linux tests (#17720) [`flake8-use-pathlib`] Fix `PTH123` false positive when `open` is passed a file descriptor from a function call (#17705)
Summary
This PR sets up a CI job that uses the py-fuzzer script to check whether a PR introduces new panics to red-knot.
The py-fuzzer script still finds lots of panics in red-knot generally (see astral-sh/ty#228 for a tracking issue), so running it with the default arguments in CI would lead to a lot of red CI jobs. However, the py-fuzzer script also has a
--only-new-bugsCLI flag! If specified, it allows you to compare two binaries and check whether any new panics have been introduced by the PR. If any have been introduced, the script fails; if there are no new panics relative to the baseline binary, however, the script exits with code 0.The CI job here ends up looking like a cross between the
fuzz-parserCI job inci.yaml(which already runs thepy-fuzzerscript in CI for us, but which runs it with theruffbinary to fuzz the parser rather than red-knot) and theruff-ecosystemCI job inci.yaml(which, in a similar way to this new CI job, downloads two binaries and compares them to see if there's any differences).The CI job is currently failing because there's no baseline red-knot binary for the job to download (this PR adds the CI job that will start uploading the red-knot binary for future CI jobs to download). I'm not totally sure how to address this -- I suppose I could split it up into two PRs, one that adds the job uploading the binary and then a second one that adds the job to actually use the binary? I'll wait for review on the general idea here before going ahead with that, though.
Test Plan
I did the following:
Built the binary on
mainwith--target-directory=target/mainSwitched to a branch that had more panics and ran
cargo build -p red_knotRan the following command from my terminal and observed that the script only reported new panics that did not exist on
main: