Add --no-loadscope-reorder and --loadscope-reorder options (#1217)
Based on #1098. Closes #1098 --------- Co-authored-by: Toan Vuong <toan.vuong@hyperscience.com>
This commit is contained in:
@@ -371,11 +371,15 @@ class LoadScopeScheduling:
|
||||
work_unit = unsorted_workqueue.setdefault(scope, {})
|
||||
work_unit[nodeid] = False
|
||||
|
||||
# Insert tests scopes into work queue ordered by number of tests.
|
||||
for scope, nodeids in sorted(
|
||||
unsorted_workqueue.items(), key=lambda item: -len(item[1])
|
||||
):
|
||||
self.workqueue[scope] = nodeids
|
||||
if self.config.option.loadscopereorder:
|
||||
# Insert tests scopes into work queue ordered by number of tests.
|
||||
for scope, nodeids in sorted(
|
||||
unsorted_workqueue.items(), key=lambda item: -len(item[1])
|
||||
):
|
||||
self.workqueue[scope] = nodeids
|
||||
else:
|
||||
for scope, nodeids in unsorted_workqueue.items():
|
||||
self.workqueue[scope] = nodeids
|
||||
|
||||
# Avoid having more workers than work
|
||||
extra_nodes = len(self.nodes) - len(self.workqueue)
|
||||
|
||||
Reference in New Issue
Block a user