* Update tox.ini to document libmagic1 system dependency requirement * [CI] Consolidate test reports into single PR comment This change reduces noise in PR comments by combining multiple test reports (runner and sdk1) into a single consolidated comment. Changes: - Add combine-test-reports.sh script to merge test reports - Update CI workflow to combine reports before posting - Replace separate runner/sdk1 comment steps with single combined step - Summary section shows test counts (passed/failed/total) collapsed by default - Full detailed reports available in collapsible sections - Simplify job summary to use combined report Benefits: - Single PR comment instead of multiple separate comments - Cleaner PR comment section with less clutter - Easy-to-read summary with detailed inspection on demand - Maintains all existing test information 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix test count extraction in combine-test-reports script The previous version was using text pattern matching which incorrectly extracted test counts. This fix properly parses the pytest-md-report markdown table format by: - Finding the table header row to determine column positions - Locating the TOTAL row (handles both TOTAL and **TOTAL** formatting) - Extracting values from the passed, failed, and SUBTOTAL columns - Using proper table parsing instead of pattern matching This resolves the issue where the summary showed incorrect counts (23 for both runner and sdk1 instead of the actual 11 and 66). Fixes: Test count summary in PR comments now shows correct values 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix LaTeX formatting in pytest-md-report test count extraction pytest-md-report wraps all table values in LaTeX formatting: $$\textcolor{...}{\tt{VALUE}}$$ The previous fix attempted to parse the table but didn't handle the LaTeX formatting, causing it to extract 0 for all counts. Changes: - Add strip_latex() function to extract values from LaTeX wrappers - Update grep pattern to match TOTAL row specifically (not SUBTOTAL in header) - Apply LaTeX stripping to all extracted values before parsing This fix was tested locally with tox-generated reports and correctly shows: Runner=11 passed, SDK1=66 passed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
48 lines
1.5 KiB
INI
48 lines
1.5 KiB
INI
[tox]
|
|
env_list = py{312}, runner, sdk1
|
|
requires =
|
|
tox-uv>=0.2.0
|
|
|
|
isolated_build = True
|
|
|
|
[testenv]
|
|
install_command = uv pip install {opts} {packages}
|
|
deps = uv
|
|
skip_install = true
|
|
|
|
[testenv:runner]
|
|
changedir = runner
|
|
setenv =
|
|
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
|
|
deps = uv
|
|
allowlist_externals=
|
|
sh
|
|
uv
|
|
pytest
|
|
commands_pre =
|
|
# Try to install dependencies from various requirements files
|
|
sh -c '[ -f cloud_requirements.txt ] && uv pip install -r cloud_requirements.txt || echo "cloud_requirements.txt not found"'
|
|
# Install dependencies from pyproject.toml
|
|
uv pip install -e .
|
|
# Install the Flask dependency explicitly (in case the above doesn't work)
|
|
uv pip install flask~=3.1.0 docker==6.1.3 redis~=5.2.1 python-dotenv>=1.0.0 kubernetes
|
|
# Install test dependencies
|
|
uv pip install pytest pytest-cov pytest-md-report pytest-mock
|
|
commands =
|
|
pytest -v --md-report-verbose=1 --md-report --md-report-flavor gfm --md-report-output ../runner-report.md
|
|
|
|
[testenv:sdk1]
|
|
changedir = unstract/sdk1
|
|
deps = uv
|
|
allowlist_externals=
|
|
sh
|
|
uv
|
|
pytest
|
|
commands_pre =
|
|
# System dependency required: libmagic1
|
|
# Install with: sudo apt-get install -y libmagic1 (Ubuntu/Debian)
|
|
# Install dependencies with test group
|
|
uv sync --group test
|
|
commands =
|
|
uv run pytest -v -m "not slow" --cov=src/unstract/sdk1 --cov-report=term --cov-report=html --md-report-verbose=1 --md-report --md-report-flavor gfm --md-report-output ../../sdk1-report.md
|