-
Notifications
You must be signed in to change notification settings - Fork 138
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
[FEATURE]Improve test coverage for RemoteModel.java #3205
[FEATURE]Improve test coverage for RemoteModel.java #3205
Conversation
Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves opensearch-project#1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/remote/RemoteModelTest.java
Outdated
Show resolved
Hide resolved
Thanks for the contribution! Appreciate it. Can you share a coverage report similar to the one in issue to see if it actual covers those exceptions? |
Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves opensearch-project#1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
I was expecting that code coverage report generation is part of CI, similar to other projects, eg: OpenSearch core, Security, etc. I verified the coverage by putting explicit traces in each exception blocks. Can you please share, how can I run the coverage tool and share the report links here? |
It will be locally available for you, you can just verify if those lines are hit and maybe share a screenshot. Changes look good to me! Let me know if this helps! |
Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves opensearch-project#1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
Yes this helped. All exceptions were covered, but below line was not covered, so added one more test case to cover that: actionType = ((RemoteInferenceInputDataSet) mlInput.getInputDataset()).getActionType(); Now it is 100% branch and line, please see the screenshots. |
Looks good to me! Thank you! |
Thanks @akolarkunnu. can you run
|
Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves opensearch-project#1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
yes, I forgot to run it this time. Ran it and updated. |
Can any reviewers please review this? |
* [FEATURE]Improve test coverage for RemoteModel.java Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves #1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]> * [FEATURE]Improve test coverage for RemoteModel.java Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves #1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]> * [FEATURE]Improve test coverage for RemoteModel.java Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves #1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]> * [FEATURE]Improve test coverage for RemoteModel.java Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods. Resolves #1382 Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]> --------- Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]> (cherry picked from commit 45ff4f5)
Description
Added new tests for missing coverage. Mainly coverage was missing for catching exceptions in the methods initModel() and asyncPredict(). Also renamed some tests to match with testing methods.
Related Issues
Resolves #1382
Check List
New functionality has been documented.API changes companion pull request created.--signoff
.Public documentation issue/PR created.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.