summaryrefslogtreecommitdiffstats
path: root/.azure-pipelines/commands/sanity.sh
blob: 10c1968c27732d2c04854ef50e28070f595e67aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash

set -o pipefail -eux

declare -a args
IFS='/:' read -ra args <<< "$1"

group="${args[1]}"

group2_include=(
    ansible-doc
    changelog
    package-data
    pep8
    pylint
    validate-modules
)

group1_exclude=(
    "${group2_include[@]}"
)

options=()

case "${group}" in
    1)
        for name in "${group1_exclude[@]}"; do
            options+=(--skip-test "${name}")
        done
        ;;
    2)
        for name in "${group2_include[@]}"; do
            options+=(--test "${name}")
        done
        ;;
esac

# shellcheck disable=SC2086
ansible-test sanity --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
    --docker \
    "${options[@]}" --allow-disabled