Skip to content

Try to export HLKX package even when test run crashed#875

Open
kostyanf14 wants to merge 1 commit intoHCK-CI:masterfrom
kostyanf14:RHELMISC-26374
Open

Try to export HLKX package even when test run crashed#875
kostyanf14 wants to merge 1 commit intoHCK-CI:masterfrom
kostyanf14:RHELMISC-26374

Conversation

@kostyanf14
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 23, 2026 14:46
@gemini-code-assist
Copy link

Summary of Changes

Hello @kostyanf14, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness of the HCK test engine by ensuring that the HLKX project package is always generated, even if the test runs themselves encounter failures. This change aims to streamline the debugging process by providing the necessary package for analysis, allowing developers to fix the root cause of failures without needing to re-run the entire test suite from scratch.

Highlights

  • Robust HLKX Package Export: Modified the auto_run method to ensure that the HLKX project package is attempted to be created even if test execution steps encounter errors. This allows for easier debugging and re-runs by providing the package regardless of test outcomes.
  • New Exception Handling Helper: Introduced a new private helper method, rescue2return, which executes a given block and, if a StandardError occurs, logs the error and returns the exception object instead of immediately raising it. This enables deferred exception handling.
  • Deferred Exception Propagation: Refactored the auto_run method to collect any exceptions from test execution and package creation steps. The first encountered exception is then re-raised at the end of the method, ensuring that the overall process still indicates failure while allowing subsequent critical steps to complete.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lib/engines/hcktest/hcktest.rb
    • Added a new private helper method rescue2return to capture and return exceptions.
    • Refactored the auto_run method to use rescue2return for run_tests_without_config, run_tests_with_config, and create_project_package calls.
    • Implemented logic to collect and re-raise the first encountered exception after all critical steps have been attempted in auto_run.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a rescue2return helper method and modifies the auto_run method to attempt exporting the HLKX package even if intermediate test steps fail. This change improves resilience by ensuring that the package creation is attempted, which can aid in debugging and recovery. The use of rescue2return to capture exceptions and then re-raise them conditionally is a good pattern for controlled error handling.

Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to ensure the HLKX (project) package export is attempted even if the HLK test run fails, so a partially successful run can still produce a reusable package for troubleshooting.

Changes:

  • Added a helper to run steps while capturing exceptions instead of aborting immediately.
  • Updated auto_run to attempt create_project_package even when earlier test phases fail, then re-raise the first captured failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +293 to +295
raise ex1 if ex1
raise ex2 if ex2
raise ex3 if ex3
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raising the captured exception object later (raise ex1) will report the raise site as the origin in logs/backtraces, obscuring where the failure actually occurred. Since bin/auto_hck logs exception.backtrace, preserve the original backtrace when re-raising (e.g., raise with the stored backtrace) so the fatal log points to the real root cause.

Suggested change
raise ex1 if ex1
raise ex2 if ex2
raise ex3 if ex3
raise ex1, ex1.message, ex1.backtrace if ex1
raise ex2, ex2.message, ex2.backtrace if ex2
raise ex3, ex3.message, ex3.backtrace if ex3

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emmm, what? Looks like hallucinations.

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.

2 participants