fix(general): CRASH add exception handling for logging configuration#7460
Open
scottschreckengaust wants to merge 3 commits intobridgecrewio:mainfrom
Open
fix(general): CRASH add exception handling for logging configuration#7460scottschreckengaust wants to merge 3 commits intobridgecrewio:mainfrom
scottschreckengaust wants to merge 3 commits intobridgecrewio:mainfrom
Conversation
Handle exceptions for invalid log levels defaulting to `WARNING`.
Signed-off-by: Scott Schreckengaust <345885+scottschreckengaust@users.noreply.github.com>
Signed-off-by: Scott Schreckengaust <345885+scottschreckengaust@users.noreply.github.com>
Author
% pytest tests/logger_streams/test_logging_init.py
/home/scoschre/github.com/scottschreckengaust/checkov/.venv/lib/python3.10/site-packages/pytest_benchmark/logger.py:39: PytestBenchmarkWarning: Benchmarks are automatically disabled because xdist plugin is active.Benchmarks cannot be performed reliably in a parallelized environment.
warner(PytestBenchmarkWarning(text))
=================================================== test session starts ====================================================
platform linux -- Python 3.10.17, pytest-7.4.4, pluggy-1.6.0
benchmark: 5.0.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/scoschre/github.com/scottschreckengaust/checkov
configfile: pyproject.toml
plugins: mock-3.15.1, asyncio-0.23.8, time-machine-2.19.0, cov-6.3.0, benchmark-5.0.1, xdist-3.8.0
asyncio: mode=strict
2 workers [10 items]
.......... [100%]
==================================================== 10 passed in 3.70s ====================================================% pre-commit run -a
debug statements (python)................................................Passed
flake8...................................................................Passed
teyit....................................................................Passed
Lint GitHub Actions workflow files.......................................Passed
pipenv-setup.............................................................Passed
import-linter............................................................Passed |
Contributor
|
Hi! Can you check the failing jobs? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Handle exceptions for invalid log levels defaulting to
WARNING.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
If the environmental variable
LOG_LEVELwas not a valid Python value, checkov would crash with:Fixes #7459
Checklist: