Skip to content

Commit

Permalink
Remove hfx_filename and perfmon from expected_to_fail
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardkaindl committed Jan 30, 2024
1 parent eda664d commit 3fb1ed0
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 6 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,65 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: error

# uses: tsuyoshicho/action-mypy@v3.13.0
- uses: bernhardkaindl/action-mypy@36cb3a857d01c1bdaa2811893106c71580132d71
env:
MYPYPATH: scripts/examples/python:scripts/examples:scripts/plugins:scripts:.
with:
filter_mode: nofilter
setup_method: install
setup_command: pip install mypy mock
mypy_flags: |
--scripts-are-modules
--check-untyped-defs
--allow-redefinition
--hide-error-context
--ignore-missing-imports
--no-pretty
--warn-unreachable
--disable-error-code attr-defined
--disable-error-code call-overload
--disable-error-code import-not-found
--disable-error-code import-untyped
--disable-error-code type-arg
--disable-error-code var-annotated
--exclude ocaml/events/event_listen.py
--exclude ocaml/idl
--exclude ocaml/message-switch
--exclude ocaml/tests/tests/looper.py
--exclude ocaml/xcp-rrdd/scripts/rrdd/rrdd.py
--exclude scripts/examples
--exclude scripts/examples/python/monitor-unwanted-domains.py
--exclude scripts/scalability-tests/ping-master.py
--exclude scripts/backup-sr-metadata.py
--exclude scripts/restore-sr-metadata.py
--exclude scripts/nbd_client_manager.py
target: |
scripts/perfmon
scripts/hfx_filename
scripts/mail-alarm
scripts/host-display
github_token: ${{ secrets.github_token }}
reporter: github-pr-review

- uses: dciborow/action-pylint@0.1.1
with:
filter_mode: nofilter
glob_pattern: "scripts/*"
pylint_args: |
--verbose
--disable bad-indentation
--disable consider-using-dict-comprehension
--disable consider-using-f-string
--disable consider-using-with
--disable import-error
--disable import-outside-toplevel
--disable invalid-name
--disable missing-final-newline
--disable missing-function-docstring
--disable multiple-imports
--disable redefined-outer-name
--disable trailing-whitespace
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
2 changes: 1 addition & 1 deletion ocaml/xenopsd/scripts/swtpm-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def check_state_needs_init(fname):
return False

# Check if block device has non-zero header
with open(fname, "r") as file:
with open(fname, "rb") as file:
hdr = file.read(8)
int_hdr = struct.unpack("<Q", hdr)[0]

Expand Down
19 changes: 14 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ ensure_newline_before_comments = false
[tool.mypy]
# Note mypy has no config setting for PYTHONPATH, so you need to call it with:
# PYTHONPATH="scripts/examples/python:.:scripts:scripts/plugins:scripts/examples"
exclude = [
"ocaml/xapi-storage/python/examples/volume/org.xen.xapi.storage.simple-file/plugin.py",
"scripts/examples",
"scripts/examples/python/monitor-unwanted-domains.py",
"scripts/scalability-tests/ping-master.py",
"scripts/backup-sr-metadata.py",
"scripts/restore-sr-metadata.py",
"scripts/nbd_client_manager.py",
]
files = [
"scripts/perfmon",
"scripts/hfx_filename",
"scripts/mail-alarm",
"scripts/host-display",
"scripts/usb_reset.py",
"scripts/unit_tests",
]
pretty = true
error_summary = true
Expand Down Expand Up @@ -70,8 +82,6 @@ discard_messages_matching = [
"No Node.TEXT_NODE in module xml.dom.minidom, referenced from 'xml.dom.expatbuilder'"
]
expected_to_fail = [
"scripts/hfx_filename",
"scripts/perfmon",
# Need 2to3 -w <file> and maybe a few other minor updates:
"scripts/hatests",
"scripts/backup-sr-metadata.py",
Expand Down Expand Up @@ -112,13 +122,12 @@ inputs = [
"scripts/xe-scsi-dev-map",
"scripts/examples/python",
"scripts/yum-plugins",
"scripts/*.py",

# To be added later,
# when converted to Python3-compatible syntax:
# "ocaml/message-switch/python",
# "ocaml/idl/ocaml_backend/python",
# "ocaml/xapi-storage/python",
"ocaml/xenopsd/python",
]
disable = [
"import-error", # xenfsimage, xcp.bootloader. xcp.cmd
Expand Down
1 change: 1 addition & 0 deletions scripts/hfx_filename
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def rpc(session_id, request):
s.close()

def parse_string(txt):
assert isinstance(txt, str)
prefix = "<value><array><data><value>success</value><value>"
if not txt.startswith(prefix):
raise Exception("Unable to parse string response")
Expand Down

0 comments on commit 3fb1ed0

Please sign in to comment.