Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion volttrontesting/platform/test_basehistorian.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
from volttron.platform.vip.agent.subsystems.query import Query
from volttrontesting.utils.utils import AgentMock
from time import sleep
from volttrontesting.platform.test_instance_setup import create_vcfg_vhome

from volttron.platform import is_rabbitmq_available
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)
Copy link
Contributor

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



class QueryHelper:
Expand Down
12 changes: 9 additions & 3 deletions volttrontesting/platform/test_instance_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
from volttron.platform.instance_setup import _is_agent_installed
from volttron.utils import get_hostname
from volttron.platform.agent.utils import is_volttron_running
from volttrontesting.fixtures.rmq_test_setup import create_rmq_volttron_setup
from volttrontesting.utils.platformwrapper import create_volttron_home
from volttron.platform import is_rabbitmq_available

HAS_RMQ = is_rabbitmq_available()
RMQ_TIMEOUT = 600
HAS_RMQ = is_rabbitmq_available()
if HAS_RMQ:
from volttrontesting.fixtures.rmq_test_setup import create_rmq_volttron_setup
else:
Copy link
Contributor

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.

pytest.skip("Pika is not installed", allow_module_level=True)

from volttrontesting.utils.platformwrapper import create_volttron_home


'''
Example variables to be used during each of the tests, depending on the prompts that will be asked
Expand Down
8 changes: 7 additions & 1 deletion volttrontesting/services/historian/test_multiplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@
from volttrontesting.utils.platformwrapper import PlatformWrapper
from volttrontesting.fixtures.volttron_platform_fixtures import get_rand_vip, \
get_rand_ip_and_port
from volttron.utils.rmq_setup import start_rabbit, stop_rabbit

from volttron.platform import is_rabbitmq_available
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)
Copy link
Contributor

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


from volttron.platform.agent.utils import execute_command


Expand Down