Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564.
This commit is contained in:
@@ -121,8 +121,7 @@ class TestConfig:
|
||||
config = TestConfig._read_config_module(self.base_dir)
|
||||
self.tests = TestCollection(env,
|
||||
getattr(config, 'tests', ['*']),
|
||||
getattr(config, 'categories', ['*']),
|
||||
getattr(config, 'background', False))
|
||||
getattr(config, 'categories', ['*']))
|
||||
self.revisions = getattr(config, 'revisions', {})
|
||||
self.builds = getattr(config, 'builds', {})
|
||||
self.queue = TestQueue(self.base_dir / 'results.json')
|
||||
@@ -244,9 +243,6 @@ class TestConfig:
|
||||
test_category = test.category()
|
||||
|
||||
for device in self.devices:
|
||||
if not (test.use_device() or device.type == "CPU"):
|
||||
continue
|
||||
|
||||
entry = self.queue.find(revision_name, test_name, test_category, device.id)
|
||||
if entry:
|
||||
# Test if revision hash or executable changed.
|
||||
|
||||
@@ -26,12 +26,6 @@ class Test:
|
||||
"""
|
||||
return False
|
||||
|
||||
def use_background(self) -> bool:
|
||||
"""
|
||||
Test runs in background mode and requires no display.
|
||||
"""
|
||||
return True
|
||||
|
||||
@abc.abstractmethod
|
||||
def run(self, env, device_id: str) -> Dict:
|
||||
"""
|
||||
@@ -40,7 +34,7 @@ class Test:
|
||||
|
||||
|
||||
class TestCollection:
|
||||
def __init__(self, env, names_filter: List = ['*'], categories_filter: List = ['*'], background: bool = False):
|
||||
def __init__(self, env, names_filter: List = ['*'], categories_filter: List = ['*']):
|
||||
import importlib
|
||||
import pkgutil
|
||||
import tests
|
||||
@@ -54,9 +48,6 @@ class TestCollection:
|
||||
tests = module.generate(env)
|
||||
|
||||
for test in tests:
|
||||
if background and not test.use_background():
|
||||
continue
|
||||
|
||||
test_category = test.category()
|
||||
found = False
|
||||
for category_filter in categories_filter:
|
||||
|
||||
@@ -61,10 +61,7 @@ def print_row(config: api.TestConfig, entries: List, end='\n') -> None:
|
||||
row += f"{revision: <15} "
|
||||
|
||||
if config.queue.has_multiple_categories:
|
||||
category_name = entries[0].category
|
||||
if entries[0].device_type != "CPU":
|
||||
category_name += " " + entries[0].device_type
|
||||
row += f"{category_name: <15} "
|
||||
row += f"{entries[0].category: <15} "
|
||||
row += f"{entries[0].test: <40} "
|
||||
|
||||
for entry in entries:
|
||||
@@ -102,13 +99,10 @@ def run_entry(env: api.TestEnvironment,
|
||||
row: List,
|
||||
entry: api.TestEntry,
|
||||
update_only: bool):
|
||||
updated = False
|
||||
failed = False
|
||||
|
||||
# Check if entry needs to be run.
|
||||
if update_only and entry.status not in ('queued', 'outdated'):
|
||||
print_row(config, row, end='\r')
|
||||
return updated, failed
|
||||
return False
|
||||
|
||||
# Run test entry.
|
||||
revision = entry.revision
|
||||
@@ -121,9 +115,7 @@ def run_entry(env: api.TestEnvironment,
|
||||
|
||||
test = config.tests.find(testname, testcategory)
|
||||
if not test:
|
||||
return updated, failed
|
||||
|
||||
updated = True
|
||||
return False
|
||||
|
||||
# Log all output to dedicated log file.
|
||||
logname = testcategory + '_' + testname + '_' + revision
|
||||
@@ -136,13 +128,12 @@ def run_entry(env: api.TestEnvironment,
|
||||
entry.error_msg = ''
|
||||
|
||||
# Build revision, or just set path to existing executable.
|
||||
entry.status = 'building'
|
||||
print_row(config, row, end='\r')
|
||||
executable_ok = True
|
||||
if len(entry.executable):
|
||||
env.set_blender_executable(pathlib.Path(entry.executable), environment)
|
||||
else:
|
||||
entry.status = 'building'
|
||||
print_row(config, row, end='\r')
|
||||
|
||||
if config.benchmark_type == "comparison":
|
||||
install_dir = config.builds_dir / revision
|
||||
else:
|
||||
@@ -152,7 +143,6 @@ def run_entry(env: api.TestEnvironment,
|
||||
if not executable_ok:
|
||||
entry.status = 'failed'
|
||||
entry.error_msg = 'Failed to build'
|
||||
failed = True
|
||||
else:
|
||||
env.set_blender_executable(install_dir, environment)
|
||||
|
||||
@@ -169,7 +159,6 @@ def run_entry(env: api.TestEnvironment,
|
||||
except KeyboardInterrupt as e:
|
||||
raise e
|
||||
except Exception as e:
|
||||
failed = True
|
||||
entry.status = 'failed'
|
||||
entry.error_msg = str(e)
|
||||
|
||||
@@ -182,7 +171,7 @@ def run_entry(env: api.TestEnvironment,
|
||||
env.unset_log_file()
|
||||
env.set_default_blender_executable()
|
||||
|
||||
return updated, failed
|
||||
return True
|
||||
|
||||
|
||||
def cmd_init(env: api.TestEnvironment, argv: List):
|
||||
@@ -269,8 +258,6 @@ def cmd_run(env: api.TestEnvironment, argv: List, update_only: bool):
|
||||
parser.add_argument('test', nargs='?', default='*')
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
exit_code = 0
|
||||
|
||||
configs = env.get_configs(args.config)
|
||||
for config in configs:
|
||||
updated = False
|
||||
@@ -280,14 +267,11 @@ def cmd_run(env: api.TestEnvironment, argv: List, update_only: bool):
|
||||
if match_entry(row[0], args):
|
||||
for entry in row:
|
||||
try:
|
||||
test_updated, test_failed = run_entry(env, config, row, entry, update_only)
|
||||
if test_updated:
|
||||
if run_entry(env, config, row, entry, update_only):
|
||||
updated = True
|
||||
# Write queue every time in case running gets interrupted,
|
||||
# so it can be resumed.
|
||||
config.queue.write()
|
||||
if test_failed:
|
||||
exit_code = 1
|
||||
except KeyboardInterrupt as e:
|
||||
cancel = True
|
||||
break
|
||||
@@ -306,8 +290,6 @@ def cmd_run(env: api.TestEnvironment, argv: List, update_only: bool):
|
||||
|
||||
print("\nfile://" + str(html_filepath))
|
||||
|
||||
sys.exit(exit_code)
|
||||
|
||||
|
||||
def cmd_graph(argv: List):
|
||||
# Create graph from a given JSON results file.
|
||||
|
||||
@@ -114,9 +114,6 @@ else:
|
||||
def category(self):
|
||||
return "eevee"
|
||||
|
||||
def use_background(self):
|
||||
return False
|
||||
|
||||
def run(self, env, device_id):
|
||||
args = {}
|
||||
_, log = env.run_in_blender(_run, args, [self.filepath], foreground=True)
|
||||
|
||||
Reference in New Issue
Block a user