nix/ci
Paul Osborne 90269e4d12 ci: fix docker container check
Newer version of docker no longer have the /.dockerinit file present
when the container is executing, so that is no longer an option.
When executing in a container, we do know that we will be executing
as pid 1 -- this is probably not ever the case on the host system.

Signed-off-by: Paul Osborne <osbpau@gmail.com>
2016-08-10 19:30:12 -05:00
..
cargo-config testing: use default linker for appropriate platforms 2016-03-14 12:54:08 -05:00
README.md testing: update documentation related to testing 2016-03-14 13:03:51 -05:00
run-all.sh testing: use posborne/rust-cross:x86 for x86_64/i686 2016-03-21 23:16:03 -05:00
run-docker.sh testing: move to new posborne/rust-cross images 2016-03-13 15:04:46 -05:00
run-travis.sh ci: push docs to gh-pages and code cov to coveralls 2016-07-10 01:26:55 -05:00
run.sh ci: fix docker container check 2016-08-10 19:30:12 -05:00

Test Infrastructure

The ci directory contains scripts that aid in the testing of nix both in our continuous integration environment (Travis CI) but also for developers working locally.

Nix interfaces very directly with the underlying platform (usually via libc) and changes need to be tested on a large number of platforms to avoid problems.

Running Tests For Host Architecture

Running the tests for one's host architecture can be done by simply doing the following:

$ cargo test

Running Tests Against All Architectures/Versions

Testing for other architectures is more involved. Currently, developers may run tests against several architectures and versions of rust by running the ci/run-all.sh script. This scripts requires that docker be set up. This will take some time:

$ ci/run-all.sh

The list of versions and architectures tested by this can be determined by looking at the contents of the script. The docker image used is posborne/rust-cross.

Running Test for Specific Architectures/Versions

Suppose we have a failing test with Rust 1.7 on the raspberry pi. In that case, we can run the following:

$ DOCKER_IMAGE=posborne/rust-cross:arm \
      RUST_VERSION=1.7.0 \
      RUST_TARGET=arm-unknown-linux-gnueabihf ci/run-docker.sh

Currently, the docker images only support Rust 1.7. To get a better idea of combinations that might work, look at the contents of the travis configuration or run-all.sh.