Skip to content

bug(go): go test filter returns 'No tests found' for benchmarks and silently drops fuzz output #1445

Closed

Description

@matheus-meneses

Summary

The go test filter has three related issues when handling non-unit-test output types (benchmarks, fuzz, build errors).

Current behavior

1. Benchmark-only runs show "No tests found"

When running benchmarks with -run='^$' (skip unit tests), the filter returns "No tests found" instead of showing benchmark results.

Root cause: Go does not emit individual pass events with a Test field for benchmarks — only package-level passes. The filter only counts passes when event.test.is_some(), making benchmarks invisible.

rtk go test -json -bench=. -benchmem -run='^$' ./...
# Actual:   "No tests found"
# Expected: BenchmarkFoo-10  5000  200000 ns/op  1024 B/op  8 allocs/op

2. Fuzz test progress silently discarded on success

Active fuzzing emits multiple fuzz: elapsed: progress lines with execution stats (total execs, exec/s, new interesting inputs). The filter discards all of them on success, showing only "N passed" with no fuzz data.

rtk go test -json -fuzz=FuzzFoo -fuzztime=10s ./pkg/
# Actual:   "1 passed"
# Expected: "1 passed, 1 fuzz" + final fuzz stats line

3. Non-JSON error lines silently dropped

When go test -json emits non-JSON lines (e.g., build errors before JSON streaming starts), the filter does Err(_) => continue, which can mask build failures as "No tests found".

Expected behavior

  • Benchmark result lines (ns/op, B/op, allocs/op) should be detected and displayed
  • Fuzz final progress line should be preserved (only the last one, intermediate lines filtered)
  • Non-JSON lines should be surfaced when the filter would otherwise return "No tests found"

Environment

  • rtk version: 0.37.2
  • Go version: 1.26.1
  • OS: macOS (darwin)

Activity

  1. added
    bug
    effort-medium
    filter-quality
    on Apr 22, 2026
  2. pszymkowiak commented on Apr 22, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 92%

    Summary

    go test filter incorrectly reports 'No tests found' for benchmark-only runs, silently drops fuzz progress output, and masks build errors as missing tests; PR #1444 is already in progress.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. Yohjisakamoto commented on Jul 22, 2026

    @Yohjisakamoto

    This dropped benchmark and fuzz-output case reinforces why end-to-end agent outcomes matter more than compressed text alone: DeepSWE found Tura cuts coding-agent rounds by 89% and total token cost by 80%; would you evaluate the methodology? https://turaai.net/docs#benchmark-current-test-set-record

  4. KuSh commented on Oct 3, 2026

    @KuSh
    Collaborator

    The fuzz part is fixed on develop by #1444, which is not in a stable release yet: a green fuzz run now keeps the final fuzz: elapsed: stats line in the summary. Benchmark runs pass through unfiltered since v0.40.0 (#1610), and a build failure is reported as a failed package with the compiler error rather than "No tests found". Labeling this resolved-pending-close; it will be closed once a release containing #1444 ships. If any of these still misbehaves on that release, please comment here.

  5. added
    resolved-pending-close
    on Oct 3, 2026
  6. KuSh commented on Oct 18, 2026

    @KuSh
    Collaborator

    Fixed: benchmark runs pass through unfiltered since v0.40.0 (#1610), and #1444, shipped in v0.52.0, keeps the final fuzz stats line in a green go test summary. Running these on the latest code shows the ns/op lines, '1 passed, 1 fuzz' with the last fuzz: elapsed line, and build failures as '[build failed]' with the compiler error. Please comment if any of these still misbehaves on the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibugeffort-mediumfilter-qualityplatform:macospriority:mediumresolved-pending-close

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions