Skip to content

[ci] python: parallelize suite across three shards and isolate native CLI regressions - #692

Merged
FayeSpica merged 2 commits into
ThinkFlowLab:mainfrom
FayeSpica:ci/parallel-python-shards
Dec 4, 2026
Merged

FayeSpica merged 2 commits into
ThinkFlowLab:mainfrom
FayeSpica:ci/parallel-python-shards

Conversation

@FayeSpica

Copy link
Copy Markdown
Collaborator

Summary

  • Split the monolithic python job in .github/workflows/release-checks.yml into three parallel matrix shards (core, agent-cli, media) driven by scripts/ci/python_shards.json, keeping full Python test coverage with zero dropped cases.
  • Move the dedicated Bundled OpenCode model gateway regression and Native Harness visual regression steps (including the ~168.5s uncached harness CLI install) into a parallel python-native job and register python-native as a required lane in scripts/ci/summarize_checks.py.
  • Extend scripts/ci/check_test_layers.py with --list-shard and --shard-profiles so the checks aggregate job verifies exact node-ID conservation between a full pytest tests --collect-only -m cpu inventory and the three executed shard profiles, plus --require-executed on all tests/ci_ready_contract.json PR representatives.
  • Remove three duplicate missing_rollout=True parameterizations in tests/test_native_runtime.py (default, opencode, claude), where line 125 previously coerced missing_rollout to False for every runtime except codex.

Linked issue

Labels

Apply type:ci and area:ci per CONTRIBUTING.md.

  • Labels applied

Test plan

  • Local (verified on candidate head c362df3571168c62839f203109265de01c64d8d7 against base 104cd9ed44eb03c453b0b3b52f69d205111a0b78):
    • pytest --basetemp=/tmp/od-ci-pytest-tmp tests/test_ci_hardware.py tests/test_ci_layers.py tests/test_ci_profile.py tests/test_ci_scope.py tests/test_ci_security.py tests/test_ci_summary.py -q -> 216 passed (28.41s).
    • pytest tests/test_native_runtime.py -k test_native_events_real_cli_and_shared_write -v -> 5 passed, 28 deselected (preserving False-default, False-opencode, False-codex, True-codex, False-claude).
    • Full vs 3-shard collection conservation: pytest tests --collect-only -q -m cpu + 3 shard --collect-only runs audited via scripts/ci/check_test_layers.py --profile ... --shard-profiles ... -> 3,820 tests (core=2621, agent-cli=437, media=762), zero duplicates, zero missing cases, 18 capabilities / 152 PR representatives aligned.
    • pre-commit hooks on both commits (check yaml, check json, check python ast, Lint GitHub Actions workflow files / actionlint) -> all passed.
  • Left to CI:
    • Live GitHub Actions execution of Release checks (python 3-shard matrix, python-native, checks artifact download and --require-executed shard audit) and actual before/after PR wall-clock timing measurement.
  • AI pre-review:
    • Independent subagent score: 83/100 (Scope & intent 3/3, Correctness & safety 3/3, Validation 2/3, Claim evidence 2/3, Simplicity 3/3; zero blocking findings)
    • Reviewed base: 104cd9ed44eb03c453b0b3b52f69d205111a0b78
    • Reviewed head: c362df3571168c62839f203109265de01c64d8d7
    • Material validation gaps: Live GitHub Actions execution of the updated workflow and post-change PR wall-clock measurements have not run yet and will be verified on the PR's CI run.

Evidence that it works

  • Visual evidence is N/A: this PR only changes CI workflow orchestration, test sharding manifests/audits, and a duplicate test parameterization; there are no user-visible UI, media, or product runtime changes.

  • Baseline CI measurement (6 successful non-docs Release checks runs on 2026-12-04: 47361449254, 47335776912, 47332260956, 47326951300, 47326254508, 47300800528): total PR wall time median 22.3 min (range 16.5 to 24.8 min), dominated by checks / python median 21.4 min (911.5s serial pytest + 168.5s uncached harness CLI install + 58.5s bundled OpenCode + 28.5s harness visual + 73s setup), compared to checks / browser (isolated) median 9.4 min. Live post-change wall-clock speedup is not claimed yet and will be measured from the PR's actual Release checks run.

  • Local conservation receipt on c362df3571168c62839f203109265de01c64d8d7:
    {"tests": 3820, "layers": {"ready": 3740, "merge": 68, "nightly": 12}, "unmarked": 3455, "capabilities": 18, "representative_cases": 152, "representative_outcomes": {"not_run": 152}, "browser_gate": 1, "shards": {"core": 2621, "agent-cli": 437, "media": 762}}

  • Applicable evidence attached and visual N/A explained

Provider verification

  • No real-provider calls were made; all local tests use local fixtures and fake CLI doubles.

Bilingual UI

  • No user-facing product copy changed (workflow step names keep existing bilingual EN / 中文 format).

@FayeSpica FayeSpica added type:ci Build, test and release automation area:ci Continuous integration and checks labels Dec 4, 2026

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD c362df3 Refs #273 · 非表决 COMMENT

三分片加独立 python-native 的方向对:完整 inventory 和分片按 test node ID 对账,能防止漏测和重复;作者的本地收集结果是 3,820 条。当前 Release checks 已启动,尚未验证实际提速。

合入前建议先覆盖一个操作:部分重跑时,已成功的 shard 仍只有旧 attempt 的产物,而汇总只找本次 attempt。这样即使测试都转绿,checks 仍可能因为缺分片证据失败。我把建议放在下载步骤;不建议直接混下全部 attempt,以免同名 JSON 覆盖。

当前证据暂定 75/100,非批准分(范围 3、正确性 2、验证 2、主张证据 2、简洁度 3;各满分 3)。我核对了 workflow、审计代码和 GitHub 的重跑语义,未重跑 CI,也未执行 PR 脚本。

English recap: On a partial rerun, the aggregate must use the successful attempt for each shard, or explicitly require a full rerun; matching only the latest attempt loses unchanged shard artifacts.

Dot,代表 @david6666666。

if: needs.python.result == 'success' && inputs.python-mark-expression == ''
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: python-test-evidence-*-${{ github.run_attempt }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的匹配只读当前 run_attempt。比如上一轮 core 已过、只重跑失败的 media,汇总会重跑,但 inventory.json 和 python-core.json 还在旧 attempt,最后变成「测试过了、门禁仍红」。部分重跑也要按 shard 找到本 run、同一受测 SHA 上实际成功的那次产物;如果暂不支持,请明确报错提示 Re-run all jobs。建议补一例「旧 core + 新 media」的聚合测试。GitHub 重跑行为 (Partial reruns can leave successful shard evidence in an earlier attempt.)

@FayeSpica
FayeSpica merged commit 42c5dc3 into ThinkFlowLab:main Dec 4, 2026
17 checks passed
Qing7364 pushed a commit to Qing7364/OpenDirector that referenced this pull request Dec 4, 2026
## summary

- Merge main at 42c5dc3, preserving impact queries alongside
  upstream receipt queries and localized contract errors.
- Reuse ThinkFlowLab#648 worker isolation and ThinkFlowLab#692 Python CI shards; include
  both impact test modules in the existing core manifest.
- Record integration checks, media validation dependencies and
  remaining validation limits.

## validation

- CPU shards: 3,766 passed, 121 skipped; 3,887 identities audited
  with all 152 required representatives passing.
- Bundled OpenCode: 7 passed, 2 Windows-only skips.
- Frontend: 1,119 passed; desktop: 13 passed, 1 opt-in skip.
- Contracts, imports, i18n, browser inventories, production build
  and whole-PR and integration static checks passed.

Refs ThinkFlowLab#355
Zhangbo-cn added a commit to Zhangbo-cn/OpenDirector that referenced this pull request Dec 5, 2026
ThinkFlowLab#692 split the Python suite into three shard manifests, but ThinkFlowLab#676 added
tests/test_ark_availability.py after that list was generated, so the
manifest-coverage test fails on current main. Enroll that module together
with the seed-audio modules this branch adds so each test module is
collected exactly once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Continuous integration and checks type:ci Build, test and release automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[roadmap] Q4 2026 CI: layered gates, nightly health and release evidence / 分层门禁、Nightly 健康度与发布证据

2 participants