Tests: Add ability to blocklist UI tests

This commit adds the ability to block certain UI tests from running,
while also honoring the `BLENDER_TEST_IGNORE_BLOCKLIST` env variable.

Currently the only entries are for Windows with Intel GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/148609
This commit is contained in:
Sean Kim 2025-10-30 22:02:19 +01:00 • committed by Sean Kim
parent c2b70de63a
commit d17fcdbd3b

View file

@ -60,9 +60,11 @@ def main():
if "bpy" not in sys.modules:
raise Exception("This must run inside Blender")
import bpy
import gpu
parser = create_parser()
args = parser.parse_args(sys.argv[sys.argv.index("--") + 1:])
verbose = os.getenv('BLENDER_VERBOSE') is not None
# Check if `bpy.app.use_event_simulate` has been enabled by the test itself.
# When writing tests, it's useful if the test can temporarily be set to keep the window open.
@ -83,13 +85,26 @@ def main():
else:
bpy.app.use_event_simulate = False
gpu_device = gpu.platform.device_type_get()
BLOCKLIST = []
if os.getenv("BLENDER_TEST_IGNORE_BLOCKLIST") is None:
if sys.platform == "win32" and gpu_device == "INTEL":
# See #149084 for the tracking issue
BLOCKLIST = ["test_workspace"]
is_first = True
for test_id in args.tests:
mod_name, fn_name = test_id.partition(".")[0::2]
if mod_name in BLOCKLIST or test_id in BLOCKLIST:
if not args.keep_open:
sys.exit(0)
if not is_first:
bpy.ops.wm.read_homefile()
is_first = False
mod_name, fn_name = test_id.partition(".")[0::2]
mod = __import__(mod_name)
test_fn = getattr(mod, fn_name)