Skip to content

Commit

Permalink
Divide Windows integration tests into 2 groups. (ansible#29029)
Browse files Browse the repository at this point in the history
* Divide Windows integration tests into 2 groups.
* Support `none` for `--changed-all-target`.
* Run 2 separate Windows groups on Shippable.
* Only run smoketest and minimal for the group1 job.
  • Loading branch information
mattclay authored Sep 5, 2017
1 parent 02a362e commit 8f4c884
Show file tree
Hide file tree
Showing 27 changed files with 46 additions and 27 deletions.
3 changes: 2 additions & 1 deletion shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ matrix:

- env: TEST=rhel/7.4

- env: TEST=windows
- env: TEST=windows/1
- env: TEST=windows/2

- env: TEST=network

Expand Down
2 changes: 1 addition & 1 deletion test/integration/targets/connection_winrm/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group3
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_async_wrapper/aliases
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
async_status
windows/ci/group3
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_chocolatey/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_command/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_dsc/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_environment/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_eventlog/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group1
2 changes: 1 addition & 1 deletion test/integration/targets/win_eventlog_entry/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_feature/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_file/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group2
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_firewall_rule/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_group/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group2
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_group_membership/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
1 change: 1 addition & 0 deletions test/integration/targets/win_module_utils/aliases
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_path/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group2
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_rabbitmq_plugin/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_region/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_say/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 1 addition & 1 deletion test/integration/targets/win_scheduled_task/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group1
2 changes: 1 addition & 1 deletion test/integration/targets/win_service/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group3
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_shell/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group3
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_template/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
windows/ci/group2
windows/ci/group1
windows/ci/smoketest
2 changes: 1 addition & 1 deletion test/integration/targets/win_timezone/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group1
2 changes: 1 addition & 1 deletion test/integration/targets/win_user/aliases
Original file line number Diff line number Diff line change
@@ -1 +1 @@
windows/ci/group3
windows/ci/group2
2 changes: 2 additions & 0 deletions test/runner/lib/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def categorize_changes(args, paths, verbose_command=None):
commands[command].add(target)

for command in commands:
commands[command].discard('none')

if any(t == 'all' for t in commands[command]):
commands[command] = set(['all'])

Expand Down
21 changes: 18 additions & 3 deletions test/utils/shippable/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

set -o pipefail

declare -a args
IFS='/:' read -ra args <<< "${TEST}"

target="windows/ci/group${args[1]}/"

# python versions to test in order
# python 2.7 runs full tests while other versions run minimal tests
python_versions=(
Expand All @@ -12,7 +17,7 @@ python_versions=(
)

# shellcheck disable=SC2086
ansible-test windows-integration --explain ${CHANGED:+"$CHANGED"} 2>&1 | { grep ' windows-integration: .* (targeted)$' || true; } > /tmp/windows.txt
ansible-test windows-integration "${target}" --explain ${CHANGED:+"$CHANGED"} 2>&1 | { grep ' windows-integration: .* (targeted)$' || true; } > /tmp/windows.txt

if [ -s /tmp/windows.txt ]; then
echo "Detected changes requiring integration tests specific to Windows:"
Expand Down Expand Up @@ -48,13 +53,23 @@ for version in "${python_versions[@]}"; do
if [ "${CHANGED}" ]; then
# with change detection enabled run tests for anything changed
# use the smoketest tests for any change that triggers all tests
ci="windows/ci/"
changed_all_target="windows/ci/smoketest/"
ci="${target}"
if [ "${target}" == "windows/ci/group1/" ]; then
# only run smoketest tests for group1
changed_all_target="windows/ci/smoketest/"
else
# smoketest tests already covered by group1
changed_all_target="none"
fi
else
# only run smoketest tests for group1
if [ "${target}" != "windows/ci/group1/" ]; then continue; fi
# without change detection enabled run only smoketest tests
ci="windows/ci/smoketest/"
fi
else
# only run minimal tests for group1
if [ "${target}" != "windows/ci/group1/" ]; then continue; fi
# minimal tests for other python versions
ci="windows/ci/minimal/"
fi
Expand Down

0 comments on commit 8f4c884

Please sign in to comment.