1 ## Running tests inside Docker containers
5 - [Docker 101](docker/docker-101.md)
6 - [Docker resources](docker/resources.md)
7 - [Unit tests](Unit-tests.md)
11 Test Dockerfiles are located under `tests/docker/<distribution>/Dockerfile`,
12 and can be used to build Docker images to run Shaarli test suites under common
15 Dockerfiles are provided for the following environments:
17 - `alpine36` - [Alpine 3.6](https://www.alpinelinux.org/downloads/)
18 - `debian8` - [Debian 8 Jessie](https://www.debian.org/DebianJessie) (oldstable)
19 - `debian9` - [Debian 9 Stretch](https://wiki.debian.org/DebianStretch) (stable)
20 - `ubuntu16` - [Ubuntu 16.04 Xenial Xerus](http://releases.ubuntu.com/16.04/) (LTS)
22 What's behind the curtains:
24 - each image provides:
26 - Shaarli PHP dependencies (OS packages)
27 - test PHP dependencies (OS packages)
29 - the local workspace is mapped to the container's `/shaarli/` directory,
30 - the files are rsync'd so tests are run using a standard Linux user account
31 (running tests as `root` would bypass permission checks and may hide issues)
32 - the tests are run inside the container.
34 ### Building test images
37 # build the Debian 9 Docker image
39 $ cd tests/docker/debian9
40 $ docker build -t shaarli-test:debian9 .
48 # install/update 3rd-party test dependencies
49 $ composer install --prefer-dist
51 # run tests using the freshly built image
52 $ docker run -v $PWD:/shaarli shaarli-test:debian9 docker_test
54 # run the full test campaign
55 $ docker run -v $PWD:/shaarli shaarli-test:debian9 docker_all_tests