From 3ac2cdfd431f79838ec4465bcf98f75d99f8c262 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Fri, 5 Jun 2020 12:39:08 +0300 Subject: [PATCH] Azure: Make it possible to pass additional Pytest args Some tests require its specific Pytest args. With this change they can be specified in tests definitions. Signed-off-by: Stanislav Levin Reviewed-By: Alexander Bokovoy --- ipatests/azure/azure_definitions/base-fedora.yml | 1 + ipatests/azure/scripts/azure-run-base-tests.sh | 2 +- ipatests/azure/scripts/azure-run-integration-tests.sh | 1 + ipatests/azure/scripts/azure-run-tests.sh | 4 ++++ ipatests/azure/scripts/generate-matrix.py | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ipatests/azure/azure_definitions/base-fedora.yml b/ipatests/azure/azure_definitions/base-fedora.yml index d9d85840b..f9cc3b92a 100644 --- a/ipatests/azure/azure_definitions/base-fedora.yml +++ b/ipatests/azure/azure_definitions/base-fedora.yml @@ -11,6 +11,7 @@ vms: - test_ipaserver - test_ipatests_plugins - test_xmlrpc/test_dns_plugin.py + args: "-k 'not test_dns_soa'" type: base - container_job: xmlrpc diff --git a/ipatests/azure/scripts/azure-run-base-tests.sh b/ipatests/azure/scripts/azure-run-base-tests.sh index a2129d2a4..c779fbc89 100755 --- a/ipatests/azure/scripts/azure-run-base-tests.sh +++ b/ipatests/azure/scripts/azure-run-base-tests.sh @@ -65,7 +65,7 @@ if [ "$install_result" -eq 0 ] ; then --logfile-dir="$IPA_TESTS_LOGSDIR" \ --verbose \ --with-xunit \ - '-k not test_dns_soa' \ + $IPA_TESTS_ARGS \ $IPA_TESTS_TO_IGNORE \ $IPA_TESTS_TO_RUN && tests_result=0 ; } || \ tests_result=$? diff --git a/ipatests/azure/scripts/azure-run-integration-tests.sh b/ipatests/azure/scripts/azure-run-integration-tests.sh index f4e504868..50006d063 100755 --- a/ipatests/azure/scripts/azure-run-integration-tests.sh +++ b/ipatests/azure/scripts/azure-run-integration-tests.sh @@ -16,6 +16,7 @@ tests_result=1 --logfile-dir="$IPA_TESTS_LOGSDIR" \ --with-xunit \ --verbose \ + $IPA_TESTS_ARGS \ $IPA_TESTS_TO_IGNORE \ $IPA_TESTS_TO_RUN && tests_result=0 ; } || \ tests_result=$? diff --git a/ipatests/azure/scripts/azure-run-tests.sh b/ipatests/azure/scripts/azure-run-tests.sh index 170a0f9d8..ea8f93646 100755 --- a/ipatests/azure/scripts/azure-run-tests.sh +++ b/ipatests/azure/scripts/azure-run-tests.sh @@ -22,6 +22,9 @@ IPA_TESTS_ENV_NAME="${!IPA_TESTS_ENV_NAME_VARNAME:-}" IPA_TESTS_TYPE_VARNAME="IPA_TESTS_TYPE_${PROJECT_ID}" IPA_TESTS_TYPE="${!IPA_TESTS_TYPE_VARNAME:-integration}" +IPA_TESTS_ARGS_VARNAME="IPA_TESTS_ARGS_${PROJECT_ID}" +IPA_TESTS_ARGS="${!IPA_TESTS_ARGS_VARNAME:-}" + # Normalize spacing and expand the list afterwards. Remove {} for the single list element case IPA_TESTS_TO_RUN=$(eval "echo {$(echo $IPA_TESTS_TO_RUN | sed -e 's/[ \t]+*/,/g')}" | tr -d '{}') @@ -96,6 +99,7 @@ tests_result=1 --env IPA_TESTS_LOGSDIR="$IPA_TESTS_LOGSDIR" \ --env IPA_TESTS_TO_RUN="$IPA_TESTS_TO_RUN" \ --env IPA_TESTS_TO_IGNORE="$IPA_TESTS_TO_IGNORE" \ + --env IPA_TESTS_ARGS="$IPA_TESTS_ARGS" \ "$IPA_TESTS_CONTROLLER" \ /bin/bash --noprofile --norc \ -eux "$tests_runner" && tests_result=0 ; } || tests_result=$? diff --git a/ipatests/azure/scripts/generate-matrix.py b/ipatests/azure/scripts/generate-matrix.py index 1bbe64566..56a8af97f 100644 --- a/ipatests/azure/scripts/generate-matrix.py +++ b/ipatests/azure/scripts/generate-matrix.py @@ -27,6 +27,7 @@ with open(args.azure_template) as f: vm_job.get('ignore', '')) jobs[f'ipa_tests_type_{job_id}'] = vm_job.get( 'type', 'integration') + jobs[f'ipa_tests_args_{job_id}'] = vm_job.get('args', '') containers = vm_job.get('containers') replicas = 0