-
Notifications
You must be signed in to change notification settings - Fork 87
Treat all warnings in tests as errors, reduce verbosity #312
Treat all warnings in tests as errors, reduce verbosity #312
Conversation
🤖 zincr found 0 problems , 1 warning
Details on how to resolve are provided below Large CommitsChecks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of
|
🤖 zincr found 1 problem , 1 warning
Details on how to resolve are provided below ApprovalsAll proposed changes must be reviewed by project maintainers before they can be merged Not enough people have approved this pull request - please ensure that 1 additional user, who have not contributed to this pull request approve the changes.
Large CommitsChecks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of
|
It was not actually a problem per se, but some code checkers complained on a possible resource leakage. So, why not fix it?
The examples are used as the e2e test. With the warnings converted to errors, they fails quite often (randomly) due to SSL sockets not closed properly (ResourceWarnings), noticed within the executor's threads (which are used only for the sync-handlers). Switching to `pykube-ng` and closing the request's session explicitly (instead of on garbage collection) seems to fix it. So as not having the session0owning object module-scoped.
941fa3d
to
379dbb9
Compare
What do these changes do?
Reduce verbosity of the CI/CD builds. Specifically, suppress all expected deprecation warnings, fix all unexpected resource-leaking warnings, and hide operator-under-test logging during tests.
Description
In Travis, the output of tests is now polluted with accidental logs, kubectl outputs, and a lot of warnings, especially the deprecation warnings. This makes it difficult to understand what is happening in the tests, and how reliable the code is.
With this PR, all warnings in tests are now considered as errors — more stricter requirements.
Due to this, numerous actual errors were detected with resource leakage (mostly unclosed event-loops and transports). They all are now fixed.
The expected deprecation warnings are now wrapped into context managers with specific phrase expectations (to exclude other unexpected warnings from being caught and suppressed). All unexpected deprecation warnings should be fixed on the code level (do not use the deprecated methods at least internally).
Beside that:
kubectl
output is hidden in e2e tests.As an example (for a green build, to make comparison simpler):
Was: https://travis-ci.org/nolar/kopf/jobs/647314734
Now: https://travis-ci.org/nolar/kopf/jobs/649395691
The end-users are not affected. This PR is for the internal codebase stability only.
As usually, see individual commit titles for a list of specific changes.
Issues/PRs
Type of changes
Checklist
CONTRIBUTORS.txt