test-versions 877 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # This should be run inside a container built from the Dockerfile
  3. # at the root of the repo - script/test will do it automatically.
  4. set -e
  5. >&2 echo "Running lint checks"
  6. flake8 compose tests setup.py
  7. if [ "$DOCKER_VERSIONS" == "" ]; then
  8. DOCKER_VERSIONS="default"
  9. elif [ "$DOCKER_VERSIONS" == "all" ]; then
  10. DOCKER_VERSIONS="$ALL_DOCKER_VERSIONS"
  11. fi
  12. for version in $DOCKER_VERSIONS; do
  13. >&2 echo "Running tests against Docker $version"
  14. docker run \
  15. --rm \
  16. --privileged \
  17. --volume="/var/lib/docker" \
  18. --volume="${COVERAGE_DIR:-$(pwd)/coverage-html}:/code/coverage-html" \
  19. -e "DOCKER_VERSION=$version" \
  20. -e "DOCKER_DAEMON_ARGS" \
  21. --entrypoint="script/dind" \
  22. "$TAG" \
  23. script/wrapdocker nosetests --with-coverage --cover-branches --cover-package=compose --cover-erase --cover-html-dir=coverage-html --cover-html "$@"
  24. done