Add CTST tests for storage usage reporting API#2340
Add CTST tests for storage usage reporting API#2340bert-e merged 13 commits intodevelopment/2.14from
Conversation
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
3f908f3 to
eee9043
Compare
42df742 to
1ef0c43
Compare
54b4acc to
4e692d3
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following reviewers are expecting changes from the author, or must review again: |
4e692d3 to
0885b8e
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following reviewers are expecting changes from the author, or must review again: |
Replace the three scalar World keys (identityNameForScenario,
identityTypeForScenario, accountNameForScenario) with a typed
SavedIdentity[] array. This makes multiple identities naturally
queryable and eliminates manual additionalAccountNames tracking.
- Add SavedIdentity interface and getSavedIdentities/getSavedIdentity helpers
- saveIdentityInformation now appends to the array
- useSavedIdentity uses getSavedIdentity() (defaults to last entry)
- Migrate direct getSaved reads in bucket-policies and iam-policies
- Simplify "{int} additional accounts" step
- Drop additional accounts After cleanup hook
Issue: ZENKO-5202
Use the existing data_consumer Keycloak user (which has the DataConsumer role, not StorageManager) instead of introducing a dedicated norights user. This removes the KeycloakUsernameNoRights world parameter and reuses the existing DataConsumerUsername parameter. Issue: ZENKO-5202
Call prepareMetricsScenarios directly in the Before hook instead of going through an unnecessary indirection layer. Issue: ZENKO-5202
Add optional size parameter to putObject and uploadSetup so callers can pass the object size directly rather than routing it through the World saved-state dictionary. Issue: ZENKO-5202
… groups Collapse permission scenarios into a single parameterized Scenario Outline with role/expectedStatus examples. Separate content tests (structure, multi-account, metrics) into their own group. Replace two hardcoded When steps with a single parameterized step using a role-to-username lookup. Issue: ZENKO-5202
Disable camelcase rule for role-to-username map keys (must match Keycloak usernames). Shorten step names and parameter names to stay within 120-char line limit. Issue: ZENKO-5202
DarkIsDude
left a comment
There was a problem hiding this comment.
Can you check the CI ?
The roleToWorldParam lookup resolved role names to ctst_-prefixed usernames (e.g. ctst_storage_manager) which are not valid for direct Keycloak token acquisition. Pass the role string directly instead, matching how managementAPIRequest works elsewhere. Issue: ZENKO-5202
The SavedIdentity refactor changed useSavedIdentity to read from an array, but getSavedIdentity returns undefined when no identity was saved. This crashed CountItems which calls useSavedIdentity via 'the operation finished without error' without prior identity setup. Match old behavior by returning early when no identity exists. Issue: ZENKO-5202
- Rename "role" to "persona" in feature file and step definitions
- Replace hardcoded Keycloak usernames with World parameter keys
- Add Given step for persona setup, decoupled from When action
- Split into "tries to retrieve" (no status check) and "retrieves" (asserts 200)
- Add generic "Then the http response code is {int}" step in common
- Remove section comments from feature file
Issue: ZENKO-5202
Kubernetes events expire after 1 hour by default. In CI, kind export logs often runs 1-2 hours after the test window, by which time the relevant events have already been garbage-collected. This was a concrete gap during the Azure archive flakiness investigation (PR #2340): the failing tests ran around 06:36 but kind export logs didn't execute until ~08:22 — nearly 2 hours later. All Kubernetes events from the failure window (pod scheduling, restarts, liveness probe failures, OOM kills) had expired and were unavailable for diagnosis. Bump --event-ttl to 4h via a kubeadm ClusterConfiguration patch in the Kind cluster config, ensuring events survive for the entire duration of CI jobs. Issue: ZENKO-5217
World parameter keys (StorageManagerUsername, DataConsumerUsername) resolve to ctst_-prefixed usernames which lack the instanceIds Keycloak attribute required by the management API. Use the base Keycloak usernames directly. Issue: ZENKO-5202
CI now passes |
DarkIsDude
left a comment
There was a problem hiding this comment.
Congrats. Thanks for all the refactoring done. LGTM 🙏
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
| sourceRegistry: ghcr.io/scality | ||
| image: pensieve-api | ||
| tag: 1.9.0 | ||
| tag: 1.9.1 |
There was a problem hiding this comment.
depending on timing, we may want to bump 1.9.2 and update VERSION (when rebasing before the merge) so we can make the release (c.f. https://scality.atlassian.net/browse/ZENKO-5210)
→ ping me if in doubt how to "optimize" rebuilds
|
/after_pull_request=2357 |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
The following options are set: after_pull_request |
Summary
GET /instance/{uuid}/reporting/usagePensieve routemanagementAPIRequestwith optionalusername/passwordparams for testing different Keycloak usersprepareMetricsScenarioswithobjectSize/objectCountoptions for uploading non-empty test objectsIssue: ZENKO-5202