Repository navigation
Run a short fuzz of every target in CI on both OSes - #20
Merged
Merged
Conversation
scripts/fuzz.sh finds every Fuzz function in the tree and runs each for a short fixed time (20s by default), one go test invocation per target, as Go requires. It is a blocking CI step on Linux and macOS: a crasher fails the job and the failing input is written under testdata/fuzz/ in its package. The script keeps a floor of expected targets, so a target that is deleted or renamed is a failure and not a quiet pass; its --selftest proves a missing name and a prefix match both fail. Three targets join the existing FuzzConfig. FuzzCLIArgs feeds arbitrary arguments to the command tree and checks that it exits 0 or 3, prints one fixed-text error line with empty stdout, never repeats a URL-shaped argument, and never exits 0 for a URL, selector or expression. FuzzBase checks that an accepted base address has a scheme and a host and no credentials, query, fragment or dot segment. FuzzPath checks that an accepted path survives a parse unchanged and that a refused path never reaches the dialer. Each rule has seeds, so a rule that lets one reserved character through fails the seed run and not only a lucky fuzz; mutants of each rule fail. CONTRIBUTING lists the new gate and names the pinned toolchain correctly. Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
The first 20s run of FuzzCLIArgs found an input that exits 0 with a selector-shaped argument: a stray quote followed by -h. That is cobra answering help before it checks the other arguments, which is correct, and the help text is static. The invariant now allows it only when help was asked, and then checks that the help text does not repeat any of those arguments. The input stays as a regression seed under testdata/fuzz. The path-character check in FuzzPath moves into a named function, which also clears the De Morgan finding from the linter and keeps the allowed set written out apart from the code it tests. Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
The fuzz kept finding inputs that were fine: a flag given twice, where the last value wins, leaves an earlier bad value that never reaches anything; -hh is help. Chasing raw argument shapes was the wrong property. FuzzCLIArgs now records what each handler is given and checks that: a success hands over only a query name of the right shape, a host slug of the right shape and file names that are not URLs, and a usage error never runs a handler. The rest is unchanged: exit 0 or 3 only, one fixed-text error line with empty stdout, and no repeat of a URL- or selector-shaped argument in stderr or in static help. The inputs found so far stay as seeds. Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
The selftest case meant to show a prefix match fails used FuzzConfigX, which is longer than a real target and not a prefix of it, so a matcher that lost its anchors still passed. It now plants the three shapes a loose matcher accepts: FuzzConf, the start of FuzzConfig; zzConfig, its end; and FuzzConfigX, a longer name. Each must count as missing. Checked with three mutants of the matcher: no trailing anchor fails the prefix case, no leading anchor fails the suffix case, and no anchors at all fails both. The real script still passes. Signed-off-by: VirtualMachinist <252028890+VirtualMachinist@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
V1 checkpoint G4c: CI fuzzing.
🤖 Generated with Claude Code