Skip to content

bug(mq): internal/mq integration tests are selected by name pattern, so a new prefix is silently skipped #692

Closed

Description

@EricAndrechek

Area: mq — build tooling (internal/mq integration tests)

The Makefile's integration target runs internal/mq's integration-tagged tests (the external NATS broker, //go:build integration files: external_auth_test.go, external_conformance_test.go, external_export_test.go, external_perms_test.go, external_test.go, lease_test.go) by matching test names against a fixed pattern, not by build tag alone:

-run '^Test(ExternalNATS|NewNATS|NATSPermissions_Refuse|Leases)' ./internal/mq $(ARGS)

(Makefile, the second gotestsum invocation for internal/mq, alongside the broader ./tests/integration/... ./internal/mq/natsspike/... ./internal/cache/... run.) Every func Test... currently in those six integration-tagged files does start with one of ExternalNATS, NewNATS, NATSPermissions_Refuse or Leases — confirmed by listing every top-level test in those files and checking each against the pattern, so nothing is silently skipped today. But the selection is by name, not by build tag or package membership: a new integration-tagged test added under internal/mq with a different prefix builds cleanly, passes under a plain go test -tags integration ./internal/mq/..., and is simply never selected by this -run pattern — CI reports the integration job green, and nothing indicates a test was excluded.

  • Evidence: measured (every current integration-tagged test name in internal/mq matches the pattern, confirmed by listing them) plus inferred (the failure mode for a future test with a different prefix, not reproduced by actually adding one).
  • This is a structural/latent risk rather than a currently-manifesting bug: nothing is missed right now, but nothing enforces that it stays that way as internal/mq grows.

Reproduce/confirm: add a throwaway //go:build integration test to internal/mq named e.g. func TestMQNATSSomethingNew(...), run make test-integration (or the equivalent Makefile target), and confirm it neither runs nor is reported as skipped.

Found in review of #624.

Related: #624, #613.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/infraCI, build, deploy, Docker, releasebugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions