-
Notifications
You must be signed in to change notification settings - Fork 60
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
Adding support for supressing UNKNOWN results via --no-unknown #63
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ def check_docker_fresh(): | |
def check_docker(): | ||
cd.rc = -1 | ||
check_docker.no_ok = False | ||
check_docker.no_unknown = False | ||
check_docker.no_performance = False | ||
cd.timeout = 1 | ||
cd.messages = [] | ||
|
@@ -720,6 +721,7 @@ def test_perform(check_docker, fs, args, called): | |
def test_print_results(check_docker, capsys, messages, perf_data, expected): | ||
# These sometimes get set to true when using random-order plugin, for example --random-order-seed=620808 | ||
check_docker.no_ok = False | ||
check_docker.no_unknown = False | ||
check_docker.no_performance = False | ||
check_docker.messages = messages | ||
check_docker.performance_data = perf_data | ||
|
@@ -728,7 +730,7 @@ def test_print_results(check_docker, capsys, messages, perf_data, expected): | |
assert out.strip() == expected | ||
|
||
|
||
@pytest.mark.parametrize("messages, perf_data, no_ok, no_performance, expected", ( | ||
@pytest.mark.parametrize("messages, perf_data, no_ok, no_unknown, no_performance, expected", ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You added a test parameter but you didn't update the data to match it. Have you used parameterized pytest tests before? It is pretty simple (and also a little ugly).
This executes does something like this
Can you add the missing entries to the tuples and also add tuples that exercise the code you are changing. Don't worry if you break something, I can help you out. Also my dev documentation should help you get the test running on your machine. |
||
([], [], False, False, ''), | ||
(['TEST'], [], False, False, 'TEST'), | ||
(['FOO', 'BAR'], [], False, False, 'FOO; BAR'), | ||
|
@@ -742,10 +744,11 @@ def test_print_results(check_docker, capsys, messages, perf_data, expected): | |
(['OK: TEST'], ['1;2;3;4;'], False, True, 'OK: TEST'), | ||
(['OK: FOO', 'OK: BAR'], ['1;2;3;4;'], True, True, 'OK'), | ||
)) | ||
def test_print_results_no_ok(check_docker, capsys, messages, perf_data, no_ok, no_performance, expected): | ||
def test_print_results_no_ok(check_docker, capsys, messages, perf_data, no_ok, no_unknown, no_performance, expected): | ||
check_docker.messages = messages | ||
check_docker.performance_data = perf_data | ||
check_docker.no_ok = no_ok | ||
check_docker.no_unknown = no_unknown | ||
check_docker.no_performance = no_performance | ||
check_docker.print_results() | ||
out, err = capsys.readouterr() | ||
|
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.
If the user passes
--no_ok --no_unknown
UNKNOWN
will be added to the output even if one was not removed.