OSAC-1546: Add tenancy tests for explicit tenant handling#708
Conversation
This increases the coverage of the tenancy tests to make sure that when a user of the public API specifies a tenant explicitly it is honoured during both creation and update operations. The new tests verify three scenarios: The first checks that when a user creates an object with an explicit tenant that differs from the tenancy logic's default, the explicitly specified tenant is stored rather than being overridden by the default. The second checks that when an object is updated without mentioning the tenant in the update mask, the original tenant is preserved. The test intentionally configures a default tenant that differs from the one used during creation, so it can distinguish between genuine preservation and accidental re-defaulting. The third checks that when a user explicitly sets a different tenant during an update (via `metadata.tenant` in the update mask), the new tenant is persisted to the database. Related: https://redhat.atlassian.net/browse/OSAC-1546 Related: osac-project#704 Assisted-by: Cursor Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
|
@jhernand: This pull request references OSAC-1546 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhernand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a ChangesTenancy Test Coverage for Cluster Create/Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
This increases the coverage of the tenancy tests to make sure that when a user of the public API
specifies a tenant explicitly it is honoured during both creation and update operations. The new
tests verify three scenarios:
default, the explicitly specified tenant is stored rather than being overridden by the default.
is preserved. The test intentionally configures a default tenant that differs from the one used
during creation, so it can distinguish between genuine preservation and accidental re-defaulting.
metadata.tenantin theupdate mask), the new tenant is persisted to the database.
Related: https://redhat.atlassian.net/browse/OSAC-1546
Related: #704
Test plan
ginkgo run --focus="Tenancy logic" -v internal/serversgolangci-lint)Summary by CodeRabbit