-
Notifications
You must be signed in to change notification settings - Fork 183
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
Pylint integration updates #643
Conversation
Signed-off-by: Mark Cohen <[email protected]>
…l continue to work on this before committing setup.cfg Signed-off-by: Mark Cohen <[email protected]>
…'t fail while work on docstrings continues Signed-off-by: Mark Cohen <[email protected]>
Signed-off-by: Mark Cohen <[email protected]>
Signed-off-by: Mark Cohen <[email protected]>
Signed-off-by: Mark Cohen <[email protected]>
…ns; added a utility to automatically add these ignore instructions to most functions that should be self-describing; rolled back some automatically generated code mistakenly changed Signed-off-by: Mark Cohen <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #643 +/- ##
==========================================
- Coverage 72.10% 72.04% -0.07%
==========================================
Files 89 89
Lines 7949 7945 -4
==========================================
- Hits 5732 5724 -8
- Misses 2217 2221 +4 ☔ View full report in Codecov by Sentry. |
206dff7
to
1680f34
Compare
* fixed some lints; created a feature flag for newer dynamic pylint so now lints can be fixed first in legacy code and then enabled by multiple people * extracted a method for per-folder linting * updated noxfile.lint_per_folder with type hints * enabled unspecified-encoding in pylint * added disable missing-function-docstring pragma to test_clients.py in test_async and test_server * added more encodings to pass unspecified-encoding pylint tests * updated changelog Signed-off-by: Mark Cohen <[email protected]>
1680f34
to
d26eba5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I htink all or some of this PR should be merged, the thing I am strongly against is adding # pylint: disable=missing-function-docstring
in every test. That is a huge burden on test authors for no value at all, so how can this be avoided? More comments inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better.
I am still against adding # pylint: disable=missing-function-docstring
to all the test files. Can we undo that part and skip that linter for tests?
removed the feature flag for pylint lint_per_folder fixed failures from mypy and pylint removed pylint MESSAGE CONTROL config from setup.cfg after relocating to lint_per_folder method Signed-off-by: Mark Cohen <[email protected]>
066aa7b
to
2a03f3e
Compare
040b0d0
to
6be4396
Compare
Signed-off-by: Mark Cohen <[email protected]>
6be4396
to
fcc65a3
Compare
test_opensearchpy/test_async/test_server/test_helpers/test_faceted_search.py
Outdated
Show resolved
Hide resolved
yields the version of the OpenSearch cluster | ||
:param client: | ||
:return: | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing param description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also adding a pylint extension to add missing-param-doc (when a parameter is missing from the docstring) and differing-param-doc (when a parameter is different in the function definition and the docstring).
updated some docstrings to correct parameters removed pylint from setup.cfg Signed-off-by: Mark Cohen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saimedhi what remains to be done to get this merged? Let's get an iteration in?
Signed-off-by: Mark Cohen <[email protected]>
Thank you, @macohen , for your contribution! I'll thoroughly review the PR today and aim to merge it soon. I've observed a failing integration test, so I'm rerunning it to determine if it's a flaky test. |
Thanks @saimedhi. That's the test against main? FAILED test_opensearchpy/test_server/test_rest_api_spec.py::test_rest_api_spec[OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/stats/50_noop_update[0]] - opensearchpy.exceptions.ConnectionTimeout: ConnectionTimeout caused by - ReadTimeoutError(HTTPConnectionPool(host='localhost', port=9200): Read timed out. (read timeout=3)) I'm not sure I've ever seen that test succeed in this PR. |
Yes, it is test against main or unreleased OpenSearch. I will check, if the failing test is related to this PR or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's why the test fails.
:param client: | ||
:return: | ||
""" | ||
info = client.info() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing an await
, was edited out, so you get the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was also a dumb copy/paste error if you look at the wider scope. fixing. thanks, @dblock.
Signed-off-by: Mark Cohen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_opensearchpy/test_async/test_server/test_helpers/test_actions.py
Outdated
Show resolved
Hide resolved
test_opensearchpy/test_async/test_server/test_helpers/test_faceted_search.py
Outdated
Show resolved
Hide resolved
test_opensearchpy/test_async/test_server/test_helpers/test_faceted_search.py
Show resolved
Hide resolved
Hi @macohen, in your latest commit, could you please remove the changes causing test failures? If not, consider excluding that commit and let's proceed with merging this code. We can address the other changes in a follow-up PR. Apologies for the delay. |
030d5ae
to
d8247a0
Compare
Thanks. I was working on figuring out how to run the two tasks that are failing locally so I can reproduce the failures. I thought I needed to check out the appropriate branch of opensearch (2.0, main) and run the commands in the workflow, but I haven't been able to reproduce. If you have any guidance there, that would be helpful. Also, I will update this comment in about an hour with the command I'm running... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_opensearchpy/test_async/test_server/test_helpers/conftest.py
Outdated
Show resolved
Hide resolved
renamed test_opensearchpy.test_async.test_server.test_helpers.conftest.setup_ubq_tests to setup_update_by_query_tests added OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/stats/50_noop_update[0] to skip tests list run_tests.py catches a CalledProcessError when the git repo already exists and the command to add the origin fails in fetch_opensearch_repo() Signed-off-by: Mark Cohen <[email protected]>
d8247a0
to
107469c
Compare
Opened #653, pushed an update with the failing test skipped and all checks pass now! Thanks to @saimedhi and @dblock for all the help and patience. :) |
Description
Issues Resolved
Progress on #610
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.