Skip to content

coverage: pkg/archive's metadata index construction is unreached by internal/archive #360

Closed

Description

@scttfrdmn

Surfaced while fixing #199 (PR #359). pkg/archive has no tests of its own and no floor, and #359's header entry now records why: its statements run under internal/archive, which imports it from five files. Measured with -coverpkg, that reaches 48.6% of it.

The other half is the point of this issue. pkg/archive/metadata.go's index construction — roughly 19 statements — is not exercised by any consumer. internal/archive uses the ArchiveFormat table and IsArchive; nothing builds an index and reads it back.

Two ways to close it, and the choice is worth making deliberately rather than by whichever is easier:

  1. Test pkg/archive directly and give it a floor. That's the ordinary answer, and it makes the package's contract independent of whichever consumer happens to call it.
  2. Reach it from internal/archive if the index is genuinely part of what that package does. If it isn't reachable from there, that is itself worth knowing — an exported index builder no consumer constructs is a surface decision, not a coverage gap.

Either way .coverage-floors should end with a floor and a per-floor note for pkg/archive, and its # no-floor: entry deleted. #359's TestUnfloorablePackagesAreExplained fails if the entry is left behind, so that half cannot be forgotten.

Not urgent: nothing here is a defect, and 48.6% of it is exercised on every run. But "no floor because a consumer covers it" is a weaker position than "no floor because there is nothing to cover", and only the first applies.

Activity

  1. added
    type: testing
    priority: low
    area: tests
    effort: small
    on Aug 5, 2026
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: testseffort: smallpriority: lowtype: testing

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions