Commit Graph

14 Commits

Author SHA1 Message Date
Sebastiaan van Stijn ba8f4c7994
docker-py: don't build --quiet is TESTDEBUG is set
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-16 14:34:52 +02:00
Sebastiaan van Stijn 7bfe48cc00
Bump docker-py to 4.0.2, and run tests from upstream repository
This removes all the installation steps for docker-py from the
Dockerfile, and instead builds the upstream Dockerfile, and runs
docker-py tests in a container.

To test;

```
make test-docker-py

...

Removing bundles/

---> Making bundle: dynbinary (in bundles/dynbinary)
Building: bundles/dynbinary-daemon/dockerd-dev
Created binary: bundles/dynbinary-daemon/dockerd-dev

---> Making bundle: test-docker-py (in bundles/test-docker-py)
---> Making bundle: .integration-daemon-start (in bundles/test-docker-py)
Using test binary docker
Starting dockerd
INFO: Waiting for daemon to start...
.
INFO: Building docker-sdk-python3:3.7.0...
sha256:686428ae28479e9b5c8fdad1cadc9b7a39b462e66bd13a7e35bd79c6a152a402
INFO: Starting docker-py tests...
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-4.1.0, py-1.8.0, pluggy-0.9.0
rootdir: /src, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
collected 359 items

tests/integration/api_build_test.py .......s....
....
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-16 14:34:46 +02:00
Sebastiaan van Stijn c3650770cc
Revert "Bash scripts; use double brackets, fix bare variables, add quotes"
This reverts commit 297b30df5f.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 02:23:38 +01:00
Sebastiaan van Stijn 297b30df5f
Bash scripts; use double brackets, fix bare variables, add quotes
These scripts explicitly use Bash, so we should be able to use
`[[` instead of `[` (which seems to be recommended).

Also added curly brackets to some bare variables, and quoted some paths.

This makes my IDE a bit more silent :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-24 00:05:14 +01:00
Tianon Gravi 52379fa76d Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-02-13 11:01:54 -08:00
Michael Crosby a9e513867c Output docker-py test results in xunit format
This adds a `results.xml` to the test-docker-py output folder.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-31 09:35:49 -07:00
Daniel Nephin 1d945a9743 Support interactive integration testing.
Interactive integration testing is useful when you're developing new tests, or
making changes to cli code.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-05 12:07:28 -04:00
Tibor Vass 8db141049f docker-py: upgrade and fix test script
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-28 12:56:50 -04:00
Phil Estes 65fb04228e Update docker-py to current master (~docker-py 1.3.1)
The docker-py commit used in the standard `Dockerfile` is from Feb. 2015
and is out of date with the current API level and has fixes for things
like the new docker cli config location and registry v2 changes/API
responses as well.

Also pass "NOT_ON_HOST=true" to docker-py test suite so that tests
relying on direct HOST interaction (versus running in a container) are
skipped.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-07-22 13:17:59 -04:00
Jörg Thalheim 2b4facdf2e hack: explicit bundles for integration-cli prequisites
no longer load hide critical code such as in .integration-daemon-{start,stop},
if this step failed, it will had logged the corresponding module before:

---> Making bundle: .integration-daemon-start (in bundles/1.7.0-dev/daemon-start)

which is nicer to debug.

This will make it also easier to execute a single tests in an interactive shell.

$ make shell
docker> . hack/make.sh binary .integration-daemon-start .integration-daemon-setup
docker> docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED STATUS              PORTS               NAMES
docker> go test github.com/docker/docker/integration-cli

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-06-09 07:22:26 +02:00
Tianon Gravi ac3388367b Make "DEST" a make.sh construct instead of ad-hoc
Using "DEST" for our build artifacts inside individual bundlescripts was already well-established convention, but this officializes it by having `make.sh` itself set the variable and create the directory, also handling CYGWIN oddities in a single central place (instead of letting them spread outward from `hack/make/binary` like was definitely on their roadmap, whether they knew it or not; sneaky oddities).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-30 11:16:43 -07:00
Tianon Gravi 929af4c38d Fix daemon start/stop logic in hack/make/* scripts
From the Bash manual's `set -e` description:
(https://www.gnu.org/software/bash/manual/bashref.html#index-set)

> Exit immediately if a pipeline (see Pipelines), which may consist of a
> single simple command (see Simple Commands), a list (see Lists), or a
> compound command (see Compound Commands) returns a non-zero status.
> The shell does not exit if the command that fails is part of the
> command list immediately following a while or until keyword, part of
> the test in an if statement, part of any command executed in a && or
> || list except the command following the final && or ||, any command
> in a pipeline but the last, or if the command’s return status is being
> inverted with !. If a compound command other than a subshell returns a
> non-zero status because a command failed while -e was being ignored,
> the shell does not exit.

Additionally, further down:

> If a compound command or shell function executes in a context where -e
> is being ignored, none of the commands executed within the compound
> command or function body will be affected by the -e setting, even if
> -e is set and a command returns a failure status. If a compound
> command or shell function sets -e while executing in a context where
> -e is ignored, that setting will not have any effect until the
> compound command or the command containing the function call
> completes.

Thus, the only way to have our `.integration-daemon-stop` script
actually run appropriately to clean up our daemon on test/script failure
is to use `trap ... EXIT`, which we traditionally avoid because it does
not have any stacking capabilities, but in this case is a reasonable
compromise because it's going to be the only script using it (for now,
at least; we can evaluate more complex solutions in the future if they
actually become necessary).

The alternatives were much less reasonable.  One is to have the entire
complex chains in any script wanting to use `.integration-daemon-start`
/ `.integration-daemon-stop` be chained together with `&&` in an `if`
block, which is untenable.  The other I could think of was taking the
body of these scripts out into separate scripts, essentially meaning
we'd need two files for each of these, which further complicates the
maintenance.

Add to that the fact that our `trap ... EXIT` is scoped to the enclosing
subshell (`( ... )`) and we're in even more reasonable territory with
this pattern.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-04-23 11:31:16 -06:00
Jörg Thalheim 6533cb973f hack/make/test-integration-cli: introduce MAKEDIR variable
- every execution of dirname costs time
- less repeating

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
2015-04-15 10:44:14 +02:00
Tianon Gravi 949a21b55f Move scripts back to hack/, leave docs in project/
This also removes the now-defunct `*maintainer*.sh` scripts that don't work with the new TOML format, and moves a couple not-build-or-release-related scripts to `contrib/` instead.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-03-13 14:04:08 -06:00