Skip to content
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

Wring out starline parsing #132

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

CyberiaResurrection
Copy link
Contributor

@CyberiaResurrection CyberiaResurrection commented Dec 14, 2024

Tighten up starline parsing according to the following property:

Given a string conforming to the ParseStarInput.starline regex, it either:

  1. Is cleanly rejected by parse_line_into_star, or;
  2. Is cleanly accepted and parsed by parse_line_into_star into a Star object.

Given 2, above, it should then be output to a string representation, cleanly re-parsed by parse_line_into_star, and then output to the same string representation.
IOW, re-parsing a Star object should be idempotent in the string representation.

Given that hypothesis is already hooked up and running clean, the next step was to hook up hypofuzz - a hypothesis-powered fuzzer.
I hooked up hypofuzz in another branch and probably won't be pushing the hookup up for review, as it brings in a whole lot of packages to view the fuzzing results that aren't relevant to PyRoute.

I then started a cycle of "run hypofuzz until property is violated - fix violation - repeat" until it ran cleanly overnight (approx 11 h 45 min, and ~103k inputs, all without triggering a new path, let alone finding a property violation).

Yes, it is very unlikely that the strings added as examples will even turn up in production - but now, those strings (and strings like them) are far less likely to cause any sort of parsing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant