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

ansible-test/split_targets: improve the start/end computation #973

Merged
merged 1 commit into from
Jun 28, 2021
Merged

ansible-test/split_targets: improve the start/end computation #973

merged 1 commit into from
Jun 28, 2021

Conversation

goneri
Copy link
Collaborator

@goneri goneri commented Jun 28, 2021

Simplify the logic and correctly compute the end of the first job
in case the number of targets is lower than ansible_test_split_in.

@goneri
Copy link
Collaborator Author

goneri commented Jun 28, 2021

recheck

1 similar comment
@goneri
Copy link
Collaborator Author

goneri commented Jun 28, 2021

recheck

Simplify the logic and correctly compute the end of the first job
in case the number of targets is lower than `ansible_test_split_in`.
@oukooveu
Copy link
Contributor

are you sure this will work as expected? for example for ansible_test_split_in = 3 and number_entries = 10 this produces ranges: 0-4, 4-8 and 8-12.

i can suggest following change:

_end_at: "{{ _start_at|int + _iter_by|int - 1 if ansible_test_do_number|int == _iter_by else number_entries - 1 }}"

and this produces 0-3, 4-7 and 8-9 for the same input.

@goneri goneri deleted the ansible-test-split_targets-improve-the-start-end-computation_5036 branch December 13, 2021 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants