diff options
author | Daniel Nephin <dnephin@docker.com> | 2016-01-15 16:35:26 -0500 |
---|---|---|
committer | Daniel Nephin <dnephin@docker.com> | 2016-02-24 16:24:13 -0800 |
commit | 11dc7207520be98f70ac38e000c8a90975908e39 (patch) | |
tree | f208c85ceaf362df5decbb50471d036c937fc3bb | |
parent | ec6bb1660dde7e6700e894edb2235bdcf08a3a35 (diff) |
Move test scripts to script/test.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
-rw-r--r-- | CONTRIBUTING.md | 14 | ||||
-rw-r--r-- | project/RELEASE-PROCESS.md | 2 | ||||
-rwxr-xr-x | script/build/image | 2 | ||||
-rwxr-xr-x | script/build/linux-entrypoint | 2 | ||||
-rwxr-xr-x | script/build/osx | 2 | ||||
-rwxr-xr-x | script/build/write-git-sha (renamed from script/write-git-sha) | 0 | ||||
-rwxr-xr-x | script/ci | 25 | ||||
-rwxr-xr-x | script/release/build-binaries | 2 | ||||
-rwxr-xr-x | script/release/push-release | 2 | ||||
-rwxr-xr-x | script/setup/osx (renamed from script/prepare-osx) | 0 | ||||
-rwxr-xr-x | script/test/all (renamed from script/test-versions) | 2 | ||||
-rwxr-xr-x | script/test/ci | 25 | ||||
-rwxr-xr-x | script/test/default (renamed from script/test-default) | 2 | ||||
-rwxr-xr-x | script/test/versions.py (renamed from script/versions.py) | 0 | ||||
-rwxr-xr-x | script/travis/build-binary | 2 |
15 files changed, 47 insertions, 35 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66224752..50e58ddc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,22 +50,22 @@ See Docker's [basic contribution workflow](https://docs.docker.com/opensource/wo Use the test script to run linting checks and then the full test suite against different Python interpreters: - $ script/test + $ script/test/default Tests are run against a Docker daemon inside a container, so that we can test against multiple Docker versions. By default they'll run against only the latest Docker version - set the `DOCKER_VERSIONS` environment variable to "all" to run against all supported versions: - $ DOCKER_VERSIONS=all script/test + $ DOCKER_VERSIONS=all script/test/default -Arguments to `script/test` are passed through to the `nosetests` executable, so +Arguments to `script/test/default` are passed through to the `tox` executable, so you can specify a test directory, file, module, class or method: - $ script/test tests/unit - $ script/test tests/unit/cli_test.py - $ script/test tests/unit/config_test.py::ConfigTest - $ script/test tests/unit/config_test.py::ConfigTest::test_load + $ script/test/default tests/unit + $ script/test/default tests/unit/cli_test.py + $ script/test/default tests/unit/config_test.py::ConfigTest + $ script/test/default tests/unit/config_test.py::ConfigTest::test_load ## Finding things to work on diff --git a/project/RELEASE-PROCESS.md b/project/RELEASE-PROCESS.md index 4b78a9ba..de94aae8 100644 --- a/project/RELEASE-PROCESS.md +++ b/project/RELEASE-PROCESS.md @@ -57,7 +57,7 @@ When prompted build the non-linux binaries and test them. 1. Build the Mac binary in a Mountain Lion VM: - script/prepare-osx + script/setup/osx script/build/osx 2. Download the windows binary from AppVeyor diff --git a/script/build/image b/script/build/image index 89733505..bdd98f03 100755 --- a/script/build/image +++ b/script/build/image @@ -10,7 +10,7 @@ fi TAG=$1 VERSION="$(python setup.py --version)" -./script/write-git-sha +./script/build/write-git-sha python setup.py sdist cp dist/docker-compose-$VERSION.tar.gz dist/docker-compose-release.tar.gz docker build -t docker/compose:$TAG -f Dockerfile.run . diff --git a/script/build/linux-entrypoint b/script/build/linux-entrypoint index 9bf7c95d..bf515060 100755 --- a/script/build/linux-entrypoint +++ b/script/build/linux-entrypoint @@ -9,7 +9,7 @@ mkdir -p `pwd`/dist chmod 777 `pwd`/dist $VENV/bin/pip install -q -r requirements-build.txt -./script/write-git-sha +./script/build/write-git-sha su -c "$VENV/bin/pyinstaller docker-compose.spec" user mv dist/docker-compose $TARGET $TARGET version diff --git a/script/build/osx b/script/build/osx index 168fd430..3de34576 100755 --- a/script/build/osx +++ b/script/build/osx @@ -9,7 +9,7 @@ virtualenv -p /usr/local/bin/python venv venv/bin/pip install -r requirements.txt venv/bin/pip install -r requirements-build.txt venv/bin/pip install --no-deps . -./script/write-git-sha +./script/build/write-git-sha venv/bin/pyinstaller docker-compose.spec mv dist/docker-compose dist/docker-compose-Darwin-x86_64 dist/docker-compose-Darwin-x86_64 version diff --git a/script/write-git-sha b/script/build/write-git-sha index d16743c6..d16743c6 100755 --- a/script/write-git-sha +++ b/script/build/write-git-sha @@ -1,21 +1,8 @@ #!/bin/bash -# This should be run inside a container built from the Dockerfile -# at the root of the repo: # -# $ TAG="docker-compose:$(git rev-parse --short HEAD)" -# $ docker build -t "$TAG" . -# $ docker run --rm --volume="/var/run/docker.sock:/var/run/docker.sock" --volume="$(pwd)/.git:/code/.git" -e "TAG=$TAG" --entrypoint="script/ci" "$TAG" - -set -ex - -docker version - -export DOCKER_VERSIONS=all -STORAGE_DRIVER=${STORAGE_DRIVER:-overlay} -export DOCKER_DAEMON_ARGS="--storage-driver=$STORAGE_DRIVER" - -GIT_VOLUME="--volumes-from=$(hostname)" -. script/test-versions - ->&2 echo "Building Linux binary" -. script/build/linux-entrypoint +# Backwards compatiblity for jenkins +# +# TODO: remove this script after all current PRs and jenkins are updated with +# the new script/test/ci change +set -e +exec script/test/ci diff --git a/script/release/build-binaries b/script/release/build-binaries index 3a57b89a..d076197c 100755 --- a/script/release/build-binaries +++ b/script/release/build-binaries @@ -24,7 +24,7 @@ REPO=docker/compose script/clean script/build/linux # TODO: build osx binary -# script/prepare-osx +# script/setup/osx # script/build/osx # TODO: build or fetch the windows binary echo "You need to build the osx/windows binaries, that step is not automated yet." diff --git a/script/release/push-release b/script/release/push-release index 7d9ec0a2..33d0d777 100755 --- a/script/release/push-release +++ b/script/release/push-release @@ -57,7 +57,7 @@ docker push docker/compose:$VERSION echo "Uploading sdist to pypi" pandoc -f markdown -t rst README.md -o README.rst sed -i -e 's/logo.png?raw=true/https:\/\/github.com\/docker\/compose\/raw\/master\/logo.png?raw=true/' README.rst -./script/write-git-sha +./script/build/write-git-sha python setup.py sdist if [ "$(command -v twine 2> /dev/null)" ]; then twine upload ./dist/docker-compose-${VERSION/-/}.tar.gz diff --git a/script/prepare-osx b/script/setup/osx index 10bbbecc..10bbbecc 100755 --- a/script/prepare-osx +++ b/script/setup/osx diff --git a/script/test-versions b/script/test/all index 14a3e6e4..08bf1618 100755 --- a/script/test-versions +++ b/script/test/all @@ -14,7 +14,7 @@ docker run --rm \ get_versions="docker run --rm --entrypoint=/code/.tox/py27/bin/python $TAG - /code/script/versions.py docker/docker" + /code/script/test/versions.py docker/docker" if [ "$DOCKER_VERSIONS" == "" ]; then DOCKER_VERSIONS="$($get_versions default)" diff --git a/script/test/ci b/script/test/ci new file mode 100755 index 00000000..c5927b2c --- /dev/null +++ b/script/test/ci @@ -0,0 +1,25 @@ +#!/bin/bash +# This should be run inside a container built from the Dockerfile +# at the root of the repo: +# +# $ TAG="docker-compose:$(git rev-parse --short HEAD)" +# $ docker build -t "$TAG" . +# $ docker run --rm \ +# --volume="/var/run/docker.sock:/var/run/docker.sock" \ +# --volume="$(pwd)/.git:/code/.git" \ +# -e "TAG=$TAG" \ +# --entrypoint="script/test/ci" "$TAG" + +set -ex + +docker version + +export DOCKER_VERSIONS=all +STORAGE_DRIVER=${STORAGE_DRIVER:-overlay} +export DOCKER_DAEMON_ARGS="--storage-driver=$STORAGE_DRIVER" + +GIT_VOLUME="--volumes-from=$(hostname)" +. script/test/all + +>&2 echo "Building Linux binary" +. script/build/linux-entrypoint diff --git a/script/test-default b/script/test/default index bdb3579b..fa741a19 100755 --- a/script/test-default +++ b/script/test/default @@ -12,4 +12,4 @@ mkdir -p coverage-html docker build -t "$TAG" . GIT_VOLUME="--volume=$(pwd)/.git:/code/.git" -. script/test-versions +. script/test/all diff --git a/script/versions.py b/script/test/versions.py index 98f97ef3..98f97ef3 100755 --- a/script/versions.py +++ b/script/test/versions.py diff --git a/script/travis/build-binary b/script/travis/build-binary index 065244bf..7707a1ee 100755 --- a/script/travis/build-binary +++ b/script/travis/build-binary @@ -8,6 +8,6 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then # script/build/image master # docker push docker/compose:master else - script/prepare-osx + script/setup/osx script/build/osx fi |