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 HttpJsonConnectorExecutor.java #1565

Closed
wants to merge 4 commits into from

Conversation

TrungBui59
Copy link
Contributor

Description

[Describe what this change achieves]

Issues Resolved

#1381

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.

@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 13:47 — with GitHub Actions Inactive
@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 13:47 — with GitHub Actions Inactive
@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 13:47 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.74%. Comparing base (5759bf2) to head (88bd5b4).
Report is 431 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1565      +/-   ##
============================================
+ Coverage     79.67%   80.74%   +1.06%     
- Complexity     4020     4182     +162     
============================================
  Files           394      399       +5     
  Lines         16385    16881     +496     
  Branches       1754     1817      +63     
============================================
+ Hits          13055    13630     +575     
+ Misses         2654     2537     -117     
- Partials        676      714      +38     
Flag Coverage Δ
ml-commons 80.74% <0.00%> (+1.06%) ⬆️

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.

@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 16:13 — with GitHub Actions Inactive
@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 16:13 — with GitHub Actions Inactive
@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 16:13 — with GitHub Actions Inactive
@TrungBui59 TrungBui59 temporarily deployed to ml-commons-cicd-env October 30, 2023 16:13 — with GitHub Actions Inactive
@dhrubo-os
Copy link
Collaborator

dhrubo-os commented Oct 30, 2023

Thanks for raising the PR. DCO is missing (signoff). You can just do : git commit -m "commit message" -s

@dhrubo-os
Copy link
Collaborator

Can we try to cover this code section too:

            boolean hasContentTypeHeader = false;
            if (headers != null) {
                for (String key : headers.keySet()) {
                    request.addHeader(key, (String)headers.get(key));
                    if (key.toLowerCase().equals("Content-Type")) {
                        hasContentTypeHeader = true;
                    }
                }
            }

try {
ConnectorAction predictAction = ConnectorAction.builder()
.actionType(ConnectorAction.ActionType.PREDICT)
.method("get")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like difference between invokeRemoteModel_GetMethodSuccessPath & invokeRemoteModel_POSTMethodSuccessPath is only here. May be we can use a function which could be reused to save lines?

@TrungBui59
Copy link
Contributor Author

@dhrubo-os I just reopen the PR

@mingshl
Copy link
Collaborator

mingshl commented Jan 10, 2025

@TrungBui59 no file is changed in this PR. Please reopen if needed.

@mingshl mingshl closed this Jan 10, 2025
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.

4 participants