Skip to content

[281#6] test: add metadata test coverage (unit, e2e, upgrade)#292

Closed
mpechkurov wants to merge 4 commits into
feat/metadata-wire-all-resourcesfrom
test/metadata-coverage
Closed

[281#6] test: add metadata test coverage (unit, e2e, upgrade)#292
mpechkurov wants to merge 4 commits into
feat/metadata-wire-all-resourcesfrom
test/metadata-coverage

Conversation

@mpechkurov
Copy link
Copy Markdown
Collaborator

What

  • New client-level IsUpToDate / GenerateCreate / GenerateUpdate / GenerateObservation tests for Domain, Org, Space (new files)
  • Add TestIsUpToDate_Metadata to App, Route, SCB, ServiceInstance existing test files
  • E2E: AssertDefaultLabels and AssertLabelsAndAnnotations helpers verify crossplane labels + user metadata
  • E2E: Add label/annotation assertions to app, orgspace, services, and SRB tests
  • E2E: Add labels and annotations to all CR YAML manifests
  • Upgrade test: verify default labels appear on existing Space after provider upgrade
  • Fix: deduplicate space fixture names in orgspace e2e CRs

Coverage

  • Nil metadata, label drift/match, annotation drift/match, subset semantics
  • Pre-upgrade: no crossplane-* labels; post-upgrade: all 3 present
  • Covers all 8 eligible resource types

Part of

Split from #281 — PR 6 of 6. Depends on [281#3].

Merge order: [281#1] → [281#2] → [281#3] → [281#4] → [281#5] → [281#6]

Add GenerateCreate, GenerateUpdate, GenerateObservation, and
IsUpToDate tests for Domain, Org, and Space clients (new files).
Add TestIsUpToDate_Metadata to App, Route, SCB, and ServiceInstance
existing test files. Covers nil metadata, label drift/match,
annotation drift/match, and subset semantics where applicable.
Add e2e test coverage for Crossplane default labels and user-provided
labels/annotations on CF resources. New AssertDefaultLabels and
AssertLabelsAndAnnotations helpers verify crossplane-kind, crossplane-name,
and crossplane-providerconfig labels as well as user metadata.

- Add label/annotation assertions to app, orgspace, services, and SRB tests
- Add labels and annotations to all CR YAML manifests
- Poll for updated labels after SRB update (reconciler async)
- Skip label checks for observe-only resources (Org, Domain, etc.)
- Fix gofmt spacing, trailing whitespace, missing newlines
- Fix dangling close-paren syntax error in orgspace test
- Move SRB updated manifest to updated/ subdirectory
Verify that Crossplane default labels (crossplane-kind, crossplane-name,
crossplane-provider-config) are correctly applied to existing Space
resources after a provider upgrade.

- Pre-upgrade: assert no crossplane-* labels on CF resource
- Post-upgrade: assert all 3 default labels present with correct values
- Uses observe-only Org CR as Space dependency
- Follows CustomUpgradeTestBuilder pattern from existing upgrade tests
Both spaces had forProvider.name 'e2e-space', causing a CF naming collision within the same org. Renamed to e2e-space-ref and e2e-space-name to match their CR metadata names.
@SatabdiG
Copy link
Copy Markdown
Collaborator

Closing as #281 received review comments.

@SatabdiG SatabdiG closed this May 27, 2026
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.

3 participants