Skip to content

Commit

Permalink
chore(logs): change level of unactioned message (#455)
Browse files Browse the repository at this point in the history
* chore(logs): change level of unactioned message

* chore(test): set level to debug
  • Loading branch information
drazisil-codecov authored Dec 13, 2024
1 parent 0363e7f commit e41a4a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion shared/validation/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def validate_install_configuration(inputted_dict):
validator = CodecovYamlValidator(show_secret=True)
is_valid = validator.validate(inputted_dict, config_schema)
if not is_valid:
log.warning(
log.debug(
"Configuration considered invalid, using dict as it is",
extra=dict(errors=validator.errors),
)
Expand Down
10 changes: 6 additions & 4 deletions tests/unit/validation/test_install_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ def test_validate_install_configuration_simple(mocker):


def test_validate_install_configuration_invalid(mocker):
mock_warning = mocker.patch.object(install_log, "warning")
install_log.setLevel("DEBUG")
mock_debug = mocker.patch.object(install_log, "debug")
assert validate_install_configuration(
{"setup": {"codecov_url": "http://codecov.company.com"}, "gitlab": 1}
) == {"setup": {"codecov_url": "http://codecov.company.com"}, "gitlab": 1}
assert mock_warning.call_count == 1
assert mock_debug.call_count == 1


def test_validate_install_configuration_with_user_yaml(mocker):
Expand Down Expand Up @@ -448,7 +449,8 @@ def test_admins(mocker):


def test_validate_install_configuration_raise_warning(mocker):
mock_warning = mocker.patch.object(install_log, "warning")
install_log.setLevel("DEBUG")
mock_debug = mocker.patch.object(install_log, "debug")
input = {
"setup": {
"tasks": {
Expand All @@ -464,7 +466,7 @@ def test_validate_install_configuration_raise_warning(mocker):
}
}
validate_install_configuration(input)
mock_warning.assert_called_with(
mock_debug.assert_called_with(
"Configuration considered invalid, using dict as it is",
extra={
"errors": {
Expand Down

0 comments on commit e41a4a1

Please sign in to comment.