Skip to content
Snippets Groups Projects
Unverified Commit e92f09b9 authored by Thomas Woerner's avatar Thomas Woerner Committed by GitHub
Browse files

Merge pull request #1308 from rjeffman/mv_set_test_modules

upstream CI: Move scripts that evaluate repo changes to infra/azure
parents 97b0638f f6bd62fe
Branches
Tags
No related merge requests found
...@@ -159,7 +159,7 @@ def map_test_module_sources(base): ...@@ -159,7 +159,7 @@ def map_test_module_sources(base):
"""Create a map of 'test-modules' to 'plugin-sources', from 'base'.""" """Create a map of 'test-modules' to 'plugin-sources', from 'base'."""
# Find root directory of playbook tests. # Find root directory of playbook tests.
script_dir = os.path.dirname(__file__) script_dir = os.path.dirname(__file__)
test_root = os.path.realpath(os.path.join(script_dir, f"../{base}")) test_root = os.path.realpath(os.path.join(script_dir, f"../../../{base}"))
# create modules:source_files map # create modules:source_files map
_result = {} _result = {}
for test_module in [d for d in os.scandir(test_root) if d.is_dir()]: for test_module in [d for d in os.scandir(test_root) if d.is_dir()]:
...@@ -170,7 +170,7 @@ def map_test_module_sources(base): ...@@ -170,7 +170,7 @@ def map_test_module_sources(base):
def usage(err=0): def usage(err=0):
print("filter_plugins.py [-h|--help] [-p|--pytest] PY_SRC...") print("get_test_modules.py [-h|--help] [-p|--pytest] PY_SRC...")
print( print(
""" """
Print a comma-separated list of modules that should be tested if Print a comma-separated list of modules that should be tested if
......
...@@ -11,7 +11,8 @@ die() { ...@@ -11,7 +11,8 @@ die() {
echo -e "${RED}${*}${RST}" >&2 echo -e "${RED}${*}${RST}" >&2
} }
TOPDIR="$(dirname "${BASH_SOURCE[0]}")/.." BASEDIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
TOPDIR="$(readlink -f "${BASEDIR}/../../..")"
[ -n "$(command -v python3)" ] && python="$(command -v python3)" || python="$(command -v python2)" [ -n "$(command -v python3)" ] && python="$(command -v python3)" || python="$(command -v python2)"
...@@ -41,7 +42,7 @@ then ...@@ -41,7 +42,7 @@ then
git remote remove "${remote}" git remote remove "${remote}"
# shellcheck disable=SC2046 # shellcheck disable=SC2046
enabled_modules="$(${python} utils/get_test_modules.py $(cat "${files_list}"))" enabled_modules="$(${python} "${BASEDIR}/get_test_modules.py" $(cat "${files_list}"))"
[ -z "${enabled_modules}" ] && enabled_modules="None" [ -z "${enabled_modules}" ] && enabled_modules="None"
# Get individual tests that should be executed # Get individual tests that should be executed
......
...@@ -46,7 +46,7 @@ jobs: ...@@ -46,7 +46,7 @@ jobs:
displayName: Set repo rootdir displayName: Set repo rootdir
- script: | - script: |
. "${TOPDIR}/utils/set_test_modules" . "${TOPDIR}/infra/azure/scripts/set_test_modules"
python3 utils/check_test_configuration.py ${{ parameters.distro }} python3 utils/check_test_configuration.py ${{ parameters.distro }}
displayName: Check test configuration displayName: Check test configuration
env: env:
...@@ -65,7 +65,7 @@ jobs: ...@@ -65,7 +65,7 @@ jobs:
echo "ROLES: ${ANSIBLE_ROLES_PATH}" echo "ROLES: ${ANSIBLE_ROLES_PATH}"
echo "LIBRARY: ${ANSIBLE_LIBRARY}" echo "LIBRARY: ${ANSIBLE_LIBRARY}"
echo "MODULE_UTILS: ${ANSIBLE_MODULE_UTILS}" echo "MODULE_UTILS: ${ANSIBLE_MODULE_UTILS}"
. "${TOPDIR}/utils/set_test_modules" . "${TOPDIR}/infra/azure/scripts/set_test_modules"
[ "${{ parameters.test_galaxy }}" == "True" ] && cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa [ "${{ parameters.test_galaxy }}" == "True" ] && cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa
pytest \ pytest \
-m "${{ parameters.test_type }}" \ -m "${{ parameters.test_type }}" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment