diff options
author | Matt Clay <matt@mystile.com> | 2016-09-22 22:28:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-22 22:28:55 -0700 |
commit | 50b0d011fe2962e5999f25f329a73ec32ca7e0ed (patch) | |
tree | 9e2c82ec191dd08e72a876010ac12f04d52bf559 | |
parent | f82c693181d8b7a7cb82eb60968778167a9c1b1d (diff) | |
download | ansible-50b0d011fe2962e5999f25f329a73ec32ca7e0ed.tar.gz |
Update integration.sh to copy source by default. (#17717)
Also add more documentation to the script.
-rwxr-xr-x | test/utils/shippable/integration.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/utils/shippable/integration.sh b/test/utils/shippable/integration.sh index e5e494dc72..9c2031f157 100755 --- a/test/utils/shippable/integration.sh +++ b/test/utils/shippable/integration.sh @@ -11,8 +11,17 @@ test_python3="${PYTHON3:-}" http_image="${HTTP_IMAGE:-ansible/ansible:httptester}" +# Keep the docker containers after tests complete. +# The default behavior is to always remove the containers. +# Set to "onfailure" to keep the containers only on test failure. +# Any other non-empty value will always keep the containers. keep_containers="${KEEP_CONTAINERS:-}" -copy_source="${COPY_SOURCE:-}" + +# Run the tests directly from the source directory shared with the container. +# The default behavior is to run the tests on a copy of the source. +# Copying the source isolates changes to the source between host and container. +# Set to any non-empty value to share the source. +share_source="${SHARE_SOURCE:-}" # Force ansible color output by default. # To disable color force mode use FORCE_COLOR=0 @@ -21,12 +30,13 @@ force_color="${FORCE_COLOR:-1}" if [ "${SHIPPABLE_BUILD_DIR:-}" ]; then host_shared_dir="/home/shippable/cache/build-${BUILD_NUMBER}" controller_shared_dir="/home/shippable/cache/build-${BUILD_NUMBER}" + share_source=1 else host_shared_dir="${source_root}" controller_shared_dir="" fi -if [ "${copy_source}" ]; then +if [ -z "${share_source}" ]; then test_shared_dir="/shared" else test_shared_dir="${test_ansible_dir}" @@ -99,7 +109,7 @@ if [ "${test_python3}" ]; then test_flags="--skip-tags ${skip_tags} ${test_flags}" fi -if [ "${copy_source}" ]; then +if [ -z "${share_source}" ]; then docker exec "${container_id}" cp -a "${test_shared_dir}" "${test_ansible_dir}" fi |