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>
17 lines
341 B
Python
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()
|