diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 04ad01da1..07d8e0a79 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -20,7 +20,7 @@ jobs: - name: Install package run: make install - name: Run tests - run: make test + run: make test_GH - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v4 diff --git a/Makefile b/Makefile index 235052b5f..0923700d2 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,11 @@ format: linecheck . --fix install: pip install -e .[dev] -test: +test_GH: + coverage run -a --branch -m policyengine_core.scripts.policyengine_command test fiscalsim_us/tests/policy/ -c fiscalsim_us + coverage xml -i + pytest "not local" fiscalsim_us/tests/ --maxfail=0 +test_local: coverage run -a --branch -m policyengine_core.scripts.policyengine_command test fiscalsim_us/tests/policy/ -c fiscalsim_us coverage xml -i pytest fiscalsim_us/tests/ --maxfail=0 diff --git a/fiscalsim_us/variables/gov/states/README.md b/fiscalsim_us/variables/gov/states/README.md index e208225b4..17b51833e 100644 --- a/fiscalsim_us/variables/gov/states/README.md +++ b/fiscalsim_us/variables/gov/states/README.md @@ -33,7 +33,7 @@ The tax law of each US state is different. Some states have flat taxes, and some * [`ut_refundable_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/ut/tax/income/credits/refundable_credits/ut_refundable_credits.py) ## Write tests for all new variables -FiscalSim US is built on the OpenFisca platform. Tests in this repository are written as `.yaml` files saved in the [`/fiscalsim_us/tests/`](https://github.com/TheCGO/fiscalsim-us/tree/main/fiscalsim_us/tests) folder. These tests are run automatically upon any pull request commits to the main repository through the [`pr.yaml`](https://github.com/TheCGO/fiscalsim-us/blob/main/.github/workflows/pr.yaml) and [`push.yaml`](https://github.com/TheCGO/fiscalsim-us/blob/main/.github/workflows/push.yaml) GitHub Action files using the `pytest` package. These GitHub Actions run the `make test` command, which references the [`make test` portion](https://github.com/TheCGO/fiscalsim-us/blob/main/Makefile#L8) of the [`Makefile`](https://github.com/TheCGO/fiscalsim-us/blob/main/Makefile). +FiscalSim US is built on the OpenFisca platform. Tests in this repository are written as `.yaml` files saved in the [`/fiscalsim_us/tests/`](https://github.com/TheCGO/fiscalsim-us/tree/main/fiscalsim_us/tests) folder. These tests are run automatically upon any pull request commits to the main repository through the [`pr.yaml`](https://github.com/TheCGO/fiscalsim-us/blob/main/.github/workflows/pr.yaml) and [`push.yaml`](https://github.com/TheCGO/fiscalsim-us/blob/main/.github/workflows/push.yaml) GitHub Action files using the `pytest` package. These GitHub Actions run the `make test_GH` command, which references the [`make test_GH` portion](https://github.com/TheCGO/fiscalsim-us/blob/main/Makefile#L8) of the [`Makefile`](https://github.com/TheCGO/fiscalsim-us/blob/main/Makefile). One should write at least one test in a `.yaml` file in the [`/fiscalsim_us/tests/`](https://github.com/TheCGO/fiscalsim-us/tree/main/fiscalsim_us/tests) folder for every variable created. These test `.yaml` files should have the same name and directory structure as the new variables being tested. For example, the test for the `ut_income_tax` variable defined in [`ut_income_tax.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/ut/tax/income/ut_income_tax.py) should be [`ut_income_tax.yaml`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/tests/policy/baseline/gov/states/ut/tax/income/ut_income_tax.yaml).