We are using a Docker image to perform visual regression testing, so that we get consistent results regardless of the host-OS that is running the test.
Follow the instructions to install Docker for Mac
docker pull uglow/backstopjs
Make sure you allocate enough memory (more than 2GB) to Docker. You can change this in your Docker Preferences (in OSX).
See CONTRIBUTING.md.
The base commands in package.json
are listed below:
# On OSX:
docker run --rm -v $PWD:/src/ -it --add-host dockerhost:`ipconfig getifaddr en0` uglow/backstopjs test --config=config/testVisualRegression/backstop.ci.config.js
# ON Linux:
docker run --rm -v $PWD:/src/ -it --add-host dockerhost:`/sbin/ip route|awk '/default/ { print $3}'` uglow/backstopjs test --config=config/testVisualRegression/backstop.ci.config.js
The reason for two different commands is that there are OS-specific ways to get the HOST IP address and pass it to the container.
docker run --rm -v $PWD:/src/ -it --entrypoint=/bin/bash uglow/backstopjs
You would only ever need to rebuild the image if you are changing it. Once you change it you also need to publish it.
- Open a terminal and navigate into the
config/docker
directory - Edit
Dockerfile
as required - Run
docker build
Hopefully one day there will be a local AusPost repo. Until then, you will need your own Docker account to publish to the global registry.
- Create a Docker account on https://hub.docker.com/
- Run
docker login
locally, and enter your Docker credentials - Run
docker image push <image>:latest