Fix clean checkout CI assumptions

This commit is contained in:
732642856
2026-06-24 14:59:57 +08:00
parent 164d6ea90a
commit 408b3bf5c1
4 changed files with 13 additions and 4 deletions
+3
View File
@@ -297,3 +297,6 @@
- GitHub Actions 复查发现 PR #6 head `062dc86``validate``test` 均失败:`validate` 失败点为 Ruff lint`test` 失败点为全量 `python -m pytest -q`;Actions 日志下载需要仓库 admin 权限,改为本地补齐 dev 依赖后复现。
- 修复 CI 阻断:`tests/conftest.py` 统一保证当前仓库 `scripts``sys.path[0]`,并在每个测试前清理从 `~/.workbuddy/skills/jyotish-vedic-astrology/scripts` 载入的同名模块,避免历史测试收集期污染 `prashna``tests/test_ashtakavarga_invariants.py` 给需要先改 `sys.path` 的脚本导入加 Ruff E402 标注。
- 验证完成:`python3 -m ruff check scripts/run_quality_gate.py tests/test_varga_bphs.py tests/test_ashtakavarga_invariants.py tests/test_cli_smoke.py tests/test_yoga_rules_integrity.py` 通过;`python3 -m pytest -q` 全量通过;`python3 scripts/run_quality_gate.py --profile quick --skip-yoga-logic` 通过,核心质量门 198 个 pytest、npm build 与 runtime smoke 通过。
- 继续复查 PR #6 ActionsRuff 已转绿,但 `quick quality gate``pytest suite` 仍失败;在 `/tmp/yinduzhanxing-ci-repro` 干净 clone 复现,根因为 `test_fragment_audit_blocks_registry_surface_drift` 假设 `.git/lost-found` 一定存在,以及 `test_kp_system.py` 依赖未纳入 Git 的 `VedicAstro/vedicastro/data/KP_SL_Divisions.csv`
- 修复 clean checkout 测试依赖:碎片审计测试改为检查 lost-found 字段结构而非要求本机残留数量;KP 外部 oracle CSV 缺失时明确 `pytest.skip`,保留内建 360° wrap 测试。
- 发布包链路进展:`python3 -m build --no-isolation --wheel --sdist` 成功生成 wheel/sdist`python3 -m twine check dist/*` 通过;全新 venv 安装 wheel 后 `jyotish-engine --help` 可用。
+3 -1
View File
@@ -95,4 +95,6 @@
- [x] 完整 browser/release profile 与云端分支同步检查:browser/release profile 均通过,分支 `codex/release-hygiene-ci` 已推送到远端并更新现有 PR #6
- [x] PR CI 云端稳定性修复:`.github/workflows/ci.yml` 显式使用 `--profile quick --skip-yoga-logic`,避免 PR 环境因未安装真实浏览器/Playwright 依赖而误触 browser click smoke。
- [x] GitHub Actions 失败根因修复:本地复现 PR `validate` 的 Ruff E402 与 `test` 全量 pytest 的 WorkBuddy 旧 skill 路径污染,新增 pytest import guard 并修复 Ashtakavarga lint。
- [ ] 下一步:推送 CI 修复后复查 GitHub Actions 结果;继续检查发布包链路,必要时补充 release-only workflow 的 browser/release 守门
- [x] Clean checkout CI 复现与修复:用干净 clone 复现 `.git/lost-found` 本机残留假设和 KP 外部 CSV fixture 缺失,修复为 clean checkout 可运行/可跳过的测试策略
- [x] 发布包基础链路验证:wheel/sdist 构建成功,`twine check dist/*` 通过,全新 venv 安装 wheel 后 CLI help 可用。
- [ ] 下一步:推送 clean checkout 修复后复查 GitHub Actions 结果;补充 release-only workflow 的 browser/release 守门。
+3 -2
View File
@@ -15,8 +15,8 @@ if SCRIPTS not in sys.path:
import jyotish_api_server # noqa: E402
from jyotish_api_server import ( # noqa: E402
BadRequest,
DEFAULT_ALLOWED_ORIGINS,
BadRequest,
JyotishAPIHandler,
_load_local_module,
_parse_allowed_origins,
@@ -538,7 +538,8 @@ def test_fragment_audit_blocks_registry_surface_drift() -> None:
assert result['registry']['technique_count'] >= 60
assert result['workspace_residue']['untracked_count'] >= 0
assert isinstance(result['workspace_residue']['untracked_files'], list)
assert result['workspace_residue']['git_lost_found_count'] >= 1
assert result['workspace_residue']['git_lost_found_count'] >= 0
assert isinstance(result['workspace_residue']['git_lost_found_files'], list)
assert result['open_source_sources']['source_count'] >= 3
assert all(row['commands'] for row in result['rows'] if row['status'] in {'covered', 'complete'})
assert not any(problem['kind'] == 'missing_output_path' for problem in result['problems'])
+4 -1
View File
@@ -9,11 +9,12 @@ import csv
import os
import sys
import pytest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'scripts'))
from kp_system import get_kp_lords
SIGNS = [
'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo',
'Libra', 'Scorpio', 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces'
@@ -39,6 +40,8 @@ def _dms_to_degree(value: str) -> float:
def _load_rows(limit=None):
if not os.path.exists(CSV_PATH):
pytest.skip(f"VedicAstro KP oracle fixture not available: {CSV_PATH}")
with open(CSV_PATH, newline='', encoding='utf-8') as f:
rows = list(csv.DictReader(f))
return rows if limit is None else rows[:limit]