-
Notifications
You must be signed in to change notification settings - Fork 61
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
Search task added #177
Search task added #177
Changes from 2 commits
4c8fbf9
d995566
454499d
fa5ccbb
33be035
867e708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,6 +372,26 @@ def test_integration_model_train_register_full_cycle(): | |
print("Model Task Status:", ml_task_status) | ||
raised = True | ||
assert raised == False, "Raised Exception in pulling task info" | ||
|
||
try: | ||
search_task_obj = ml_client.search_task(json="{'_id':'{task_id}'}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw parameter name was: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, my bad sorry. I will change it. |
||
assert search_task_obj["hits"]["hits"][0]["_id"] == task_id | ||
except: # noqa: E722 | ||
raised = True | ||
assert raised == False, "Raised Exception in searching task" | ||
|
||
try: | ||
search_task_obj = ml_client.search_task(json={"_id": task_id}) | ||
except: # noqa: E722 | ||
raised = True | ||
assert raised == False, "Raised Exception in searching task" | ||
|
||
try: | ||
search_task_obj = ml_client.search_task(json=15) | ||
assert search_task_obj == "Invalid JSON object passed as argument." | ||
except: # noqa: E722 | ||
raised = True | ||
assert raised == False, "Raised Exception in searching task" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make a separate function for this to test? This chain of flow test was to test integration test. We don't need to include this test here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ok. |
||
# This is test is being flaky. Sometimes the test is passing and sometimes showing 500 error | ||
# due to memory circuit breaker. | ||
# Todo: We need to revisit this test. | ||
|
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.
Can we cover this line with testing? May be we can write separate test function just to cover this line.
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 mean "else" block? I covered both dict and string test.
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.
"return "Invalid JSON object passed as argument." this block
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 maybe you mean try catch block missed for dict case. I will add 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.
Ok