Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow targets should only be wrapped in a list once #1097

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion roles/ansible-test-splitter/files/split_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ def get_targets_to_run(collection_path, targets_from_cli):
if to_skip_because_disabled(lines):
continue
if is_slow(lines):
slow_targets.append([target.name])
slow_targets.append(target.name)
else:
regular_targets.append(target.name)
return slow_targets, regular_targets


def build_up_batches(slow_targets, regular_targets, total_jobs):
remaining_jobs = max(total_jobs - len(slow_targets), 1)
# Slow targets is a list of slow targets so we need to wrap each entry in a
# list
batches = [[i] for i in slow_targets]
for x in range(remaining_jobs):
batch = regular_targets[x::remaining_jobs]
Expand Down