Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/v2-integration-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@ jobs:
run: uv run --frozen --extra dev python scripts/reconcile_v2_privileges.py apply --create-missing-roles
- name: Verify the managed v2 roles hold their declared privileges
run: uv run --frozen --extra dev python scripts/reconcile_v2_privileges.py verify
- name: Verify the installed PolicyEngine.py catalog interface
run: uv run --frozen --extra dev coverage run --branch -m pytest -q tests/integration/test_v2_catalog_installed.py
env:
RUN_V2_CATALOG_COMPATIBILITY: "1"
- name: Test v2 metadata publication, resource routes and the countries list
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_catalog_publication.py tests/integration/test_v2_metadata_routes.py tests/integration/test_v2_country_routes.py
run: uv run --frozen --extra dev coverage run --branch -m pytest -q tests/integration/test_v2_catalog_publication.py tests/integration/test_v2_metadata_routes.py tests/integration/test_v2_country_routes.py
- name: Test v2 policy persistence and immediate v1 mirroring
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_policy_persistence.py tests/integration/test_v1_policy_dual_write.py tests/integration/test_mysql_policy_dual_write.py tests/integration/test_v2_user_policy_mirroring.py tests/integration/test_v1_user_policy_dual_write.py
- name: Test signed-in identity provisioning and user associations
Expand All @@ -92,10 +88,10 @@ jobs:
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_household_persistence.py tests/integration/test_v1_household_dual_write.py tests/integration/test_mysql_household_spm_dual_write.py
- name: Test the row counts v1 ORM updates report on MySQL
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_mysql_update_row_counts.py
- name: Qualify production-scale v2 metadata publication
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_catalog_publication_qualification.py
env:
RUN_V2_CATALOG_PUBLICATION_QUALIFICATION: "1"
# The real US and UK models, reduced to a few parameter folders: the
# complete installed catalog is never loaded in CI.
- name: Publish selected parameter folders of the installed PolicyEngine.py models
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q --durations=10 tests/integration/test_v2_catalog_installed_folders.py
- name: Test real Redis cross-instance semantics
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_runtime_cache_redis.py
- name: Export v2 integration coverage
Expand Down
1 change: 1 addition & 0 deletions changelog.d/4149.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI no longer loads the complete installed PolicyEngine.py catalog. The cross-database integration tests publish a few parameter folders of the installed US and UK models, and a small catalog of edge-case values, and check that every value comes back from PostgreSQL unchanged.
18 changes: 18 additions & 0 deletions docs/engineering/skills/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,24 @@ Otherwise the release run runs them, and `publish-git-tag` requires lint, both
Alembic checks and the integration tests to pass, as before. The release test
suite always runs.

CI never loads the complete installed PolicyEngine.py catalog (about 1.2
million parameter values). Two tests in the cross-database check cover
publishing it instead, on every run:

- `test_v2_catalog_installed_folders.py` runs the real US and UK models through
extraction and publication, reduced to the parameter folders in its
`SELECTED_FOLDERS`, and reads every value back. Between them the folders
hold every value shape the installed models hold, and the test fails when
one is missing: replace a renamed folder with one that holds the same
values.
- `test_v2_catalog_publication.py` publishes
`tests/fixtures/v2_catalog_value_shapes.py`, which holds one example of each
value shape extraction accepts, and reads every value back. When extraction
accepts a new shape, add an example there.

Each release publishes and validates the complete catalog against staging,
then production, in `seed-v2-database.yml`.

Staging deployment checks run the live integration suite against the tagged
Cloud Run staging URL before promoting the exact tested revision to the
service URL. No production deployment may begin until the
Expand Down
18 changes: 7 additions & 11 deletions docs/migration/stage-9-v2-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,13 @@ regions. Publication took 24.120 seconds and added 7,968,103 bytes of measured
peak publisher memory. The US fallback summary reported 436 congressional
districts, 333 places, and 51 states.

Re-run the production-scale test only against disposable Postgres:

```bash
RUN_V2_CATALOG_PUBLICATION_QUALIFICATION=1 \
V2_ALEMBIC_DISPOSABLE_TEST=1 \
V2_MIGRATION_DATABASE_URL="<disposable-postgres-url>" \
uv run pytest -q tests/integration/test_v2_catalog_publication_qualification.py
```

Do not point this qualification command at a persistent staging or production
target.
The production-scale test that measured this,
`tests/integration/test_v2_catalog_publication_qualification.py`, was removed
with PolicyEngine/policyengine-api#4149: CI no longer loads the complete
catalog. Each release publishes and validates it against staging, then
production (`seed-v2-database.yml`), and the cross-database integration tests
publish selected parameter folders of the installed models and a catalog of
edge-case values (`docs/engineering/skills/testing.md`).

## Preview verification

Expand Down
Loading
Loading