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

Task: Set up pytest and integrate unit testing into PR workflow #1010

Open
5 tasks
nlebovits opened this issue Nov 20, 2024 · 4 comments
Open
5 tasks

Task: Set up pytest and integrate unit testing into PR workflow #1010

nlebovits opened this issue Nov 20, 2024 · 4 comments

Comments

@nlebovits
Copy link
Collaborator

nlebovits commented Nov 20, 2024

Task Description

Configure the repository to use pytest for unit testing and integrate it into the pr_checks_backend workflow. Ensure that every PR impacting the data directory and its subdirectories triggers a unit testing check.

Steps

  1. Install pytest as a development dependency.
  2. Set up the repository for pytest:
    • Confirm that it discovers and runs all test files named test_*.py.
  3. Integrate a unit testing step into the pr_checks_backend workflow:
    • Run pytest for PRs impacting the data directory and its subdirectories.
  4. Configure the workflow to:
    • Report success when all tests pass.
    • Report failure when one or more tests fail.

Acceptance Criteria

  • pytest is installed and configured in the repository.
  • Existing tests run successfully using pytest.
  • A unit testing check step using pytest is added to the pr_checks_backend workflow.
  • Workflow triggers the unit testing step only for PRs impacting the data directory and its subdirectories.
  • PR comments/reporting:
    • Success is reported when all tests pass.
    • Failure is reported when any test fails.
@nlebovits nlebovits changed the title Task: Add a pytest unit testing step to backend Task: Set up pytest and integrate unit testing into PR workflow Nov 20, 2024
@nlebovits nlebovits changed the title Task: Set up pytest and integrate unit testing into PR workflow Task: Set up pytest and integrate unit testing into PR workflow Nov 20, 2024
@rmartinsen
Copy link
Contributor

I'd like to take a shot at this one. Seems important for work going forward.

@nlebovits
Copy link
Collaborator Author

@rmartinsen assigned! thanks for tackling--lmk if you run into issues

@nlebovits nlebovits moved this to In Development in Clean & Green Philly Nov 27, 2024
@rmartinsen
Copy link
Contributor

This ticket is moving along and the tests run fine on the backend. The one issue I'm running into is with test_diff_backup.py. While these are certainly useful, they aren't really classic unit tests in that they aren't isolated from each other and hit external resources (slack, gcp, email etc.).

Would there be any issues with moving this out of tests and creating a simpler suite for this functionality? I'm not sure where it would go. Possibly data_utils?

@nlebovits
Copy link
Collaborator Author

Yeah, I think that's probably fine. Maybe @zigouras has opinions, since he's the one who wrote them? Fwiw, I'm not sure how switching to using hypertables will affect the data diff functionality. That's something I need to puzzle through--would be glad to get some help on it, if that's in your wheelhouse @rmartinsen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Development
Development

No branches or pull requests

2 participants