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 MLEngine Class #3675

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akolarkunnu
Copy link
Contributor

@akolarkunnu akolarkunnu commented Mar 19, 2025

Description

Improved the test coverage by adding missed use cases.
There is no zero argument constructor, constructor with Input as parameter and constructor with MLAlgoParams.class as parameter in the class class org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation. So it is impossible to cover remaining potions, it always throws java.lang.NoSuchMethodException: org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation.().

Related Issues

Resolves #1376

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 missed use cases.
There is no zero argument constructor, constructor with Input as paremeter and constructor with MLAlgoParams.class as paremeter in the class class org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation. So it is impossible to cover remianing potions, it always throws java.lang.NoSuchMethodException: org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation.<init>().

Resolves opensearch-project#1376

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

Code Coverage report after fix:
CodeCoverage1
CodeCoverage2
CodeCoverage3

There is no zero argument constructor, constructor with Input as parameter and constructor with MLAlgoParams.class as parameter in the class class org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation. So it is impossible to cover remaining potions, it always throws java.lang.NoSuchMethodException: org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation.().

@dhrubo-os
Copy link
Collaborator

Thanks for looking into this. Can we increase the branch coverage for validateMLInput method?

@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 19, 2025 16:11 — with GitHub Actions Failure
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 19, 2025 16:11 — with GitHub Actions Failure
@akolarkunnu
Copy link
Contributor Author

Thanks for looking into this. Can we increase the branch coverage for validateMLInput method?

No, there mainly branch coverage is missing for 'dataFrame == null' check. dataFrame is tagged as @nonnull variable. So it is an unwanted check.

@akolarkunnu
Copy link
Contributor Author

Right now all checks failed with "Unable to download artifact(s): Artifact not found for name: coverage-report-ubuntu-latest-23".
Can any maintainers please trigger this again?

@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 02:29 — with GitHub Actions Failure
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval March 21, 2025 03:47 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 03:47 — with GitHub Actions Failure
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval March 21, 2025 03:47 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu temporarily deployed to ml-commons-cicd-env-require-approval March 21, 2025 03:47 — with GitHub Actions Inactive
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 05:08 — with GitHub Actions Failure
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 05:08 — with GitHub Actions Error
@akolarkunnu akolarkunnu had a problem deploying to ml-commons-cicd-env-require-approval March 21, 2025 16:21 — 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 MLEngine Class
2 participants