PolicyEngine / policyengine-api

PolicyEngine's REST API for computing policy impacts.
GNU Affero General Public License v3.0
12 stars 28 forks source link

Improve testing #2021

Open anth-volk opened 3 days ago

anth-volk commented 3 days ago

Fixes #2015 Partially fixes #2013 (some tests will need to be broken up into relevant files) Fixes #2007 Fixes #1357

Inspired by #2010 (a regression introduced by #2006), this PR creates a new testing structure for economy-wide simulations. The aim is to make it simple to test that a series of common reform impacts (e.g., modifying the federal income tax rate) still runs and returns values within reason for certain key measures. This does not compare outputs with country packages (that's open as #2017, but it's unclear if its likely slow pace would justify writing it).

This also begins to move toward a more concise testing folder structure, whereby integration tests (any that hit use the rest_client Pytest fixture to simulate an endpoint hit, then check its response) are distinct from unit tests. A few tests are either also being modified in an open PR or would need to be subdivided to match the internal file structure, so they've been relegated to a temporary to_be_refactored folder.

anth-volk commented 2 days ago

@nikhilwoodruff My understanding is that we already do: the make test command passes MAX_HOUSEHOLDS=10000 as an environment variable before running the tests

anth-volk commented 22 hours ago

Per discussion with @nikhilwoodruff, I'll be cutting a few tests out of this later today. Also need to rebase.