-
Notifications
You must be signed in to change notification settings - Fork 40
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
add integration test for bluechi-is-online agent --monitor #1025
base: main
Are you sure you want to change the base?
add integration test for bluechi-is-online agent --monitor #1025
Conversation
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.
Small NIT comment, otherwise looks good to me.
assert ( | ||
monitor_result_test_two.result is not None | ||
and monitor_result_test_two.output != "" | ||
), "Monitor command should produce an output when agent is stopped." |
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.
NIT: I think we could check the .result
more specifically:
assert ( | |
monitor_result_test_two.result is not None | |
and monitor_result_test_two.output != "" | |
), "Monitor command should produce an output when agent is stopped." | |
assert ( | |
monitor_result_test_two.result == 1 | |
and monitor_result_test_two.output != "" | |
), "Monitor command should produce an output when agent is stopped." |
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.
Using 'monitor_result_test_two.result == 1' failed, Based on the test logs, monitor_result_test_two.result is currently captured as False when the agent is offline, rather than the exit code (1).
Also, when I run this test manually the command outputs text and not 1:
~$ sudo bluechi-is-online agent --monitor
org.eclipse.bluechi.Agent is offline
~$ echo $?
1
To make monitor_result_test_two.result == 1 work, we’d need to modify the monitor_agent() function to explicitly return the exit code from the bluechi-is-online command
or use 'monitor_result_test_two.result is False'
but that approach wouldn't align with the other bluechi-is-online tests.
Please Let me know your preference!
Please remove the merge commit. |
5109d6b
to
d4391f5
Compare
@nsimsolo Please pull the latest changes from main. This should fix the failing pipelines. |
Signed-off-by: nsimsolo <nsimsolo@redhat.com>
d4391f5
to
e54509f
Compare
Adding integration test for bluechi-is-online agent --monitor
--monitor keeps monitoring as long as agent is online and exits if it detects an offline state.