-
Notifications
You must be signed in to change notification settings - Fork 218
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 skip test logic when pika not installed #3057
base: develop
Are you sure you want to change the base?
Conversation
@schandrika Do these test modifications make sense to you? The intent is for these tests to skip rather than thrown an error if pika is not installed (i.e. RMQ configured on Volttron). |
if is_rabbitmq_available(): | ||
from volttrontesting.platform.test_instance_setup import create_vcfg_vhome | ||
else: | ||
pytest.skip("Pika is not installed", allow_module_level=True) |
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.
the create_vcfg_vhome method seem to be create a volttron home and nothing else. (The method should be name create_vhome )So I don't see why it should depend on pika install
HAS_RMQ = is_rabbitmq_available() | ||
if HAS_RMQ: | ||
from volttrontesting.fixtures.rmq_test_setup import create_rmq_volttron_setup | ||
else: |
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.
The if part makes sense but in the else why should the entire module be skipped. The module has both rmq and zmq tests.
if is_rabbitmq_available(): | ||
from volttron.utils.rmq_setup import start_rabbit, stop_rabbit | ||
else: | ||
pytest.skip("Pika is not installed", allow_module_level=True) |
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.
Again, only the rmq test cases should be skipped. you can set a variable inside if and use that to skip the rmq test case alone
Description
Some tests require RMQ to be installed which in turn requires pika. When running these tests,
pytest
will mark those tests as 'ERROR'. If a volttron platform does not install RMQ, then running tests should not result in 'ERROR'; instead, those tests should be skipped following the example in this previous PR.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Test Configuration:
Ubuntu 18.04
Python 3.10
Checklist: