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

wip-NXPY-239: fix tests cases on python #271

Closed
wants to merge 6 commits into from

Conversation

gitofanindya
Copy link
Collaborator

wip-NXPY-239: fix tests cases on python

@CLAassistant
Copy link

CLAassistant commented Sep 15, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 15, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.03%.

Quality metrics Before After Change
Complexity 2.02 ⭐ 2.03 ⭐ 0.01 👎
Method Length 50.58 ⭐ 50.37 ⭐ -0.21 👍
Working memory 4.96 ⭐ 4.93 ⭐ -0.03 👍
Quality 77.86% 77.89% 0.03% 👍
Other metrics Before After Change
Lines 3618 3707 89
Changed files Quality Before Quality After Quality Change
nuxeo/client.py 64.45% 🙂 64.45% 🙂 0.00%
nuxeo/documents.py 82.69% ⭐ 82.51% ⭐ -0.18% 👎
nuxeo/exceptions.py 92.49% ⭐ 93.28% ⭐ 0.79% 👍
nuxeo/models.py 92.31% ⭐ 92.31% ⭐ 0.00%
nuxeo/utils.py 66.48% 🙂 66.49% 🙂 0.01% 👍
nuxeo/handlers/s3.py 71.91% 🙂 71.91% 🙂 0.00%
tests/conftest.py 85.39% ⭐ 85.37% ⭐ -0.02% 👎
tests/constants.py 96.67% ⭐ 96.17% ⭐ -0.50% 👎
tests/test_batchupload.py 66.76% 🙂 66.70% 🙂 -0.06% 👎
tests/test_log_response.py 93.67% ⭐ 93.50% ⭐ -0.17% 👎
tests/test_repository.py 83.76% ⭐ 83.56% ⭐ -0.20% 👎
tests/test_upload_s3.py 72.19% 🙂 72.02% 🙂 -0.17% 👎
tests/manual/many_small_files.py 82.28% ⭐ 82.28% ⭐ 0.00%
tests/manual/one_big_file.py 86.89% ⭐ 86.89% ⭐ 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
nuxeo/client.py NuxeoClient.request 14 🙂 312 ⛔ 16 ⛔ 30.61% 😞 Try splitting into smaller methods. Extract out complex expressions
nuxeo/utils.py version_compare 16 🙂 227 ⛔ 10 😞 41.69% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_batchupload.py test_upload_several_callbacks 5 ⭐ 314 ⛔ 47.12% 😞 Try splitting into smaller methods
tests/test_batchupload.py test_idempotent_requests 5 ⭐ 300 ⛔ 47.77% 😞 Try splitting into smaller methods
nuxeo/utils.py log_response 10 🙂 163 😞 12 😞 48.26% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Base: 96.58% // Head: 96.30% // Decreases project coverage by -0.28% ⚠️

Coverage data is based on head (1866b4d) compared to base (ac10600).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
- Coverage   96.58%   96.30%   -0.29%     
==========================================
  Files          29       26       -3     
  Lines        1787     1624     -163     
==========================================
- Hits         1726     1564     -162     
+ Misses         61       60       -1     
Flag Coverage Δ
unit 96.30% <100.00%> (-0.29%) ⬇️

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

Impacted Files Coverage Δ
nuxeo/client.py 99.43% <ø> (ø)
nuxeo/handlers/s3.py 92.68% <ø> (ø)
nuxeo/models.py 100.00% <ø> (ø)
nuxeo/documents.py 93.60% <100.00%> (+0.85%) ⬆️
nuxeo/exceptions.py 100.00% <100.00%> (ø)
nuxeo/utils.py
nuxeo/__init__.py
nuxeo/constants.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gitofanindya gitofanindya force-pushed the wip-NXPY-239-Fix-tests-cases-on-Python branch 25 times, most recently from d70d42c to 36dfa8a Compare September 19, 2022 06:52
@gitofanindya gitofanindya force-pushed the wip-NXPY-239-Fix-tests-cases-on-Python branch from 9a14d9e to e12d657 Compare September 21, 2022 08:32
@@ -23,18 +23,15 @@ jobs:
fail-fast: false
matrix:
nuxeo:
- "2021"
- "10.10"
Copy link
Collaborator

Choose a reason for hiding this comment

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

why 10.10?

credentials:
username: ${{ secrets.NUXEO_DOCKER_USER }}
password: ${{ secrets.NUXEO_DOCKER_PWD }}
image: nuxeo/nuxeo:${{ matrix.nuxeo }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This may not be required?

"""
if a is None:
if b is None:
if str(a) == "0":
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are we trying to compare?

@@ -2,3 +2,4 @@
WORKSPACE_ROOT = "/default-domain/workspaces"
WORKSPACE_NAME = "ws-python-tests"
WORKSPACE_TEST = WORKSPACE_ROOT + "/" + WORKSPACE_NAME
NUXEO_SERVER_URL = "http://localhost:8080/nuxeo/" # "http://localhost:8080/nuxeo/" / "https://localhost:8443/nuxeo/"
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove commented code

uploader._timeout = 0.00001
assert uploader.timeout(chunk_size) == 0.00001

uploader._timeout = 0.0000000000001
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it require?

@gitofanindya gitofanindya force-pushed the wip-NXPY-239-Fix-tests-cases-on-Python branch 8 times, most recently from 52af77b to 86958b2 Compare October 12, 2022 08:27
@gitofanindya gitofanindya force-pushed the wip-NXPY-239-Fix-tests-cases-on-Python branch from 86958b2 to 755d763 Compare October 12, 2022 08:41
@gitofanindya gitofanindya force-pushed the wip-NXPY-239-Fix-tests-cases-on-Python branch 10 times, most recently from 621fd2d to 8dd3fd2 Compare October 13, 2022 14:04
@gitofanindya gitofanindya force-pushed the wip-NXPY-239-Fix-tests-cases-on-Python branch from 8dd3fd2 to 1866b4d Compare October 13, 2022 14:14
@gitofanindya gitofanindya deleted the wip-NXPY-239-Fix-tests-cases-on-Python branch October 14, 2022 11:28
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.

None yet

3 participants