Skip to content

support test output files#7295

Merged
waruqi merged 4 commits intodevfrom
testout
Feb 5, 2026
Merged

support test output files#7295
waruqi merged 4 commits intodevfrom
testout

Conversation

@waruqi
Copy link
Member

@waruqi waruqi commented Feb 5, 2026

@waruqi waruqi added this to the v3.0.7 milestone Feb 5, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @waruqi, 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 significantly enhances the testing framework by introducing the capability to define expected test outputs using external files. This change provides greater flexibility and improves the maintainability of tests, particularly for scenarios involving large or complex output patterns, by decoupling the expected output from the test definition itself.

Highlights

  • New Test Output Options: Introduced pass_output_files and fail_output_files options to add_tests, allowing expected test outputs to be loaded from external files for more flexible test definitions.
  • Output File Loading Utility: Added a new internal function _load_output_files responsible for reading and processing content from specified output files, including path resolution and optional whitespace trimming.
  • Test Configuration Updates: Updated the _do_test_target function to integrate file-based output checks and ensure compatibility with existing test options, specifically preventing file-based checks when realtime_output is enabled.
  • Example Test Cases: Added new test cases (pass_output_file and fail_output_file) in tests/actions/test/xmake.lua to demonstrate the usage of the new file-based output checking feature.

🧠 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
  • tests/actions/test/outputs/fail_hello_xmake.txt
    • Added a new text file containing expected output for a failing test case.
  • tests/actions/test/outputs/pass_hello_foo.txt
    • Added a new text file containing expected output for a passing test case.
  • tests/actions/test/xmake.lua
    • Introduced a new test target test_output_files to showcase the new pass_output_files and fail_output_files options.
    • Configured new tests pass_output_file and fail_output_file to use the newly supported file-based output checks.
  • xmake/actions/test/main.lua
    • Implemented the _load_output_files function to handle reading and processing content from external output files.
    • Modified the _do_test_target function to incorporate the loaded file contents into the test output comparison logic.
    • Updated assertions in _do_test_target to prevent using file-based output checks when realtime_output is enabled, ensuring logical consistency.
Activity
  • The author waruqi initiated this pull request to introduce support for defining test outputs using external files.
  • Two new test data files, fail_hello_xmake.txt and pass_hello_foo.txt, were added to serve as examples for the new feature.
  • The xmake.lua test configuration was updated to include a new target and specific test cases demonstrating the use of file-based output checks.
  • The core testing logic in xmake/actions/test/main.lua was extended with a new utility function and modifications to integrate the file-based output comparison.
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
Contributor

@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

This pull request introduces a valuable feature for specifying expected test outputs from files, which is particularly useful for tests with large outputs. The implementation is well-done, primarily through the new _load_output_files function. I have a couple of suggestions to enhance the code: one to simplify path resolution for better readability and another to update an assertion message for improved clarity.

@waruqi waruqi merged commit 4f828e0 into dev Feb 5, 2026
70 checks passed
@waruqi waruqi deleted the testout branch February 5, 2026 14:56
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.

1 participant