From eab7d6a6774e29616e674d771c0e12788e0ba0c2 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Thu, 5 Oct 2023 14:36:19 -0300 Subject: [PATCH] upstream ci: Use a single random seed for spliting tests Dependind on how long it took for the jobs to start, a different seed would be used to group tests and tests could either repeat or not be selected at all. By using a seed based on the day the test run reduces the chance of using different random seeds, and still allow for the tests to be executed in a different order. The execution in different order is important to identify tests that work or fail only if executed after other tests. --- tests/azure/templates/galaxy_script.yml | 1 + tests/azure/templates/playbook_fast.yml | 1 + tests/azure/templates/playbook_tests.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/azure/templates/galaxy_script.yml b/tests/azure/templates/galaxy_script.yml index cd95c65815..a00dd0a55f 100644 --- a/tests/azure/templates/galaxy_script.yml +++ b/tests/azure/templates/galaxy_script.yml @@ -67,6 +67,7 @@ jobs: --color=yes \ --splits=${{ parameters.number_of_groups }} \ --group=${{ parameters.group_number }} \ + --randomly-seed=$(date "+%Y%m%d") \ --junit-xml=TEST-results-group-${{ parameters.group_number }}.xml displayName: Run playbook tests env: diff --git a/tests/azure/templates/playbook_fast.yml b/tests/azure/templates/playbook_fast.yml index ce187a3ccb..2629b3e5b7 100644 --- a/tests/azure/templates/playbook_fast.yml +++ b/tests/azure/templates/playbook_fast.yml @@ -72,6 +72,7 @@ jobs: --suppress-no-test-exit-code \ --splits=${{ parameters.number_of_groups }} \ --group=${{ parameters.group_number }} \ + --randomly-seed=$(date "+%Y%m%d") \ --junit-xml=TEST-results-group-${{ parameters.group_number }}.xml then [ $? -eq 5 ] && true || false diff --git a/tests/azure/templates/playbook_tests.yml b/tests/azure/templates/playbook_tests.yml index ce3200026b..c65c955fb1 100644 --- a/tests/azure/templates/playbook_tests.yml +++ b/tests/azure/templates/playbook_tests.yml @@ -69,6 +69,7 @@ jobs: --color=yes \ --splits=${{ parameters.number_of_groups }} \ --group=${{ parameters.group_number }} \ + --randomly-seed=$(date "+%Y%m%d") \ --junit-xml=TEST-results-group-${{ parameters.group_number }}.xml displayName: Run playbook tests env: