-
Notifications
You must be signed in to change notification settings - Fork 241
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
[API] Fix artifact storing without project in body #1608
[API] Fix artifact storing without project in body #1608
Conversation
@@ -55,3 +55,37 @@ def test_list_artifacts_filter_by_kind(self): | |||
project=prj, category=mlrun.api.schemas.ArtifactCategories.dataset | |||
) | |||
assert len(artifacts) == 1, "bad number of dataset artifacts" | |||
|
|||
def test_store_artifact_with_empty_dict(self): |
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.
We should always strive for having a functionality being tested by the fastest possible test:
- System tests are the slowest one - in order to run a test correctly you need to build a whole version out of the code, transplant it in the system etc..
- Integration tests are faster - in order to run a test you (done automatically when you run it) build a docker image of the API, run it, and do actions in the client
- Unit tests are the fastest - all you need to run them is to install all requirements
Your change here is in the API code, client is irrelevant, therefore the correct place IMO to test it is the API tests, which are unit tests that bring up a mock API inside the test process
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.
So you suggesting removing those tests?
if not data.setdefault("project", project): | ||
data["project"] = project |
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.
If you handled the case of an empty string, I suggest that you'll cover it in the tests (maybe I missed it ?)
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.
added unittests
I meant that you'll remove the integration tests, other than that LGTM |
https://jira.iguazeng.com/browse/ML-1322