distribution/contrib/docker-integration
Sebastiaan van Stijn 1d33874951
go.mod: change imports to github.com/distribution/distribution/v3
Go 1.13 and up enforce import paths to be versioned if a project
contains a go.mod and has released v2 or up.

The current v2.x branches (and releases) do not yet have a go.mod,
and therefore are still allowed to be imported with a non-versioned
import path (go modules add a `+incompatible` annotation in that case).

However, now that this project has a `go.mod` file, incompatible
import paths will not be accepted by go modules, and attempting
to use code from this repository will fail.

This patch uses `v3` for the import-paths (not `v2`), because changing
import paths itself is a breaking change, which means that  the
next release should increment the "major" version to comply with
SemVer (as go modules dictate).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-02-08 18:30:46 +01:00
..
malevolent-certs Update certificates 2018-05-21 16:00:52 -07:00
nginx Update certificates 2018-05-21 16:00:52 -07:00
tokenserver disable schema1 by default, add a config flag to enable it 2017-12-19 10:23:25 -08:00
tokenserver-oauth disable schema1 by default, add a config flag to enable it 2017-12-19 10:23:25 -08:00
docker-compose.yml Add plugin push/pull tests 2017-01-09 16:44:37 -08:00
Dockerfile go.mod: change imports to github.com/distribution/distribution/v3 2021-02-08 18:30:46 +01:00
golem.conf Add plugin push/pull tests 2017-01-09 16:44:37 -08:00
helpers.bash Update login helpers to handle email removal 2017-01-09 16:44:36 -08:00
install_certs.sh Add v1 search with v2 token auth test 2016-07-13 17:03:14 -07:00
malevolent.bats Support docker 1.12 2016-11-23 13:33:19 -08:00
plugins.bats Remove container after export 2017-01-09 16:44:37 -08:00
README.md go.mod: change imports to github.com/distribution/distribution/v3 2021-02-08 18:30:46 +01:00
run_multiversion.sh Add test for 1.13 2017-01-09 16:44:37 -08:00
tls.bats Update login helpers to handle email removal 2017-01-09 16:44:36 -08:00
token.bats Update login helpers to handle email removal 2017-01-09 16:44:36 -08:00

Docker Registry Integration Testing

These integration tests cover interactions between registry clients such as the docker daemon and the registry server. All tests can be run using the golem integration test runner

The integration tests configure components using docker compose (see docker-compose.yaml) and the runner can be using the golem configuration file (see golem.conf).

Running integration tests

Run using multiversion script

The integration tests in the contrib/docker-integration directory can be simply run by executing the run script ./run_multiversion.sh. If there is no running daemon to connect to, run as ./run_multiversion.sh -d.

This command will build the distribution image from the locally checked out version and run against multiple versions of docker defined in the script. To run a specific version of the registry or docker, Golem will need to be executed manually.

Run manually using Golem

Using the golem tool directly allows running against multiple versions of the registry and docker. Running against multiple versions of the registry can be useful for testing changes in the docker daemon which are not covered by the default run script.

Installing Golem

Golem is distributed as an executable binary which can be installed from the release page.

Running golem with docker

Additionally golem can be run as a docker image requiring no additional installation.

docker run --privileged -v "$GOPATH/src/github.com/distribution/distribution/contrib/docker-integration:/test" -w /test distribution/golem golem -rundaemon .

Golem custom images

Golem tests version of software by defining the docker image to test.

Run with registry 2.2.1 and docker 1.10.3

golem -i golem-dind:latest,docker:1.10.3-dind,1.10.3 -i golem-distribution:latest,registry:2.2.1 .

Use golem caching for developing tests

Golem allows caching image configuration to reduce test start up time. Using this cache will allow tests with the same set of images to start up quickly. This can be useful when developing tests and needing the test to run quickly. If there are changes which effect the image (such as building a new registry image), then startup time will be slower.

Run this command multiple times and after the first time test runs should start much quicker. golem -cache ~/.cache/docker/golem -i golem-dind:latest,docker:1.10.3-dind,1.10.3 -i golem-distribution:latest,registry:2.2.1 .