-
Notifications
You must be signed in to change notification settings - Fork 0
π§ͺ Add missing non-PDF filename test for FilePartFromBase64 #94
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #!/usr/bin/env bash | ||
| # fuzz-run.sh β run a single `go test -fuzz=...` invocation and tolerate the | ||
| # Go fuzz engine's known spurious "context deadline exceeded" failure that | ||
| # occurs when -fuzztime expires (golang/go#75804, Go 1.25-1.26.x). | ||
| # | ||
| # At the -fuzztime boundary the fuzz coordinator cancels in-flight iterations | ||
| # and may emit: | ||
| # --- FAIL: FuzzX (Ns) | ||
| # context deadline exceeded | ||
| # with NO `file:line` reference and NO "Failing input written to" corpus entry. | ||
| # That is the time budget expiring, not a real test failure. | ||
| # | ||
| # Real failures always include either a `..._test.go:<line>:` (or any | ||
| # `*.go:<line>:`) reference or a "Failing input written to" line; those are | ||
| # still surfaced as failures. Only the bare deadline message is tolerated. | ||
| # | ||
| # Usage: fuzz-run.sh <args passed to `go test -fuzz=...`> | ||
| # Env: GO β go binary (default: go) | ||
|
|
||
| set -u | ||
|
|
||
| GO_BIN="${GO:-go}" | ||
|
|
||
| out="$(mktemp)" | ||
| trap 'rm -f "$out"' EXIT | ||
|
|
||
| # Note: no `set -e`/pipefail here β a nonzero `go test` exit is classified below. | ||
| "$GO_BIN" test "$@" >"$out" 2>&1 | ||
| status=$? | ||
| cat "$out" | ||
|
|
||
| # Clean exit. | ||
| if [ "$status" -eq 0 ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Real finding: a new failing corpus entry was written. | ||
| if grep -q 'Failing input written to' "$out"; then | ||
| exit "$status" | ||
| fi | ||
|
|
||
| # Real assertion/panic failure: a source file:line reference is present. | ||
| if grep -qE '\.go:[0-9]+:' "$out"; then | ||
| exit "$status" | ||
| fi | ||
|
|
||
| # Spurious engine deadline flake at the -fuzztime boundary β tolerate. | ||
| if grep -q 'context deadline exceeded' "$out"; then | ||
| echo "fuzz-run: tolerated spurious Go fuzz engine 'context deadline exceeded' at -fuzztime boundary (golang/go#75804)" >&2 | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Any other non-zero exit is a real error (build failure, panic w/o location, etc.). | ||
| exit "$status" |
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.
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.
π Maintainability & Code Quality | π΅ Trivial | β‘ Quick win
Consider collapsing the repetitive fuzz invocations into a data-driven loop.
checkmake flags
test-fuzz's body as exceeding the max line length (30 lines); every line differs only by fuzz name and package path. A list + loop would shrink the target and make adding/removing fuzz targets a one-line change.β»οΈ Proposed data-driven refactor
π Committable suggestion
π§° Tools
πͺ checkmake (0.3.2)
[warning] 71-71: Target body for "test-fuzz" exceeds allowed length of 5 lines (30).
(maxbodylength)
π€ Prompt for AI Agents
Source: Linters/SAST tools