Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement unit testing #95

Closed
nicolassaw opened this issue Jul 8, 2024 · 3 comments
Closed

Implement unit testing #95

nicolassaw opened this issue Jul 8, 2024 · 3 comments
Assignees
Labels
architecture big picture how all the code and data fit together

Comments

@nicolassaw
Copy link
Contributor

Problem
There is no quick way to test specific pieces of the code without running the code from the beginning and creating test data (ie. HTML and json files) to work with. Unit tests would provide built-in ways to do so.

Goal
Add unit testing to the code (python documentation). Ensure that your test HTML or json files are redacted and do not store real person data. Store any test files in the resources folder.

@nicolassaw nicolassaw added the architecture big picture how all the code and data fit together label Jul 8, 2024
@nicolassaw
Copy link
Contributor Author

nicolassaw commented Jul 26, 2024

Design unit tests for these modules:

  • scraper: complete (for searching one specific cause number)
  • parser: complete (for parsing one specific cause number)
  • cleaner: in progress
  • updater: in progress
  • orchestrater: in progress

Next step ideas for unit testing:

  • For tests that people run before merging new versions: Come up with test that runs based on a specific known day and judicial officer.
  • For tests that run before weekly live running: Test based on the past week of live data.
  • Create unit tests for cleaner that considers structure of final visualizations

@nicolassaw nicolassaw moved this from 🔖 To-do to 🏗 In progress in Product - Indigent Defense Stats Jul 28, 2024
@nicolassaw
Copy link
Contributor Author

We are rethinking how we're doing unit tests and are making them more modular. This means that this is blocked by #93 in so far as each of the functions needs to be built out for each major module in order to write the unit tests for each of the functions. But not all of the modules need to be written to begin unit testing on any individually, just the one being tested.

In this pull request, the scraper has been rewritten to have modules and many of the scraper unit tests have been written, but not all of them. Those last scraper unit tests can be written.

But writing unit tests for parser, cleaner, and updater is blocked by that module being rewritten in #93.

@nicolassaw
Copy link
Contributor Author

Unit testing for the scraper module is complete.

This ticket has been broken down into sub-tickets for each of the separate modules:
#113
#119
#107

Accordingly, this ticket can be closed.

@nicolassaw nicolassaw moved this from 🏗 In progress to ✅ Done in Product - Indigent Defense Stats Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture big picture how all the code and data fit together
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant