Enhance e2e debug information with artifact collection#1356
Enhance e2e debug information with artifact collection#1356rafaelvzago wants to merge 6 commits intoistio-ecosystem:mainfrom
Conversation
|
Hi @rafaelvzago. Thanks for your PR. I'm waiting for a istio-ecosystem or istio member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1356 +/- ##
==========================================
- Coverage 80.64% 80.55% -0.09%
==========================================
Files 44 44
Lines 2299 2299
==========================================
- Hits 1854 1852 -2
- Misses 327 328 +1
- Partials 118 119 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ilure Implement a new DebugCollector type that captures comprehensive cluster state information when e2e tests fail and saves it as artifacts. The debug collector: - Records initial cluster state (namespaces) to focus on test-created resources - Collects resources (Deployments, DaemonSets, Services, Pods, ConfigMaps) - Captures pod logs from all containers - Gathers events from all namespaces - Collects custom resources (Istio, IstioCNI, ZTunnel, IstioRevision, IstioRevisionTag) - Saves istioctl proxy-status output - Organizes artifacts in timestamped directories under $ARTIFACTS Supports configurable collection depth via DEBUG_COLLECTOR_DEPTH env var (full, minimal, logs-only) to control the amount of debug data collected. Fixes istio-ecosystem#892 Assisted-by: AI Code Assistant Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Integrate the DebugCollector into all e2e test suites to automatically collect comprehensive debug information when tests fail: - Ambient test suite - Control plane and control plane update test suites - Dual stack test suite - Multi-control plane test suite - Multicluster test suites (primary-remote, multi-primary, external control plane) - Operator installation test suite Each test suite now: 1. Creates a debug collector with a descriptive context name 2. Records initial cluster state in BeforeAll 3. Collects and saves debug artifacts in AfterAll on test failure 4. For multicluster tests, creates separate collectors for each cluster The debug artifacts are saved before the existing LogDebugInfo call, ensuring debug information is preserved even if cleanup fails. Related to istio-ecosystem#892 Assisted-by: AI Code Assistant Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Update LogDebugInfo to provide a concise summary that directs users to the debug artifacts directory for detailed information, rather than printing extensive debug output to the console. Changes: - Print TEST FAILURE DETECTED banner with artifacts directory location - Display quick status summary with high-level pod information - Remove verbose debug output (now saved to artifacts by DebugCollector) - Keep console output clean while preserving full debug info in artifacts This improves test output readability while ensuring comprehensive debug information is still available in the artifacts directory for troubleshooting. Related to istio-ecosystem#892 Assisted-by: AI Code Assistant Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Add comprehensive documentation for the debug collector feature to the e2e test README, including: - How to use the debug collector in test suites - Explanation of artifact directory structure - DEBUG_COLLECTOR_DEPTH environment variable options - Best practices for multicluster test debugging - Examples of debug collector usage patterns The documentation follows the same pattern as the existing cleaner documentation and provides clear guidance for test authors on how to leverage the debug collection feature. Related to istio-ecosystem#892 Assisted-by: AI Code Assistant Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
- Use new octal literal style (0o755, 0o644) - Remove unused parameter in collectCustomResources - Remove unused imports (istioctl, ptr) from common utils - Remove obsolete debug functions that were replaced by artifact collection These changes ensure code quality and align with project linting standards. Related to istio-ecosystem#892 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
44e18d8 to
ccf9044
Compare
Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356
Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: #1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: #1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com> Co-authored-by: Rafael Zago <rafaelvzago@gmail.com>
…em#1357) Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
…em#1357) Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
…em#1363) Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com> Co-authored-by: Rafael Zago <rafaelvzago@gmail.com> Signed-off-by: Rafael Zago <rafaelvzago@gmail.com>
…em#1357) Update the codecov.yml ignore pattern from 'tests' to 'tests/**' to properly exclude all files under the tests directory from coverage calculation. This resolves the codecov/project failures for PRs that add e2e test infrastructure code, which is not meant to be unit tested. Related to: istio-ecosystem#1356 Signed-off-by: Rafael Zago <rafaelvzago@gmail.com> Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
This PR enhances e2e test debugging by implementing a comprehensive debug artifact collection system that automatically captures cluster state when tests fail.
Key Features
New DebugCollector Package (
tests/e2e/util/debugcollector/)Integrated into All Test Suites
Configurable Collection Depth
Improved Console Output
Why We Need It
Currently, when e2e tests fail, the console output has predefined commands that aren't always sufficient to diagnose failures. This enhancement provides comprehensive cluster state capture (similar to must-gather), organizes debug information for easier analysis, and saves artifacts for CI/CD systems.
Implementation Approach
Similar to the existing Cleaner pattern from PR #889, but focused on debug collection rather than cleanup.
Artifact Directory Structure
Environment Variables
Security
Testing
Red Hat AI Compliance
This implementation was developed with AI code assistant support. All AI-generated code has been thoroughly reviewed, tested, and validated according to Red Hat AI guidelines. No sensitive information was used in development.
Assisted-by: AI Code Assistant