WIP: generalize post test debug#1072
Conversation
Add an end-to-end test that deploys a Monitoring UIPlugin with the cluster-health-analyzer enabled, fires a synthetic PrometheusRule alert, and verifies the corresponding incident metric appears. Framework additions: SkipIfClusterVersionBelow (semver gate that fails on unknown version instead of silently skipping), DumpNamespaceDebug (on-failure diagnostic dump of deployments, pods and events), and AssertPromQLResultWithOptions (configurable poll interval/timeout). The UIPlugin setup is race-tolerant: deleteUIPluginIfExists issues a direct Delete and treats IsNotFound as success, avoiding a TOCTOU window between Get and Delete that could cause spurious failures. Made-with: Cursor
Cache the full ClusterVersion object during Framework.Setup() so that SkipIfClusterVersionBelow uses the cached value instead of making a redundant API call. Also add a comment explaining the unique suffix for rule names. Made-with: Cursor
Introduce a composable DebugFunc interface and DumpOnFailure helper in the e2e framework. Tests register debug functions (namespace dumps, CR-specific diagnostics) that only run when the test fails. Apply it across all e2e test suites for consistent post-failure diagnostics. Includes temporary ForceFailure calls (marked TODO: remove) to exercise the debug dump output. Made-with: Cursor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: DavidRajnoha The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Skipping CI for Draft Pull Request. |
|
PR needs rebase. DetailsInstructions 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 kubernetes-sigs/prow repository. |
Follow Up of #1038