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

Rewrite foundations of unit tests #189

Merged
merged 16 commits into from
Jul 6, 2024
Merged

Rewrite foundations of unit tests #189

merged 16 commits into from
Jul 6, 2024

Conversation

No767
Copy link
Owner

@No767 No767 commented Jul 2, 2024

Summary

Since the beginning of Catherine-Chan, unit tests have been an part of the codebase. These unit tests weren't written properly as I was still learning the ropes of pytest and unit testing in general. These tests over time broke, and with the release of pytest 8, entirely broken all unit tests that I had written. Instead of looking at code coverage, this time around, unit tests are being rewritten. This time around, I've included tox to handle running them, and settings are passed in pyproject.toml. In short, this time, unit tests are being done properly and with one step at a time, we are able to make Catherine-Chan much better than before.

Changes had to be made in order to work with the github actions workflow. This means that when it comes to loading with the configuration, the migrations and unit tests will first try and locate the uri using the config.yml configuration, but will fallback to loading from an environment variable (POSTGRES_URI). This environment variable is passed into tox so things won't break.
As another note, all of the old unit tests are now located in the old_tests folder in the root directory of the repo.

Types of changes

What types of changes does your code introduce to Catherine-Chan
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (Updates to README.md, the documentation, etc)
  • Other (if none of the other choices apply)

Checklist

Put an x in the boxes that apply

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes. (if appropriate)
  • All workflows (except pre-commit.ci) pass with my new changes
  • This PR does not address a duplicate issue or PR

Copy link

sonarcloud bot commented Jul 6, 2024

@No767 No767 merged commit 0726627 into main Jul 6, 2024
13 checks passed
@No767 No767 deleted the noelle/pytest-upgrade branch July 6, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant