Skip to content

Main packages without test files are ignored #49

@MichaelUrman

Description

@MichaelUrman

In the latest run of coverpkg the following is reported:

$ coverpkg calc ./...
github.com/mutility/coverpkg/cmd/coverpkg-gha:       20.65%   76 of 368
github.com/mutility/coverpkg/internal/coverage:      66.29%  236 of 356
github.com/mutility/coverpkg/internal/git:            0.00%    0 of 22
github.com/mutility/coverpkg/internal/notes:          0.00%    0 of 49
<all>:                                               39.25%  312 of 795

However if a practically empty _test file is added to cmd/coverpkg, a new package shows up and the overall percentage drops:

$ coverpkg calc ./...
github.com/mutility/coverpkg/cmd/coverpkg:            0.00%    0 of 101
github.com/mutility/coverpkg/cmd/coverpkg-gha:       20.65%   76 of 368
github.com/mutility/coverpkg/internal/coverage:      66.29%  236 of 356
github.com/mutility/coverpkg/internal/git:            0.00%    0 of 22
github.com/mutility/coverpkg/internal/notes:          0.00%    0 of 49
<all>:                                               34.82%  312 of 896

As shown, internal/git and internal/notes show up with 0% regardless of test files, so this omission appears to be limited to main packages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions