Skip to content

Add TAP test writing guide and GitHub automation improvements#5215

Merged
renecannao merged 2 commits intov3.0from
feature/add-tap-test-documentation
Nov 22, 2025
Merged

Add TAP test writing guide and GitHub automation improvements#5215
renecannao merged 2 commits intov3.0from
feature/add-tap-test-documentation

Conversation

@renecannao
Copy link
Contributor

Summary

  • Add comprehensive TAP test writing guide for ProxySQL development
  • Add GitHub automation workflows for improved issue management and code review
  • Ignore GEMINI.md file from git tracking

Changes

  • Documentation: Created detailed TAP test writing guide in doc/TAP_TESTS_GUIDE.md
  • GitHub Automation: Added Gemini-based workflows for issue triage, code review, and scheduled maintenance
  • Git Configuration: Updated .gitignore to exclude GEMINI.md

This file is generated by the Gemini CLI and is not part of the project.
@gemini-code-assist
Copy link

Summary of Changes

Hello @renecannao, 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 development ecosystem by providing clear guidelines for writing robust tests and improving workflow automation. It aims to standardize testing practices and streamline repository management through new GitHub workflows, ultimately contributing to more reliable code and efficient development cycles.

Highlights

  • TAP Test Writing Guide: A new comprehensive guide (doc/TAP_TESTS_GUIDE.md) has been added, detailing best practices and structure for writing C++ Test Anything Protocol (TAP) tests for ProxySQL.
  • GitHub Automation Workflows: New Gemini-based GitHub automation workflows have been introduced to enhance issue management and streamline code review processes.
  • Git Configuration Update: The .gitignore file has been updated to prevent GEMINI.md from being tracked by Git.
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.

@sonarqubecloud
Copy link

@renecannao renecannao merged commit dd847a1 into v3.0 Nov 22, 2025
4 of 5 checks passed
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

This pull request introduces a comprehensive guide for writing TAP tests and updates the .gitignore file. The guide is well-written and will be a valuable resource for developers. I've provided one suggestion to improve the code example in the guide to make it more robust and prevent common pitfalls with TAP testing. The pull request description also mentions adding GitHub automation workflows, but the corresponding files do not seem to be included in the diff.

Comment on lines +166 to +170
ok(res && mysql_num_rows(res) == 1, "Rule 999 should exist in stats.");
if (res && mysql_num_rows(res) == 1) {
MYSQL_ROW row = mysql_fetch_row(res);
ok(atoi(row[0]) == 1, "Rule 999 should have exactly 1 hit.");
}

Choose a reason for hiding this comment

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

medium

The example test logic has a flaw that could be confusing for new test writers. With a fixed test plan (plan(3)), the number of ok() calls must be constant. Here, one of the ok() calls is inside a conditional block, so if the condition fails, the total number of tests run will not match the plan, causing the test suite to report a 'dubious' result. This can be misleading. Additionally, atoi(row[0]) is unsafe if row or row[0] is NULL, which could lead to a crash. It's better to structure the test to always run the planned number of assertions and to perform NULL checks.

Suggested change
ok(res && mysql_num_rows(res) == 1, "Rule 999 should exist in stats.");
if (res && mysql_num_rows(res) == 1) {
MYSQL_ROW row = mysql_fetch_row(res);
ok(atoi(row[0]) == 1, "Rule 999 should have exactly 1 hit.");
}
if (res && mysql_num_rows(res) == 1) {
ok(true, "Rule 999 should exist in stats.");
MYSQL_ROW row = mysql_fetch_row(res);
ok(row && row[0] && atoi(row[0]) == 1, "Rule 999 should have exactly 1 hit.");
} else {
ok(false, "Rule 999 should exist in stats.");
ok(false, "Rule 999 hit count is incorrect (rule not found).");
}

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