Skip to content

rtk go test -list prints "No tests found" while the stream lists the tests #4419

Open

Description

@KuSh

rtk go test injects -json. With -list, go test -json emits the test names as output events that carry no Test field, and no pass events. The filter only counts pass events that carry a Test, so the listing is discarded:

$ rtk go test -list . ./foo
Go test: No tests found

while raw go test -json -list . ./foo carries TestRev, BenchmarkRev, FuzzRev and the ok example.com/proj/foo 0.001s line as output events. Same stream on Go 1.22.12 and 1.24.6. Reproduced on develop 7efbaef (rtk 0.49.0).

Possible fixes: skip the -json injection when -list is present (as is done for -bench), or print the listed names.

Activity

  1. added
    bug
    good first issue
    on Oct 3, 2026
  2. rtk-wshm-sync-bot commented on Oct 3, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 90%

    Summary

    rtk go test -list injects -json but the result filter discards -list output events, printing a false 'No tests found'; skip -json injection for -list (as done for -bench) or handle name-only events.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/filter/go_test.rs
    • src/discover/go.rs

    Suggested Actions

    1. Skip -json injection when -list flag is present, mirroring the existing -bench handling
    2. Alternatively, handle output events without a Test field by printing the listed test/bench/fuzz names
    3. Related to rtk go test -C DIR fails: -json is injected before -C #4362 (-C DIR vs -json injection order) and rtk pipe -f go-test reports plain-text go test output as "No tests found" #4418 (plain-text go test output) — check for shared injecti…
    4. Add a regression test using -list . ./foo against Go 1.22/1.24 JSON stream fixtures

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

  3. nightcityblade commented on Oct 3, 2026

    @nightcityblade

    Hi, I'd like to work on this. I'll submit a PR shortly.

  4. arthurk commented on Oct 11, 2026

    @arthurk

    Ran into the same problem today:

    ❯ go test -list . ./internal/k8sresources/
    TestIsSecretsRequestSpellings
    TestClassify
    TestClassifyOutputIsValidUTF8
    ok  	github.com/xxx/internal/k8sresources	0.005s
    
    ❯ rtk go test -list . ./internal/k8sresources/
    Go test: No tests found
    

    Hopefully the fix PR can be merged soon

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

Metadata

Metadata

Labels

area:clibuggood first issuepriority:medium

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions