Skip to content

select-e2e.sh: a per-suite test edit silently defeats the full-suite escalation #3330

Description

hack/select-e2e.sh escalates a change under packages/system/<pkg> to the full suite by way of a safety net at the end of the script: a system source with no *-application descendants leaves final_apps empty, and an empty selection falls back to every suite.

# Safety net: a system source with no *-application descendants would otherwise
# silently skip E2E. Fall back to full suite so a path inside the graph is
# never silently dropped.
if [ -z "$final_apps" ]; then
  echo "$all_apps" | paste -sd ' ' -
  exit 0
fi

The fallback keys off emptiness alone, so anything else that contributes a suite name swallows the signal. Editing one unrelated suite's tests is enough:

$ printf 'packages/system/cozystack-basics/templates/ingress-hostname-policy.yaml\n' > /tmp/a
$ sh hack/select-e2e.sh /tmp/a
bucket clickhouse etcd external-dns foundationdb gateway harbor kafka kubernetes-latest
kubernetes-oidc-customconfig kubernetes-oidc-system kubernetes-previous kuberture mariadb
mongodb openbao postgres qdrant redis securitygroup serviceexposure vminstance

$ printf 'packages/system/cozystack-basics/templates/ingress-hostname-policy.yaml\nhack/e2e-chainsaw/postgres/chainsaw-test.yaml\n' > /tmp/b
$ sh hack/select-e2e.sh /tmp/b
postgres

The same system-package change that selects 22 suites on its own selects exactly one once the PR also touches an unrelated suite. The narrowing is silent — nothing in the output records that an escalation was dropped.

The shape that triggers it is ordinary: change a platform component, and add or adjust e2e nearby. packages/core/, api/, cmd/, internal/, hack/*.sh and the Makefile match full_suite_pattern and escalate unconditionally, so they are unaffected; packages/system/ is the one that depends on the empty-selection fallback and can therefore lose it.

A fix would track the escalation as its own flag — set when a source cannot be mapped to any *-application descendant — and union it with the selected suites, rather than inferring it from an empty list.

Found while working on #3208, which is itself an instance: it edits packages/system/cozystack-basics and hack/e2e-chainsaw/gateway, and so runs gateway where the package change alone would have run everything. Harmless there — the change is a semantic no-op on the all-lowercase configuration every e2e cluster uses, and gateway is where the touched policies' e2e lives — but the mechanism is general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ciIssues or PRs related to CI workflows, GitHub Actions, automationkind/bugCategorizes issue or PR as related to a bugtriage/needs-triageIndicates an issue needs triage by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions