Loci

Testing remote CI scripts locally



Loci: Testing remote CI scripts locally

MIT License Build Status wercker status Release Japanese

Loci runs CI tests locally to make sure your commits will pass such tests before pushing to a remote repository.

Loci currently supports Travis CI’s scripts for Python and Go projects.

Loci also requires Docker to run tests in a sandbox.

Docker logo

Demo

Usage

If your current directory has .travis.yml, run just loci like

$ loci

If your .travis.yml specifies more than two runtime versions, Loci will run those tests palatally. If you want to run tests on a selected one runtime version, use --select/-s flag. For example, the following command runs tests on only Python 3.6:

$ loci -s 3.6

Here is the help text of the loci command:

loci [global options] [script file]

  If script file isn't given, .travis.yml will be used.

GLOBAL OPTIONS:
   --name NAME, -n NAME              base NAME of containers running tests. If not given, containers will be
                                     deleted.
   --select VERSION, -s VERSION      select specific runtime VERSION where tests running on.
   --tag TAG, -t TAG                 specify a TAG name of the docker image to be build.
   --max-processors value, -p value  max processors used to run tests.
   --log, -l                         store logging information to files.
   --base TAG, -b TAG                use image TAG as the base image. (default: "ubuntu:latest")
   --apt-proxy URL                   URL for a proxy server of apt repository. If environment variable
                                     APT_PROXY exists, that value will be used by default.
   --pypi-proxy URL                  URL for a proxy server of PyPI repository. If environment variable
                                     PYPI_PROXY exists, that value will be used by default.
   --http-proxy URL                  URL for a http proxy server. If environment variable HTTP_PROXY exists,
                                     that value will be used by default.
   --https-proxy URL                 URL for a https proxy server. If environment variable HTTPS_PROXY exists,
                                     that value will be used by default.
   --no-proxy LIST                   Comma separated URL LIST for which proxies won't be used. If environment
                                     variable NO_PROXY exists, that value will be used by default.
   --no-build-cache                  Do not use cache when building the image.
   --no-color                        Omit to print color codes.
   --help, -h                        show help
   --version, -v                     print the version

Loci builds docker images every time to run tests in a sandbox. The default image name will be the repository name of the project with prefix loci/, you can specify another name with --tag or -t flag.

Loci creates a container to run a set of tests, and then deletes it after the test set ends. If you want to keep the container, give a container name with --name or -n flag.

Installation

Loci works with docker. If your environment doesn’t have docker, install it first. The minimum required docker version is 1.12.0 (API version: 1.24).

If you’re a Homebrew or Linuxbrew user, you can install Loci by the following commands:

$ brew tap jkawamoto/loci
$ brew install loci

To build the newest version of Loci, use go get command:

$ go get github.com/jkawamoto/loci

Otherwise, compiled binaries are also available in Github.

License

This software is released under the MIT License, see LICENSE.