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

Fixup perfmon #10

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

Fixup perfmon #10

wants to merge 2 commits into from

Conversation

bernhardkaindl
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2024

Codecov Report

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

Comparison is base (ee472c7) 45.38% compared to head (3fb1ed0) 46.71%.

Files Patch % Lines
scripts/perfmon 0.00% 4 Missing ⚠️
scripts/hfx_filename 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #10      +/-   ##
==========================================
+ Coverage   45.38%   46.71%   +1.33%     
==========================================
  Files          18       21       +3     
  Lines        2937     3033      +96     
==========================================
+ Hits         1333     1417      +84     
- Misses       1604     1616      +12     
Flag Coverage Δ
python2.7 51.40% <34.56%> (-0.70%) ⬇️
python3.11 51.49% <92.30%> (+1.34%) ⬆️

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

pylint

scripts/test_hfx_filename.py|45 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|71 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|84 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|99| C0115: Missing class docstring (missing-class-docstring)
scripts/test_hfx_filename.py|101 col 4| C0116: Missing function or method docstring (missing-function-docstring)
scripts/test_hfx_filename.py|8| C0411: standard import "import sys" should be placed before "from mock import MagicMock, patch, call" (wrong-import-order)


def get_module(module_name, file_path):
testdir = os.path.dirname(__file__)
return import_from_file(module_name, testdir + file_path)

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0304: Final newline missing (missing-final-newline)

@@ -0,0 +1,24 @@
# Used for importing a non-".py" file as a module

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)

# Only for python3, but CI has python2 pytest check, so add this line
if sys.version_info.major == 2:
return None
from importlib import machinery, util

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0415: Import outside toplevel (importlib.machinery, importlib.util) (import-outside-toplevel)

spec.loader.exec_module(module)
return module

def get_module(module_name, file_path):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

@unittest.skipIf(sys.version_info < (3, 0), reason="requires python3")
@patch("socket.socket")
class TestRpc(unittest.TestCase):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

class TestParse(unittest.TestCase):

def test_parse_string(self):
txt = "<value><array><data><value>success</value><value>abcde</value></data></array></value>"

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0301: Line too long (101/100) (line-too-long)

expected_txt = "abcde"
return_txt = hfx_filename.parse_string(txt)
self.assertEqual(expected_txt, return_txt)

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0303: Trailing whitespace (trailing-whitespace)

@@ -0,0 +1,107 @@
#!/usr/bin/env python3

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)


@unittest.skipIf(sys.version_info < (3, 0), reason="requires python3")
@patch("socket.socket")
class TestRpc(unittest.TestCase):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)

@patch("socket.socket")
class TestRpc(unittest.TestCase):

def test_rpc(self, mock_socket):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

@@ -55,13 +51,14 @@ def rpc(session_id, request):
s.close()

def parse_string(txt):
assert isinstance(txt, str):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
E0001: Parsing failed: 'invalid syntax (, line 54)' (syntax-error)

@@ -380,7 +380,7 @@ def get_percent_mem_usage(ignored):
memlist = memfd.readlines()
memfd.close()
memdict = [ m.split(':', 1) for m in memlist ]
memdict = dict([(k.strip(), float(re.search('\d+', v.strip()).group(0))) for (k,v) in memdict])
memdict = dict([(k.strip(), float(re.search(r'\d+', v.strip()).group(0))) for (k,v) in memdict])

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0301: Line too long (104/100) (line-too-long)



@unittest.skipIf(sys.version_info < (3, 0), reason="requires python3")
class TestParse(unittest.TestCase):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)


import unittest
from mock import MagicMock, patch, call
import sys

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0411: standard import "import sys" should be placed before "from mock import MagicMock, patch, call" (wrong-import-order)

return import_from_file("perfmon", testdir + "/perfmon")

perfmon = get_module()
perfmon = get_module("perfmon", "/perfmon")
@unittest.skipIf(sys.version_info < (3, 0), reason="requires python3")
@patch("subprocess.getoutput")
class TestGetPercentage(unittest.TestCase):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)

@@ -5,35 +5,13 @@
import unittest
from mock import MagicMock, patch
import sys

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0411: standard import "import sys" should be placed before "from mock import MagicMock, patch" (wrong-import-order)

@@ -5,35 +5,13 @@
import unittest
from mock import MagicMock, patch
import sys
import os
import subprocess
import math

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0411: standard import "import math" should be placed before "from mock import MagicMock, patch" (wrong-import-order)

return import_from_file("static_vdis", testdir + "/static-vdis")

static_vdis = get_module()
static_vdis = get_module("static_vdis", "/static-vdis")

@unittest.skipIf(sys.version_info < (3, 0), reason="requires python3")
class TestReadWriteFile(unittest.TestCase):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)

@@ -5,36 +5,14 @@
import unittest
from mock import MagicMock
import sys

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0411: standard import "import sys" should be placed before "from mock import MagicMock" (wrong-import-order)

@@ -5,36 +5,14 @@
import unittest
from mock import MagicMock
import sys
import os
import subprocess
import tempfile

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0411: standard import "import tempfile" should be placed before "from mock import MagicMock" (wrong-import-order)

prefix = "<value><array><data><value>success</value><value>"
if not txt.startswith(prefix):
raise "Unable to parse string response"
raise Exception("Unable to parse string response")

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0719: Raising too general exception: Exception (broad-exception-raised)

txt = txt[len(prefix):]
suffix = "</value></data></array></value>"
if not txt.endswith(suffix):
raise "Unable to parse string response"
raise Exception("Unable to parse string response")

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0719: Raising too general exception: Exception (broad-exception-raised)

expected_return = "HelloWorld"
self.assertEqual(expected_return, body)

def test_rpc_international_character(self, mock_socket):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

expected_return = "HelloWorld"
self.assertEqual(expected_return, body)

def test_db_get_uuid(self, mock_socket):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

response = hfx_filename.db_get_by_uuid(0, "pool_patch", "22345")
self.assertEqual(expected_response, response)

def test_read_field(self, mock_socket):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

@unittest.skipIf(sys.version_info < (3, 0), reason="requires python3")
class TestParse(unittest.TestCase):

def test_parse_string(self):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
C0116: Missing function or method docstring (missing-function-docstring)

@bernhardkaindl bernhardkaindl force-pushed the fixup-perfmon branch 2 times, most recently from a66e9e3 to 9216ab6 Compare January 30, 2024 23:51
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.

3 participants