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

[FEATURE] Improve test coverage for MLEngineClassLoader class #3679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akolarkunnu
Copy link
Contributor

@akolarkunnu akolarkunnu commented Mar 21, 2025

Description

Improved the test coverage by adding the edge case of initInstance() method returns null.
Some of the branch coverages which are missing are unreachable code. The Function, ConnectorExecutor and Ingester values are non null.

Related Issues

Resolves #1377

Check List

  • New functionality includes testing.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.

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.

Improved the test coverage by adding the edge case.
Some of the branch coverages which are mssing are unreachable code. The Function, ConnectorExecutor and Ingester values are non null.

Resolves opensearch-project#1377

Signed-off-by: Abdul Muneer Kolarkunnu <[email protected]>
@akolarkunnu akolarkunnu deployed to ml-commons-cicd-env-require-approval March 21, 2025 05:38 — with GitHub Actions Active
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval March 21, 2025 05:38 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval March 21, 2025 05:38 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval March 21, 2025 05:38 — with GitHub Actions Inactive
@akolarkunnu
Copy link
Contributor Author

Code Coverage report after fix:
CodeCoverage11
CodeCoverage22

Missing branch coverages are unreachable code.
The variables functionName, connectorName and ingesterSource won't become null, because Function, ConnectorExecutor and Ingester values are non null.
Also the statement "throw (MLException) cause" won't reach with existing Function implementations, none of those throws MLException from their constructors.

With this fix, a little improvement is the in coverage.

@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 17:24 — with GitHub Actions Failure
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 17:24 — with GitHub Actions Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Improve test coverage for MLEngineClassLoader class
2 participants