Skip to content

Commit

Permalink
Updated Makefile make test sections
Browse files Browse the repository at this point in the history
  • Loading branch information
rickecon committed Oct 2, 2024
1 parent 84defb4 commit 4197c70
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fiscalsim_us/variables/gov/states/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit 4197c70

Please sign in to comment.