Run the full-catalog integration tests only when a change can affect them

オープン
#4,149 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@anth-volk がすでに取り組んでいます。

2026年10月30日 から。

  • #4150 @anth-volk による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
github-actions, postgresql, python

調査の方向性

Start with .github/workflows/v2-integration-check.yml and the two named full-catalog tests; review tests/fixtures/v2_catalog.py to understand the existing fixture. Add pull-request coverage for the specified value shapes in PostgreSQL, and isolate the full-catalog tests behind the described change-path conditions, nightly schedule, and manual dispatch. Done means the lightweight checks run on every pull request, the full tests run when required, and the linked pull request indicates this work is already underway.

索引モデルが issue の本文から書いたものです。

説明

Problem

The check "Cross-database integration tests / MySQL, PostgreSQL, and Redis integration" (job catalog-runtime-integration in .github/workflows/v2-integration-check.yml) took 7 to 38 minutes over the last 12 successful pull request runs, with no code change between them; the spread follows the runner that picks the job up. With "Test" split into shards, it becomes the longest pull request job.

Two steps take 85 to 90% of the job. Each loads the complete installed PolicyEngine.py catalog (extract_installed_catalog(), about 1.2 million parameter values) in its own process:

  • "Verify the installed PolicyEngine.py catalog interface" (tests/integration/test_v2_catalog_installed.py): 363 s on run 41067605238, about 120 s on a fast runner.
  • "Qualify production-scale v2 metadata publication" (tests/integration/test_v2_catalog_publication_qualification.py): 1,157 s on the same run, about 180 s on a fast runner.

Their outcome can change only when the installed packages, the catalog code, the v2 schema or the tests themselves change. Every other pull request repeats them for nothing.

The small catalog fixture the other publication tests use (tests/fixtures/v2_catalog.py) holds two parameter values, both plain numbers, so a pull request that skipped the full catalog would not check how PostgreSQL stores the other value shapes extraction accepts.

Change

  1. Add a small catalog of deliberately chosen edge cases (one parameter value of each shape extraction accepts, bracket parameters, open-ended and one-day date ranges, region filters), publish it to PostgreSQL on every pull request, and assert that each value comes back unchanged.
  2. Move the two full-catalog tests into their own job in the same workflow, loading the catalog once for both, with runner diagnostics (nproc, free -m, lscpu) and --durations=10.
  3. In that job, compare the commit with the pull request's base (or the previous push) and run the full-catalog tests only when the change touches uv.lock, pyproject.toml, the catalog code, the catalog's database models, the v2 migrations, the two tests or the workflow. The job itself always runs and passes, so "CI complete" and the release run's check of the merge run keep working.
  4. Run the full-catalog tests every night and on manual dispatch.

Each release still publishes the full catalog to staging and production (seed-v2-database.yml) before it deploys.

主要言語
Python
スター
18
フォーク
33
平均マージ
2日 3時間
マージ済み PR(30日)
72

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/policyengine-api のほかの issue

PolicyEngine/policyengine-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。