Files
mesa/.gitlab-ci/lava/utils/lava_farm.py
Guilherme Gallo 47659ddf70 ci: Simplify LAVA farm detection
Refactor the LAVA farm detection to use a simpler environment
variable-based approach:
- Remove the complex regex-based farm detection
- Replace LavaFarm enum with a simple string-based farm identification
- Update related tests and job definition logic
- Remove hypothesis testing dependency

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33888>
2025-03-08 02:45:02 +00:00

17 lines
341 B
Python

import logging
import os
def get_lava_farm() -> str:
"""
Returns the LAVA farm based on the FARM environment variable.
:return: The LAVA farm
"""
farm: str = os.getenv("FARM", "unknown")
if farm == "unknown":
logging.warning("FARM environment variable is not set, using unknown")
return farm.lower()