You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the SPM country tests unit tests, with two integration tests against the installed US model #4135
tests/unit/test_country_spm.py took about 14 of the 41 minutes of the pull request workflow's Test job on #4039. make test runs tests/unit in one process under coverage run --branch.
37 of the file's 63 tests ran the installed policyengine-us model through two function-scoped fixtures:
real_canonical_country reloaded and revalidated the 26.6 MB SPM forecast for every test (about 0.65 s each), although policyengine-us already caches it.
real_http_client built a new Flask app, calculation service, response cache and database row for every test.
Most of those cases repeated one error-to-response mapping for each combination of settings, which stand-in tests can check in milliseconds. One case ran /us/calculate-full, which calculates every variable in the model; it took 48.6 s locally, and 95.0 s when repeated in the same process.
Goal
The unit suite holds only fast unit tests, with stand-in simulations and no real model or forecast.
The checks that need the installed model are two integration tests, sharing one app and service for the session.
/us/calculate-full is checked with a stand-in of the route's behaviour.
Activity