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 <slev@altlinux.org>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Levin 2020-06-05 12:39:08 +03:00 committed by Florence Blanc-Renaud
parent ebf928571a
commit 3ac2cdfd43
5 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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=$?

View File

@ -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=$?

View File

@ -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=$?

View File

@ -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