Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Mlflow Mlflow Xtest Viz

From Leeroopedia
Knowledge Sources
Domains CI/CD, Testing, Visualization
Last Updated 2026-02-13 20:00 GMT

Overview

Visualizes cross-version test results from GitHub Actions as a markdown table showing test status across dates.

Description

xtest_viz.py is a developer tool that provides a dashboard view of MLflow's cross-version test health. It uses the aiohttp library to asynchronously fetch scheduled workflow run results from the GitHub Actions API, then generates a markdown table with test names as rows and dates as columns.

The XTestViz class encapsulates all functionality:

  • get_workflow_runs fetches completed scheduled runs of the cross-version-tests.yml workflow within a specified time window, handling pagination
  • get_workflow_jobs retrieves individual job results for each workflow run
  • _fetch_run_jobs processes a single run's jobs, converting conclusions to emoji status indicators and extracting the parsed job name from parentheses
  • fetch_all_jobs orchestrates concurrent fetching of all jobs using asyncio.gather
  • _pivot_job_results transforms flat job results into a pivot table structure (name -> date -> status)
  • _build_markdown_table renders the pivot data as a formatted markdown table with aligned columns

The JobResult dataclass captures each job's parsed name, date (MM/DD format), and status (a markdown link with emoji). Status mapping uses: checkmark for success, X for failure, warning for cancelled, question mark for unknown, and dash for no data. Skipped jobs are filtered out entirely.

The script uses PEP 723 inline script metadata to declare its aiohttp dependency, enabling direct execution with uv run.

Usage

Use this tool to monitor the health of cross-version compatibility tests, identify flaky tests, or diagnose regressions in specific framework integrations.

Code Reference

Source Location

Signature

@dataclass
class JobResult:
    name: str
    date: str
    status: str

class XTestViz:
    def __init__(self, github_token: str | None = None, repo: str = "mlflow/dev"): ...
    def status_to_emoji(self, status: str) -> str | None: ...
    def parse_job_name(self, job_name: str) -> str: ...
    async def get_workflow_runs(self, session, days_back: int = 30) -> list[dict]: ...
    async def get_workflow_jobs(self, session, run_id: int) -> list[dict]: ...
    async def fetch_all_jobs(self, days_back: int = 30) -> list[JobResult]: ...
    def render_results_table(self, data_rows: list[JobResult]) -> str: ...
    async def generate_results_table(self, days_back: int = 30) -> str: ...

async def main() -> None: ...

Import

# Run directly with uv (handles dependency installation automatically)
uv run dev/xtest_viz.py

# Or install aiohttp and run with Python
pip install aiohttp
python dev/xtest_viz.py

I/O Contract

Inputs

Name Type Required Description
--days int No Number of days back to fetch results (default: 14)
--repo str No GitHub repository in owner/repo format (default: mlflow/dev)
--token str No GitHub token (default: uses GH_TOKEN environment variable)
GH_TOKEN env var No GitHub personal access token for API authentication

Outputs

Name Type Description
stdout Markdown table Formatted table with test names as rows, dates as columns, and emoji status links

Usage Examples

Basic Usage

# Fetch last 14 days from mlflow/dev (default)
uv run dev/xtest_viz.py

# Fetch last 30 days
uv run dev/xtest_viz.py --days 30

# Use a different repository
uv run dev/xtest_viz.py --repo mlflow/mlflow

# Provide a GitHub token explicitly
uv run dev/xtest_viz.py --token ghp_xxxxxxxxxxxx

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment