-
Couldn't load subscription status.
- Fork 293
CI/Python: Add reporting of code coverage from PyTest #5384
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
Merged
bernhardkaindl
merged 1 commit into
master
from
private/bernhardk/python-add-code-coverage-reporting
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "problemMatcher": [ | ||
| { | ||
| "owner": "python-warnings", | ||
| "severity": "warning", | ||
| "pattern": [ | ||
| { | ||
| "regexp": "^.*/xen-api/(.+):([0-9]*):(.*):(.*)$", | ||
| "file": 1, | ||
| "line": 2, | ||
| "code": 3, | ||
| "message": 4 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # | ||
| # Configuration of pre-commit, a Python framework for git hooks. | ||
| # pre-commit is run for each git push by GitHub CI. It can run | ||
| # locally as well for early feedback and automatic formatting | ||
| # like trailing whitespace removal (to be configured later): | ||
| # | ||
| ## For only installing the package itself, run: | ||
| # pip3 install pre-commit | ||
| # | ||
| ## For activating it as a pre-commit and pre-push hook (recommended): | ||
| # pre-commit install --hook-type pre-push --hook-type pre-commit | ||
| # | ||
| ## For manually executing the pre-push hook: | ||
| # pre-commit run -av --hook-stage pre-push | ||
| # | ||
| default_stages: [commit, push] | ||
| repos: | ||
| # Recommendation for a minimal git pre-commit hook: | ||
| # https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.5.0 | ||
| hooks: | ||
| - id: no-commit-to-branch | ||
| name: "The master branch should be pulled only, don't commit to it" | ||
| args: [--branch, master] | ||
| always_run: true | ||
| - id: check-merge-conflict | ||
| - id: check-yaml | ||
| - id: check-executables-have-shebangs | ||
| exclude: ocaml | ||
|
|
||
| # Recommendation for a minimal git pre-push hook: | ||
| # While using pre-commit yields great results, it | ||
| # is "not fast". Therefore only run it pre-push, | ||
| # (but always in GitHub CI of course): | ||
| # | ||
| # Calls ./pytype_reporter.py in a dedicated venv: | ||
| # pre-commit run -av --hook-stage push | ||
| - repo: local | ||
| hooks: | ||
| - id: pytype | ||
| name: pytype | ||
| entry: python3 pytype_reporter.py | ||
| types: [python] | ||
| stages: [push] | ||
| verbose: true | ||
| # This hook runs locally only when Python files change: | ||
| language: python | ||
| # Pytype supports running on Python 3.8 to Python3.11 currently: | ||
| # https://google.github.io/pytype/support.html | ||
| # If a dev's default python3 interpreter is outside that range, but | ||
| # developers have such version installed, it can be configured here: | ||
| # language_version: python3.11 | ||
| require_serial: true | ||
| additional_dependencies: [pandas, pytype] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # https://packaging.python.org/en/latest/specifications/pyproject-toml/ | ||
| [project] | ||
| name = "xen-api" | ||
| requires-python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" | ||
| license = {file = "LICENSE"} | ||
| keywords = ["xen-project", "Xen", "hypervisor", "libraries"] | ||
| maintainers = [ | ||
| {name = "Christian Lindig"}, | ||
| {name = "Edwin Török"}, | ||
| {name = "Rob Hoes"}, | ||
| {name = "Pau Ruiz Safont"}, | ||
| ] | ||
| readme = "README.markdown" | ||
| # https://pypi.org/classifiers/ | ||
| classifiers = [ | ||
| "Development Status :: 5 - Production/Stable", | ||
| "Operating System :: POSIX :: Linux :: XenServer Dom0", | ||
| "Operating System :: POSIX :: Linux :: XCP-ng Dom0", | ||
| "Programming Language :: ML", | ||
| "Programming Language :: Python :: Implementation :: CPython", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| homepage = "https://github.com/xapi-project/xen-api" | ||
| repository = "https://github.com/xapi-project/xen-api" | ||
|
|
||
| [tool.black] | ||
| line-length = 88 | ||
|
|
||
| [tool.isort] | ||
| line_length = 88 | ||
| py_version = 27 | ||
| profile = "black" | ||
| combine_as_imports = true | ||
| 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" | ||
| files = [ | ||
| "scripts/usb_reset.py", | ||
| "scripts/unit_tests", | ||
| ] | ||
| pretty = true | ||
| error_summary = true | ||
| strict_equality = true | ||
| show_error_codes = true | ||
| show_error_context = true | ||
| # Check the contents of untyped functions in all modules by default: | ||
| check_untyped_defs = true | ||
| scripts_are_modules = true | ||
| python_version = "3.11" | ||
| warn_return_any = true | ||
| warn_unreachable = true | ||
| warn_unused_configs = true | ||
| warn_redundant_casts = true | ||
| disallow_any_explicit = false | ||
| disallow_any_generics = true | ||
| disallow_any_unimported = true | ||
| disallow_subclassing_any = true | ||
|
|
||
|
|
||
| [tool.pytype_reporter] | ||
| default_branch = "master" | ||
| discard_messages_matching = [ | ||
| "Couldn't import pyi for 'xml.dom.minidom'", | ||
| "No attribute '.*' on RRDContentHandler", | ||
| "No attribute 'group' on None", | ||
| "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", | ||
| "scripts/restore-sr-metadata.py", | ||
| "scripts/nbd_client_manager.py", | ||
| # No attribute 'popen2' on module 'os' [module-attr] and a couple more: | ||
| "scripts/mail-alarm", | ||
| # SSLSocket.send() only accepts bytes, not unicode string as argument: | ||
| "scripts/examples/python/exportimport.py", | ||
| # Other fixes needed: | ||
| "scripts/examples/python/mini-xenrt.py", | ||
| "scripts/examples/python/XenAPI/XenAPI.py", | ||
| "scripts/examples/python/monitor-unwanted-domains.py", | ||
| "scripts/examples/python/shell.py", | ||
| "scripts/examples/smapiv2.py", | ||
| "scripts/static-vdis", | ||
| # add_interface: unsupported operand type(s) for +: str and UsbInterface | ||
| "scripts/usb_scan.py", | ||
| # TestUsbScan.assertIn() is called with wrong arguments(code not iterable) | ||
| "scripts/test_usb_scan.py", | ||
| "scripts/plugins/extauth-hook-AD.py", | ||
| ] | ||
|
|
||
|
|
||
| [tool.pytype] | ||
| inputs = [ | ||
| "scripts/hfx_filename", | ||
| "scripts/perfmon", | ||
| "scripts/static-vdis", | ||
| "scripts/Makefile", | ||
| "scripts/generate-iscsi-iqn", | ||
| "scripts/hatests", | ||
| "scripts/host-display", | ||
| "scripts/mail-alarm", | ||
| "scripts/print-custom-templates", | ||
| "scripts/probe-device-for-file", | ||
| "scripts/xe-reset-networking", | ||
| "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", | ||
| ] | ||
| disable = [ | ||
| "import-error", # xenfsimage, xcp.bootloader. xcp.cmd | ||
| "ignored-abstractmethod", | ||
| "ignored-metaclass", | ||
| ] | ||
| platform = "linux" | ||
| pythonpath = "scripts/examples/python:.:scripts:scripts/plugins:scripts/examples" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.