Skip to content

test(e2e): align e2e assertions with current admission behavior - #27

Merged
bakito merged 2 commits into
projectcapsule:mainfrom
bakito:e2e
Nov 23, 2026
Merged

bakito merged 2 commits into
projectcapsule:mainfrom
bakito:e2e

Conversation

@bakito

@bakito bakito commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Brings the e2e suite in line with how admission currently behaves, and runs the impersonation specs that don't need Capsule in the standalone suite too.

Changes

Align assertions with current admission behavior

  • Protection composition: replication-protected ConfigMaps now also accept Capsule's "managing parent is not yet available" denial. Capsule returns it once the parent replication is deleted, and the validating webhooks can answer in any order.
  • Lifecycle: add patchLifecyclePhaseFrom so a test can move a permit from any starting phase. The delete-active test now moves the permit from Active to Expired, not from Requested.
  • GlobalResourcePermitTemplate: expect the Resource Permits controller's denial ("protected by a ResourcePermit can only be changed by the Resource Permits controller") instead of the old Capsule message.

Wider standalone coverage

  • Move the GlobalResourcePermitTemplate and ResourcePermitTemplate impersonation specs into describeGlobalTemplateImpersonation / describeNamespacedTemplateImpersonation. Each is registered twice:
    • with Capsule (config label), including the Tenant-based specs
    • standalone (standalone label), only the specs that use plain namespaces and explicit ServiceAccounts, guarded by expectCapsuleAPIsAbsent
  • New spec, "enters Failed when write permissions are revoked and recovers on retry": checks that the resolved ServiceAccount is protected while a permit uses it, that revoking write access after preflight fails the permit at the Activation stage, and that a retry recovers it.
  • Add grantResourcePermitRequesterRole. The standalone chart doesn't add the resource-permits-requester role to admin, so requesters get an explicit RoleBinding.
  • Move the Capsule-absence check into the shared helper expectCapsuleAPIsAbsent.

Tooling

  • Add task e2e:delete to remove the e2e Kind cluster left behind by an interrupted run.
  • task e2e now prints the path of its temporary kubeconfig, so you can reach the test cluster while a run is in progress (e.g. KUBECONFIG=<path> kubectl get pods -A).
  • go mod tidy: drop stale go.sum checksums left after the capsule v0.15.2 and dependency upgrades.

Testing

  • task e2e (standalone)
  • task e2e E2E_MODE=capsule E2E_FILTER=resource-permit

@bakito bakito closed this Nov 22, 2026
@bakito bakito reopened this Nov 22, 2026
@bakito
bakito force-pushed the e2e branch 2 times, most recently from bfa6cfa to 120d3f7 Compare November 22, 2026 13:19
@bakito bakito changed the title test(e2e): fix e2e test issues test(e2e): align e2e assertions with current admission behavior Nov 22, 2026
@bakito
bakito marked this pull request as ready for review November 22, 2026 13:55
@bakito
bakito requested a review from oliverbaehler November 22, 2026 13:56
Signed-off-by: bakito <github@bakito.ch>
@bakito
bakito merged commit 148243f into projectcapsule:main Nov 23, 2026
25 checks passed
@bakito
bakito deleted the e2e branch November 23, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants