From a7f747c4eb18db568f0aecb70ccee876428db28c Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Sat, 31 Jul 2021 13:33:44 +0200 Subject: [PATCH] Make split jobs child count configurable --- .../ansible-test-splitter/defaults/main.yaml | 1 + .../tasks/split_targets.yaml | 2 +- zuul.d/project-templates.yaml | 26 ++++++++++++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/roles/ansible-test-splitter/defaults/main.yaml b/roles/ansible-test-splitter/defaults/main.yaml index cf90de94c..112f5f11b 100644 --- a/roles/ansible-test-splitter/defaults/main.yaml +++ b/roles/ansible-test-splitter/defaults/main.yaml @@ -1,3 +1,4 @@ --- ansible_test_splitter__test_changed: false ansible_test_splitter__children_prefix: please_adjust_this +ansible_test_splitter__children_count: 5 diff --git a/roles/ansible-test-splitter/tasks/split_targets.yaml b/roles/ansible-test-splitter/tasks/split_targets.yaml index 4de5cb285..f3241491e 100644 --- a/roles/ansible-test-splitter/tasks/split_targets.yaml +++ b/roles/ansible-test-splitter/tasks/split_targets.yaml @@ -9,7 +9,7 @@ python3 /tmp/split_targets.py -p "{{ ansible_test_splitter__children_prefix }}" -t "{{ ansible_test_splitter__targets_to_test|default('') }}" - -j 10 + -j "{{ ansible_test_splitter__children_count }}" args: chdir: "{{ ansible_test_location }}" register: _result diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index ce86f6033..3457fea60 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -76,7 +76,9 @@ - name: github.com/ansible-collections/ansible.netcommon - name: github.com/ansible-collections/community.aws - name: github.com/ansible-collections/community.general - - ansible-test-splitter + - ansible-test-splitter: + vars: + ansible_test_splitter__children_count: 10 - ansible-test-cloud-integration-aws-py36_0 - ansible-test-cloud-integration-aws-py36_1 - ansible-test-cloud-integration-aws-py36_2 @@ -103,7 +105,9 @@ - name: github.com/ansible-collections/ansible.netcommon - name: github.com/ansible-collections/community.aws - name: github.com/ansible-collections/community.general - - ansible-test-splitter + - ansible-test-splitter: + vars: + ansible_test_splitter__children_count: 10 - ansible-test-cloud-integration-aws-py36_0 - ansible-test-cloud-integration-aws-py36_1 - ansible-test-cloud-integration-aws-py36_2 @@ -130,7 +134,9 @@ - name: github.com/ansible-collections/ansible.netcommon - name: github.com/ansible-collections/ansible.utils - name: github.com/ansible-collections/community.general - - ansible-test-splitter + - ansible-test-splitter: + vars: + ansible_test_splitter__children_count: 15 - ansible-test-cloud-integration-aws-py36_0 - ansible-test-cloud-integration-aws-py36_1 - ansible-test-cloud-integration-aws-py36_2 @@ -141,6 +147,11 @@ - ansible-test-cloud-integration-aws-py36_7 - ansible-test-cloud-integration-aws-py36_8 - ansible-test-cloud-integration-aws-py36_9 + - ansible-test-cloud-integration-aws-py36_10 + - ansible-test-cloud-integration-aws-py36_11 + - ansible-test-cloud-integration-aws-py36_12 + - ansible-test-cloud-integration-aws-py36_13 + - ansible-test-cloud-integration-aws-py36_14 - ansible-galaxy-importer: voting: false gate: @@ -156,7 +167,9 @@ - name: github.com/ansible-collections/ansible.netcommon - name: github.com/ansible-collections/ansible.utils - name: github.com/ansible-collections/community.general - - ansible-test-splitter + - ansible-test-splitter: + vars: + ansible_test_splitter__children_count: 15 - ansible-test-cloud-integration-aws-py36_0 - ansible-test-cloud-integration-aws-py36_1 - ansible-test-cloud-integration-aws-py36_2 @@ -167,6 +180,11 @@ - ansible-test-cloud-integration-aws-py36_7 - ansible-test-cloud-integration-aws-py36_8 - ansible-test-cloud-integration-aws-py36_9 + - ansible-test-cloud-integration-aws-py36_10 + - ansible-test-cloud-integration-aws-py36_11 + - ansible-test-cloud-integration-aws-py36_12 + - ansible-test-cloud-integration-aws-py36_13 + - ansible-test-cloud-integration-aws-py36_14 - ansible-galaxy-importer: voting: false