-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
44 lines (40 loc) · 1.59 KB
/
test.sh
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
42
43
44
#!/usr/bin/env bash
COLLECTION_NAMESPACE=joezollo
COLLECTION_NAME=windows-server
COLLECTION_BASE_PATH=~/.ansible
COLLECTION_PATH=$COLLECTION_BASE_PATH/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
MODULE_NAME=$1
TEST_TYPE=$2
rm -rf $COLLECTION_PATH
mkdir -p $COLLECTION_PATH
cp -r * $COLLECTION_PATH
cd $COLLECTION_PATH
# run validate-modules
if [ $TEST_TYPE == 'module' ]; then
echo "Running Module Tests"
echo "Testing Module: $MODULE_NAME"
ansible-test sanity --color -v \
--docker default \
--base-branch "master" plugins/modules/${MODULE_NAME}.ps1 plugins/modules/${MODULE_NAME}.py
fi
if [ $TEST_TYPE == 'sanity' ]; then
echo "Running All Tests"
ansible-test sanity --color -v --docker default --base-branch "master" --changed
fi
if [ $TEST_TYPE == 'windows-integration' ]; then
echo "Running Windows Integration Tests"
version="2019"
provider="aws"
target=""
COVERAGE="-coverage-check"
CHANGED="--changed"
UNSTABLE="--allow-unstable-changed"
ansible-test windows-integration --color -v --retry-on-error "${target}" \
${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
--windows "${version}" --docker default --remote-terminate always --remote-stage "${stage}" \
--remote-provider "${provider}"
ansible-test windows-integration --color -v --retry-on-error shippable/windows/group2/ \
--coverage-check --changed --allow-unstable-changed --windows "${version}" --docker default \
--remote-terminate always --remote-stage "${stage}" \
--remote-provider default
fi