-
Notifications
You must be signed in to change notification settings - Fork 13
Issues/172 #188
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
base: dev
Are you sure you want to change the base?
Issues/172 #188
Conversation
tagging the ray image in ga workflow
bug fix with non serializable result
pickle status result
Connect to object store in coordinator
test_app.py tests ping api route note: fastapi TestClient(app) doesn't work due to fastapi mounting socketio you must cd to the src/services/api directory before running pytest (added this to readme) this is currently in a draft state and should not be merged
Alert users and purge requests for processors that fail to deploy (in…
Use Torch CPU in our docker builds (ndif-team#191)
add pandas to whitelisted modules
|
Thanks for your contributions! I'm going to review this in more detail later this week, but wanted to give a few initial comments:
|
add gitignore
README.md
Outdated
|
|
||
| For more comprehensive testing, install pytest | ||
| ```sh | ||
| conda activate ndif-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of assuming a package manager and instructing them how to install it, just directly link to pytest docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
| @@ -0,0 +1,28 @@ | |||
| import time | |||
| from functools import lru_cache | |||
| from src.queue.util import cache_maintainer | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helper function is getting removed in #210
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm it seems like there are a lot of changes happening to queue/util.py, maybe we should just delete test_queue_util.py for now?
src/services/api/README.md
Outdated
|
|
||
| ## Testing | ||
|
|
||
| install dependencies from requirements.in, ideally in a virtual environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also the dependencies in the pyproject.toml
| @@ -0,0 +1,10 @@ | |||
| from unittest.mock import MagicMock, patch | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo structure is a little confusing, but this technically corresponds to src/common, so this test isn't needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. I removed the file for now since there are no other functions to test in providers/util.py. Are there any api specific utils we should test or is this fine for now?
src/services/api/pyproject.toml
Outdated
| [project] | ||
| name = "api" | ||
| version = "0.1.0" | ||
| requires-python = ">=3.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically right now we only run NDIF with python 3.12
src/services/api/pyproject.toml
Outdated
| pythonpath = ["."] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "tests" would be a more appropriate dependency group name
| @@ -0,0 +1,13 @@ | |||
| import os | |||
| os.environ["DEV_MODE"] = "true" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You set this here, but also directly in some of the tests, was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the two tests were specifically testing the behavior in dev mode so I wanted it to be explicit. The top level DEV_MODE is just to avoid start the db connection in db.py. In e2e testing we might want to set this to be false with a separate conftest.py
MichaelRipa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress! I cloned and tested this out locally, and it seemed to work once I installed all the dependencies. I added some comments for review, once they are addressed, it'll be close to ready for merge 🙂
> > rename dev => test depedency group > requires-python = "3.12"
|
Looks good to me. Will just get a second pair of eyes from @JadenFiotto-Kaufman |
A start to integrating pytest
-add pytest and dependencies to requirements.in
-add instructions to readme
-add conftest.py
-add test_ping in test_app.py