test(fuzzing): include full parameter list in fuzzer log output - #1760
test(fuzzing): include full parameter list in fuzzer log output#1760webdevsamran wants to merge 2 commits into
Conversation
|
This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments. |
|
Profile summary: Full profile |
|
@webdevsamran We already have a PR open for this. Could you help us out and give it a review to help us get it merged quicker? |
| # print the ICS file for the test case extraction | ||
| # see https://stackoverflow.com/a/27367173/1320237 |
There was a problem hiding this comment.
Please keep this close to the .encode("UTF-8", "surrogateescape")part.
angatha
left a comment
There was a problem hiding this comment.
Thank you for your first contribution. Code looks fine besindes some minor tweaks.
A CONTRIBUTING.md file usually contains information how you can perticipate in a project. We have such a file and it links to our guide.
- Please use the PR template (for future PRs)
- Then check all check boxes after you did the tasks.
- We need a changelog entry. Please provide one. The guide contains information about that.
- Please write the entry yourself and not with generative AI
- Please clarify AI usage in the PR description and the changelog entry. You may also update the commit message (yourself)
Format fuzzer log output with entrypoint name and parameters (multiple, should_walk) alongside the base64-encoded calendar content to enable reproducing test cases. Keep Calendar.from_ical inlined in fuzzer. Add changelog entry. AI use disclosure: Model: Claude 3.7 Sonnet / Gemini 2.5 Prompt: Update fuzzer logging to output full parameter list (multiple, should_walk) for reproducing fuzzed calendar test cases, write unit tests, and add news changelog entry. Output: Implemented format_fuzz_log, updated ical_fuzzer.py, added unit test in test_fuzzed_calendars.py, and added news/1758.internal.
|
Thanks for the review and guidance @angatha! All requested changes are completed:
|
| print( | ||
| base64.b64encode(calendar_string.encode("UTF-8", "surrogateescape")).decode( | ||
| "ASCII" | ||
| format_fuzz_log( | ||
| icalendar.cal.calendar.Calendar.from_ical, | ||
| multiple, | ||
| should_walk, | ||
| calendar_string, |
There was a problem hiding this comment.
On a second thought, this should be called from fuzz_v1_calendar in __init__.py and include the version (see other comment).
|
|
||
| The calendar_string is a fuzzed input. | ||
| """ | ||
| try: |
There was a problem hiding this comment.
| print(format_fuzz_log('v1', from_ical, multiple, should_walk, calendar_string)) | |
| try: |
| f"{from_ical.__qualname__} multiple={multiple} " | ||
| f"should_walk={should_walk} {encoded}" |
There was a problem hiding this comment.
| f"{from_ical.__qualname__} multiple={multiple} " | |
| f"should_walk={should_walk} {encoded}" | |
| f"{version} {from_ical.__qualname__} multiple={multiple} " | |
| f"should_walk={should_walk} {encoded}" |
|
Hi @angatha — just following up on the changes requested in your review. Since the initial review, I've addressed all the feedback:
Happy to make any further adjustments. Thank you for reviewing! |
|
Thank you for the reminder. I saw that and had a different thought, about how this is done. Please see the open threads. They contain somesuggestions. |
Linked issue
Description
Includes the full parameter list (\multiple, \should_walk) alongside the entrypoint name and base64-encoded calendar payload in the fuzzer log output (\src/icalendar/fuzzing/ical_fuzzer.py), formatted via \ormat_fuzz_log\ in \src/icalendar/tests/fuzzed/init.py. This enables reproducing fuzzed test cases with their exact execution parameters. \Calendar.from_ical\ is kept inlined in the fuzzer per review feedback.
AI disclosure: I used AI assistance (Claude 3.7 Sonnet / Gemini 2.5) to help draft and refine the implementation, test coverage, and changelog entry for this change.
Checklist