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

adding tests for all the agent runners #1783

Merged
merged 9 commits into from
Dec 20, 2023

Conversation

dhrubo-os
Copy link
Collaborator

@dhrubo-os dhrubo-os commented Dec 18, 2023

Description

[adding tests for all the agent runners + refactoring the necessary code for the agent runners]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 89 lines in your changes are missing coverage. Please review.

Comparison is base (94c5d21) 82.69% compared to head (c1d0c6b) 82.91%.
Report is 2 commits behind head on main.

Files Patch % Lines
.../ml/engine/algorithms/agent/MLChatAgentRunner.java 90.25% 17 Missing and 18 partials ⚠️
.../ml/engine/algorithms/agent/MLFlowAgentRunner.java 86.40% 9 Missing and 8 partials ⚠️
...ch/ml/engine/algorithms/agent/MLAgentExecutor.java 90.26% 3 Missing and 8 partials ⚠️
...org/opensearch/ml/common/MLCommonsClassLoader.java 18.18% 8 Missing and 1 partial ⚠️
...nsearch/ml/engine/algorithms/agent/AgentUtils.java 92.13% 4 Missing and 3 partials ⚠️
...va/org/opensearch/ml/common/utils/StringUtils.java 0.00% 6 Missing ⚠️
...rithms/metrics_correlation/MetricsCorrelation.java 33.33% 2 Missing ⚠️
...c/main/java/org/opensearch/ml/engine/MLEngine.java 50.00% 1 Missing ⚠️
...rch/ml/engine/algorithms/agent/PromptTemplate.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1783      +/-   ##
============================================
+ Coverage     82.69%   82.91%   +0.22%     
- Complexity     4744     4869     +125     
============================================
  Files           462      467       +5     
  Lines         18940    19674     +734     
  Branches       1976     2060      +84     
============================================
+ Hits          15662    16313     +651     
- Misses         2451     2500      +49     
- Partials        827      861      +34     
Flag Coverage Δ
ml-commons 82.91% <88.22%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Dhrubo Saha <[email protected]>
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env December 20, 2023 05:47 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env December 20, 2023 05:49 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env December 20, 2023 05:51 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env December 20, 2023 05:51 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os merged commit 2d5b1bb into opensearch-project:main Dec 20, 2023
8 of 12 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 20, 2023
* adding tests for all the agent runners

Signed-off-by: Dhrubo Saha <[email protected]>

* added more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* add tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* added more files and tests

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* merging PR 1785

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit 2d5b1bb)
dhrubo-os added a commit that referenced this pull request Dec 20, 2023
* adding tests for all the agent runners

Signed-off-by: Dhrubo Saha <[email protected]>

* added more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* add tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* added more files and tests

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* merging PR 1785

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit 2d5b1bb)

Co-authored-by: Dhrubo Saha <[email protected]>
jackiehanyang pushed a commit to jackiehanyang/ml-commons that referenced this pull request Dec 28, 2023
* adding tests for all the agent runners

Signed-off-by: Dhrubo Saha <[email protected]>

* added more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* add tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* added more files and tests

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* merging PR 1785

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
List<ModelTensor> modelTensors = new ArrayList<>();
outputs.add(ModelTensors.builder().mlModelTensors(modelTensors).build());

if (clusterService.state().metadata().hasIndex(ML_AGENT_INDEX)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be something like

        if (!clusterService.state().metadata().hasIndex(ML_AGENT_INDEX)) {
            listener.onFailure(new ResourceNotFoundException("Agent index not found"));
        }

it's not returning a response when index is not found

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Joshua. @jngz-es help fix this part?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will fix it in my pr.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #1866

austintlee pushed a commit to austintlee/ml-commons that referenced this pull request Mar 19, 2024
* adding tests for all the agent runners

Signed-off-by: Dhrubo Saha <[email protected]>

* added more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* add tests

Signed-off-by: Dhrubo Saha <[email protected]>

* adding more tests

Signed-off-by: Dhrubo Saha <[email protected]>

* added more files and tests

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* addressing comments

Signed-off-by: Dhrubo Saha <[email protected]>

* merging PR 1785

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants