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

Update filterwarnings so test warnings are treated as errors (Fixes ENG-73) #288

Merged
merged 11 commits into from
Jul 12, 2021

Conversation

linkous8
Copy link
Contributor

@linkous8 linkous8 commented Jul 9, 2021

No description provided.

@linear
Copy link

linear bot commented Jul 9, 2021

ENG-73 Warnings fired by tests should cause test failures

Per @blake's request, I've worked on getting test warnings to raise errors instead as time permits since this is fairly low priority/nice to have. The change consists of updating pytest's filterwarnings config to cause all warnings to error then ignore warnings we don't care about:

[tool:pytest]
testpaths = tests
addopts = --kube-config=tests/kubeconfig --kube-context=kubetest
filterwarnings =
    error
    ignore: .*the imp module is deprecated.*:DeprecationWarning
    ignore: .*Using or importing the ABCs from 'collections':DeprecationWarning
    ignore: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead:DeprecationWarning
    ignore: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10:DeprecationWarning
    ignore: Exception ignored in. <_io.FileIO \[closed\]>:pytest.PytestUnraisableExceptionWarning
    ignore: Exception ignored in. <ssl.SSLSocket fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>:pytest.PytestUnraisableExceptionWarning
    ignore: unclosed <ssl.SSLSocket .*:ResourceWarning

Currently the above causes the integration test suite to run indefinitely and requires further debug before it can be merged (see branch https://github.com/opsani/servox/tree/bugfix/add-filterwarnings-error)

@linkous8 linkous8 requested a review from blakewatters July 9, 2021 15:41
Copy link
Contributor

@rstarmer rstarmer left a comment

Choose a reason for hiding this comment

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

Looks good to me. Additional exceptions can always be added if they are found to be needed.

@linkous8 linkous8 merged commit bc974b3 into main Jul 12, 2021
@linkous8 linkous8 deleted the bugfix/add-filterwarnings-error branch July 12, 2021 18:40
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.

2 participants