Skip to content

Add @proxysql_min_version tag for version-aware TAP test execution#5562

Merged
renecannao merged 2 commits intov3.0from
v3.0_ci_min_proxysql_version_5561
Apr 9, 2026
Merged

Add @proxysql_min_version tag for version-aware TAP test execution#5562
renecannao merged 2 commits intov3.0from
v3.0_ci_min_proxysql_version_5561

Conversation

@rahim-kanji
Copy link
Copy Markdown
Collaborator

@rahim-kanji rahim-kanji commented Apr 3, 2026

Summary

  • Introduces @proxysql_min_version:X.Y metadata tag in groups.json to skip tests that require a newer ProxySQL version than the one being tested
  • Tagged 19 FFTO/TSDB tests with @proxysql_min_version:3.1 and 46 GenAI/MCP/AI tests with @proxysql_min_version:4.0
  • Tests without a tag run on all versions (backwards compatible)

Closes #5561

Summary by CodeRabbit

  • Tests
    • Added runtime ProxySQL version detection to filter tests based on version compatibility requirements.
    • Tests requiring specific minimum versions are now conditionally skipped if the current ProxySQL version doesn't meet the threshold.
    • Enhanced test reporting to display version-related skip information.

Skip tests that require a newer ProxySQL version than the one being
tested, preventing false-positive CI failures across v3.0.x/v3.1.x/4.0.x
branches. Tagged 19 FFTO/TSDB tests (>=3.1) and 46 GenAI/MCP/AI tests
(>=4.0) in groups.json. Tests without a tag run on all versions.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a54534e0-06bf-4f33-86cb-98277515c8b7

📥 Commits

Reviewing files that changed from the base of the PR and between f713d78 and b771e4f.

📒 Files selected for processing (4)
  • test/infra/control/run-tests-isolated.bash
  • test/scripts/bin/proxysql-tester.py
  • test/tap/groups/check_groups.py
  • test/tap/groups/groups.json

📝 Walkthrough

Walkthrough

Implemented version-aware test filtering by detecting ProxySQL binary version at runtime and skipping tests annotated with @proxysql_min_version:<min_ver> tags when the detected version is insufficient. Changes span test infrastructure, test discovery, group validation, and group metadata.

Changes

Cohort / File(s) Summary
Test Infrastructure & Version Detection
test/infra/control/run-tests-isolated.bash, test/scripts/bin/proxysql-tester.py
Added runtime ProxySQL version detection via ${WORKSPACE}/src/proxysql --version with regex extraction and semantic version comparison. Extended test filtering logic to conditionally skip tests when detected version is below the @proxysql_min_version:<min_ver> threshold using packaging.version; logs warnings if binary is missing and reports skipped tests to stderr.
Group Validation & Metadata Filtering
test/tap/groups/check_groups.py
Modified load_groups() to exclude entries with keys beginning with @ from validation logic, preventing metadata tags from being treated as test names in group comparison sets.
Test Group Metadata
test/tap/groups/groups.json
Added @proxysql_min_version:3.1 qualifiers to 17 FFTO and TSDB-related test groups, and @proxysql_min_version:4.0 qualifiers to 48 GenAI/MCP/AI-related test groups (e.g., ai_error_handling_edge_cases-t, genai_*-t, mcp_*-t, nl2sql_*-t, vector_*-t).

Sequence Diagram

sequenceDiagram
    participant Runner as Test Runner
    participant Detector as Version Detector
    participant Binary as ProxySQL Binary
    participant Discovery as Test Discovery
    participant Executor as Test Executor
    
    Runner->>Detector: Start test run
    Detector->>Binary: Execute --version
    Binary-->>Detector: Return version string
    Detector->>Detector: Parse semantic version (e.g., 4.0.0)
    Detector-->>Runner: Detected version
    
    Runner->>Discovery: Load test groups & metadata
    Discovery->>Discovery: Parse groups.json & `@proxysql_min_version` tags
    Discovery-->>Runner: Tests with min_version requirements
    
    Runner->>Runner: For each test: compare detected_version >= min_version?
    alt Version Match
        Runner->>Executor: Queue test for execution
        Executor-->>Runner: Test runs
    else Version Mismatch
        Runner->>Runner: Log skip (requires vX.Y+)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A fuzzy friend hops through the test gates,
Checking versions, no false alates!
Three-point-one for FFTO's leap,
Four-point-oh for secrets deep,
With metadata tags, our tests run true! 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main objective: adding @proxysql_min_version tags for version-aware test execution.
Linked Issues check ✅ Passed The PR implements all core requirements from issue #5561: groups.json tagged with version metadata, proxysql-tester.py filters by version, and check_groups.py ignores @-prefixed entries.
Out of Scope Changes check ✅ Passed All changes align with #5561 scope: version-aware test infrastructure, TAP test configuration, and docker/infra setup for test groups. No unrelated logic modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v3.0_ci_min_proxysql_version_5561

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rahim-kanji rahim-kanji changed the base branch from v3.0 to v3.0-ci_84_mysql84 April 3, 2026 11:45
Copy link
Copy Markdown

@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 adds support for MySQL 8.4 to the CI infrastructure, introducing a new infra-mysql84-binlog environment and a standalone binlog reader. It implements version-based test filtering via a new @proxysql_min_version tag and updates existing TAP tests to accommodate MySQL 8.4 changes, such as the utf8mb3 charset and revised error codes. Review feedback identifies a missing Python dependency (packaging.version) in some environments, security risks with eval in shell scripts, and several bugs in test_binlog_reader-t.cpp, including a mismatched argument in a diagnostic message and redundant semicolons.

I am having trouble creating individual review comments. Click here to see my feedback.

test/infra/control/run-tests-isolated.bash (188)

medium

The script imports packaging.version, which is not part of the Python standard library. This introduces a dependency that might not be present in all CI environments, potentially causing the test runner to fail. Consider using distutils.version.LooseVersion (though deprecated) or a simple custom version parsing helper to avoid external dependencies.

test/infra/infra-mysql84-binlog/bin/docker-proxy-post.bash (12)

medium

Using eval to perform variable substitution in the SQL file is brittle and potentially dangerous. If the SQL content contains characters like backticks or dollar signs that are not intended for shell expansion, the command will fail or produce incorrect SQL. A safer and more robust approach would be to use envsubst if available, or a simple sed command for specific variables.

References
  1. Avoid using eval on untrusted or complex strings as it can lead to unexpected shell execution or mangling of data.

test/tap/tests/test_binlog_reader-t.cpp (201)

medium

Redundant double semicolon at the end of the line.

	uint32_t hg_whg_sync_queries = hg_stats.at(WHG).second;

test/tap/tests/test_binlog_reader-t.cpp (203)

medium

Redundant double semicolon at the end of the line.

	uint32_t hg_rhg_sync_queries = hg_stats.at(RHG).second;

test/tap/tests/test_binlog_reader-t.cpp (221)

medium

There is a logic error in the diagnostic message arguments. hg_rhg_queries is passed twice at the end, but the format string expects act_sync_queries as the last placeholder, which should be hg_rhg_sync_queries.

		WHG, hg_whg_exp_queries, hg_whg_queries, hg_whg_exp_sync_queries, hg_whg_sync_queries,
		RHG, NUM_CHECKS, hg_rhg_queries, NUM_CHECKS, hg_rhg_sync_queries

test/tap/tests/test_binlog_reader-t.cpp (242)

medium

Redundant double semicolon at the end of the line.

	hg_whg_sync_queries = hg_stats.at(WHG).second;

test/tap/tests/test_binlog_reader-t.cpp (244)

medium

Redundant double semicolon at the end of the line.

	hg_rhg_sync_queries = hg_stats.at(RHG).second;

test/tap/tests/test_read_only_actions_offline_hard_servers-t.cpp (41)

medium

Hardcoding RHG = WHG + 1 is risky as it assumes a specific hostgroup numbering convention that may not hold true for all infrastructures. It is better to explicitly read RHG from an environment variable (e.g., TAP_MYSQL8_READER_HG) or derive it more reliably from the infrastructure configuration.

@rahim-kanji rahim-kanji changed the base branch from v3.0-ci_84_mysql84 to v3.0 April 9, 2026 08:38
Signed-off-by: René Cannaò <rene@proxysql.com>
@renecannao renecannao merged commit a3bde28 into v3.0 Apr 9, 2026
1 of 5 checks passed
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

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.

Add @proxysql_min_version tag to groups.json for version-aware test execution

2 participants