BB: Rename list_machines -> gcp_machines_to_start
This commit is contained in:
parent
ea81226c2a
commit
ae82578ae0
|
@ -37,7 +37,7 @@ def no_gcp(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def list_machines(request: pytest.FixtureRequest) -> Mapping[str, Collection[str]]:
|
def gcp_machines_to_start(request: pytest.FixtureRequest) -> Mapping[str, Collection[str]]:
|
||||||
machines_to_start: Dict[str, Set[str]] = {}
|
machines_to_start: Dict[str, Set[str]] = {}
|
||||||
|
|
||||||
enabled_tests = (test.name for test in request.node.items)
|
enabled_tests = (test.name for test in request.node.items)
|
||||||
|
|
|
@ -34,20 +34,20 @@ LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True, scope="session")
|
@pytest.fixture(autouse=True, scope="session")
|
||||||
def GCPHandler(request, no_gcp, list_machines):
|
def GCPHandler(request, no_gcp, gcp_machines_to_start):
|
||||||
if not no_gcp:
|
if not no_gcp:
|
||||||
LOGGER.info(f"MACHINES TO START: {list_machines}")
|
LOGGER.info(f"MACHINES TO START: {gcp_machines_to_start}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
initialize_gcp_client()
|
initialize_gcp_client()
|
||||||
start_machines(list_machines)
|
start_machines(gcp_machines_to_start)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.error("GCP Handler failed to initialize: %s." % e)
|
LOGGER.error("GCP Handler failed to initialize: %s." % e)
|
||||||
pytest.exit("Encountered an error while starting GCP machines. Stopping the tests.")
|
pytest.exit("Encountered an error while starting GCP machines. Stopping the tests.")
|
||||||
wait_machine_bootup()
|
wait_machine_bootup()
|
||||||
|
|
||||||
def fin():
|
def fin():
|
||||||
stop_machines(list_machines)
|
stop_machines(gcp_machines_to_start)
|
||||||
|
|
||||||
request.addfinalizer(fin)
|
request.addfinalizer(fin)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue