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

Hid HTTP request logs in tests; fixed a deprecation warning #147

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

tmikuska
Copy link
Contributor

@tmikuska tmikuska commented Feb 9, 2024

No description provided.

Fixed a deprecation warning

Removed an unused test dependency enum34
@coveralls
Copy link

coveralls commented Feb 9, 2024

Pull Request Test Coverage Report for Build 8031503346

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.942%

Totals Coverage Status
Change from base Build 6753999529: 0.0%
Covered Lines: 1694
Relevant Lines: 2291

💛 - Coveralls

@@ -12,6 +13,11 @@
from virl2_client import ClientLibrary


# set to warning to hide unwanted HTTP requests
logger = logging.getLogger("httpx")
logger.setLevel(logging.WARNING)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

httpx logs unnecessary HTTP requests while testing (imo not needed)

HTTP Request: GET https://localhost/api/v0/system_information "HTTP/1.1 200 OK"
HTTP Request: POST https://localhost/api/v0/authenticate "HTTP/1.1 200 OK"
HTTP Request: GET https://localhost/api/v0/authok "HTTP/1.1 200 OK"
HTTP Request: GET https://localhost/api/v0/populate_lab_tiles "HTTP/1.1 200 OK"
HTTP Request: GET https://localhost/api/v0/labs/5f0d96/topology "HTTP/1.1 200 OK"

@@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description_file = README.md
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixes the following deprecation warning

/root/dev/repos/simple/.venv/lib/python3.8/site-packages/setuptools/dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

        ********************************************************************************
        Usage of dash-separated 'description-file' will not be supported in future
        versions. Please use the underscore name 'description_file' instead.

        By 2024-Sep-26, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
        ********************************************************************************

!!
  opt = self.warn_dash_deprecation(opt, section)

@@ -10,7 +10,6 @@ click
coverage
coveralls
docopt
enum34
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes a deprecation warning:

/root/dev/repos/simple/.venv/lib/python3.8/site-packages/setuptools/installer.py:44: UserWarning: Module enum was already imported from /usr/lib/python3.8/enum.py, but /root/dev/repos/virlutils/.eggs/enum34-1.1.10-py3.8.egg is being added to sys.path
  pkg_resources.working_set.add(dist, replace=True)

@tmikuska
Copy link
Contributor Author

tmikuska commented Feb 9, 2024

There are still some deprecation warnings left but I don't have time to solve them now.

WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
/root/dev/repos/simple/.venv/lib/python3.8/site-packages/setuptools/command/test.py:193: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!

        ********************************************************************************
        Requirements should be satisfied by a PEP 517 installer.
        If you are using pip, you can try `pip install --use-pep517`.
        ********************************************************************************

!!
  ir_d = dist.fetch_build_eggs(dist.install_requires)

@@ -5,3 +5,4 @@ omit =
*/templates/*
*/static/*
*/examples/*
tests/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see a point in covering test files, but I put it into a separate commit in case it needs to be reverted.

@xorrkaz xorrkaz changed the base branch from master to joe-dev February 24, 2024 15:19
@xorrkaz xorrkaz merged commit 59905ac into CiscoDevNet:joe-dev Feb 24, 2024
6 checks passed
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