diff options
Diffstat (limited to 'test/integration/targets/roles_arg_spec/runme.sh')
-rwxr-xr-x | test/integration/targets/roles_arg_spec/runme.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/integration/targets/roles_arg_spec/runme.sh b/test/integration/targets/roles_arg_spec/runme.sh new file mode 100755 index 0000000..209a34e --- /dev/null +++ b/test/integration/targets/roles_arg_spec/runme.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -eux + +# This effectively disables junit callback output by directing the output to +# a directory ansible-test will not look at. +# +# Since the failures in these tests are on the role arg spec validation and the +# name for those tasks is fixed (we cannot add "EXPECTED FAILURE" to the name), +# disabling the junit callback output is the easiest way to prevent these from +# showing up in test run output. +# +# Longer term, an option can be added to the junit callback allowing a custom +# regexp to be supplied rather than the hard coded "EXPECTED FAILURE". +export JUNIT_OUTPUT_DIR="${OUTPUT_DIR}" + +# Various simple role scenarios +ansible-playbook test.yml -i ../../inventory "$@" + +# More complex role test +ansible-playbook test_complex_role_fails.yml -i ../../inventory "$@" + +# Test play level role will fail +set +e +ansible-playbook test_play_level_role_fails.yml -i ../../inventory "$@" +test $? -ne 0 +set -e + +# Test the validation task is tagged with 'always' by specifying an unused tag. +# The task is tagged with 'foo' but we use 'bar' in the call below and expect +# the validation task to run anyway since it is tagged 'always'. +ansible-playbook test_tags.yml -i ../../inventory "$@" --tags bar | grep "a : Validating arguments against arg spec 'main' - Main entry point for role A." |