-
Notifications
You must be signed in to change notification settings - Fork 84
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
[RHELC-1511] Tell users to use config ini instead of env vars #1433
base: main
Are you sure you want to change the base?
[RHELC-1511] Tell users to use config ini instead of env vars #1433
Conversation
2b03ee6
to
20c620c
Compare
/packit test |
9a90f0d
to
e235cbd
Compare
/packit test |
58b50cd
to
b737455
Compare
@@ -167,7 +167,7 @@ def test_logfile_buffer_handler(read_std): | |||
|
|||
stdouterr_out, _ = read_std() | |||
assert "message 1" not in stdouterr_out | |||
assert "message 2" in stdouterr_out | |||
assert "message 2" not in stdouterr_out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Venefilyn, I was getting the following unit test failure. Is this fix all right?
=================================== FAILURES ===================================
_________________________ test_logfile_buffer_handler __________________________
[gw0] linux2 -- Python 2.7.5 /usr/bin/python2
read_std = <function factory at 0x7f27c05fd7d0>
@pytest.mark.noautofixtures
def test_logfile_buffer_handler(read_std):
logbuffer_handler = logger_module.LogfileBufferHandler(2, "custom_name")
logger = logging.getLogger("convert2rhel")
logger.addHandler(logbuffer_handler)
logger.warning("message 1")
logger.warning("message 2")
# flushing without other handlers should work, it will just go to NullHandlers
logbuffer_handler.flush()
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.name = "custom_name"
logger.addHandler(stdout_handler)
# flush to the streamhandler we just created
logbuffer_handler.flush()
stdouterr_out, _ = read_std()
assert "message 1" not in stdouterr_out
> assert "message 2" in stdouterr_out
E AssertionError: assert 'message 2' in ''
convert2rhel/unit_tests/logger_test.py:170: AssertionError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, the unit tests executed here on GitHub are giving me an opposite result:
=================================== FAILURES ===================================
_________________________ test_logfile_buffer_handler __________________________
[gw2] linux2 -- Python 2.7.5 /usr/bin/python2
read_std = <function factory at 0x7ff1b0f57c80>
@pytest.mark.noautofixtures
def test_logfile_buffer_handler(read_std):
logbuffer_handler = logger_module.LogfileBufferHandler(2, "custom_name")
logger = logging.getLogger("convert2rhel")
logger.addHandler(logbuffer_handler)
logger.warning("message 1")
logger.warning("message 2")
# flushing without other handlers should work, it will just go to NullHandlers
logbuffer_handler.flush()
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.name = "custom_name"
logger.addHandler(stdout_handler)
# flush to the streamhandler we just created
logbuffer_handler.flush()
stdouterr_out, _ = read_std()
assert "message 1" not in stdouterr_out
> assert "message 2" not in stdouterr_out
E AssertionError: assert 'message 2' not in 'message 2\n'
E 'message 2' is contained here:
E Strings contain only whitespace, escaping them using repr()
E 'message 2\n'
convert2rhel/unit_tests/logger_test.py:170: AssertionError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pulled down the PR locally and ran without any issues 🤔
============= 1323 passed, 97 skipped, 1 warnings in 8.32 seconds ==============
68e08e4
to
913b709
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1433 +/- ##
=======================================
Coverage ? 96.11%
=======================================
Files ? 72
Lines ? 5176
Branches ? 896
=======================================
Hits ? 4975
Misses ? 119
Partials ? 82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I can split this up into necessary-only changes and nice to have formatting changes so that there's not that many changes to review at once. |
3619535
to
b0e1b95
Compare
Ok, I have slashed the number of changed lines to a third, keeping just the bare minimum. I'll create another PR for the nice-to-have changes to the messages. |
0db29cc
to
34af479
Compare
Env vars have been deprecated in favor of the ini config file (e.g. /etc/convert2rhel.ini). for that reason We should be telling users to use the config file instead of the deprecated env vars.
34af479
to
539280d
Compare
/packit test |
Env vars have been deprecated in favor of the ini config file (e.g. /etc/convert2rhel.ini). We should be telling users to use the config file instead of the deprecated env vars.
Jira Issues:
Checklist
[RHELC-]
or[HMS-]
is part of the PR titleRelease Pending
if relevant