Skip to content

make covhtml opens a path nothing generates #2212

Closed

Description

@TerryHowe

make covhtml opens a file that nothing in the repo generates.

Makefile:

.PHONY: covhtml
covhtml:  ## look at code coverage
	open .cover/coverage.html

make test writes its profile to the repo root as coverage.txt (-coverprofile=coverage.txt), and there is no rule anywhere that produces .cover/coverage.html. The only other .cover path in the repo was teste2e-covdata's test/e2e/.cover, which held raw covcounters/covmeta files rather than HTML, and that target is being removed by #2208.

So make covhtml fails with a missing file on any checkout.

Suggested fix

Generate the report from the profile the test target actually produces:

.PHONY: covhtml
covhtml: test  ## generate and open the coverage report
	$(GO_EXE) tool cover -html=coverage.txt -o coverage.html
	open coverage.html

coverage.html is already in .gitignore. Separately, open is macOS-only — the current target has the same limitation, so that is only worth addressing if someone wants to make it portable at the same time.

Activity

  1. added
    bug
    on Oct 2, 2026
  2. TanvirTian commented on Oct 2, 2026

    @TanvirTian
    Contributor

    i'd like to work on it 🐱

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions