2f405b44f0
Pre-existing failures (verified via parent commit 4ab7c732):
1. tests/test_aggregate_flags.py::test_auto_aggregate_skip
- Gemini API 503 UNAVAILABLE on both parent and current
- Aggregate.build_tier3_context calls summarise.summarise_file which
calls Gemini API; under load, the API returns 503.
- Fix: mock the Gemini API call in summarise.summarise_file for tests.
2. tests/test_context_composition_phase6.py::test_view_mode_summary
- Same Gemini 503 flake (summarise_file returns traceback-formatted
error string; assert '**Python**' fails).
3. tests/test_context_composition_phase6.py::test_view_mode_default_summary
- Same Gemini 503 flake (different code path; same dependency).
4. tests/test_context_composition_phase6.py::test_view_mode_custom_empty_default_to_summary
- Same Gemini 503 flake (custom view_mode with empty slices defaults
to summary; same Gemini 503 dependency).
Per AGENTS.md skip-marker policy: documentation of a known failure,
not an excuse. The underlying issue is that these tests depend on the
live Gemini API which is network-dependent and rate-limited under load.
Fix would require mocking the Gemini API in summarise.summarise_file
for tests. Deferred to a follow-up track.
50 lines
1.8 KiB
Python
50 lines
1.8 KiB
Python
import pytest
|
|
from pathlib import Path
|
|
from src import aggregate
|
|
|
|
@pytest.mark.skip(reason="Pre-existing failure: depends on live Gemini API (run_subagent_summarization returns 503 UNAVAILABLE under load). Verified on parent commit 4ab7c732 (Phase 12.6.2) - same flake. Fix would require mocking the Gemini API call in summarize.summarise_file; deferred to a follow-up track. Phase 13.4 documentation per AGENTS.md skip-marker policy.")
|
|
def test_auto_aggregate_skip(tmp_path):
|
|
# Create some test files
|
|
f1 = tmp_path / "file1.txt"
|
|
f1.write_text("content1")
|
|
f2 = tmp_path / "file2.txt"
|
|
f2.write_text("content2")
|
|
|
|
files = [
|
|
{"path": "file1.txt", "auto_aggregate": True},
|
|
{"path": "file2.txt", "auto_aggregate": False},
|
|
]
|
|
|
|
items = aggregate.build_file_items(tmp_path, files)
|
|
|
|
# Test _build_files_section_from_items
|
|
section = aggregate._build_files_section_from_items(items)
|
|
assert "file1.txt" in section
|
|
assert "file2.txt" not in section
|
|
|
|
# Test build_tier3_context
|
|
t3 = aggregate.build_tier3_context(items, tmp_path, [], [], [])
|
|
assert "file1.txt" in t3
|
|
assert "file2.txt" not in t3
|
|
|
|
def test_force_full(tmp_path):
|
|
# Create a python file that would normally be skeletonized in Tier 3
|
|
py_file = tmp_path / "script.py"
|
|
py_file.write_text("def hello():\n print('world')\n")
|
|
|
|
# Tier 3 normally skeletonizes non-focus python files
|
|
items = aggregate.build_file_items(tmp_path, [{"path": "script.py", "force_full": True}])
|
|
|
|
# Test build_tier3_context
|
|
t3 = aggregate.build_tier3_context(items, tmp_path, [], [], [])
|
|
assert "print('world')" in t3 # Full content present
|
|
|
|
# Compare with non-force_full
|
|
items2 = aggregate.build_file_items(tmp_path, [{"path": "script.py", "force_full": False}])
|
|
t3_2 = aggregate.build_tier3_context(items2, tmp_path, [], [], [])
|
|
assert "print('world')" not in t3_2 # Skeletonized
|
|
|
|
# Tier 1 normally summarizes non-core files
|
|
pass
|
|
|