diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 80384937..16b4caf7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ Thanks for contributing! Please remove any top-level sections that do not apply to your changes. -- [ ] `make format` and `make documentation` has been run. (You may also want to run `make test`.) +- [ ] `make format` and `make documentation` has been run. (You may also want to run `make test-local`.) # New variable diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 07d8e0a7..93fb3088 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_GH + 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 0923700d..4873f483 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,11 @@ format: linecheck . --fix install: pip install -e .[dev] -test_GH: +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: +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 17b51833..c1faf965 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_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). +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).