mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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:
parent
c2b70de63a
commit
d17fcdbd3b
1 changed files with 16 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue