Skip to content

Commit 234f1b7

Browse files
committed
Update docs to explain how to run CircleCI tests locally
Replacing the docs for how to run Travis CI tests locally.
1 parent fde1da6 commit 234f1b7

File tree

4 files changed

+52
-100
lines changed

4 files changed

+52
-100
lines changed

Dockerfile

Lines changed: 0 additions & 34 deletions
This file was deleted.

doc/hacking_on_cider.md

Lines changed: 52 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -91,76 +91,70 @@ You can also check for compliance with a variety of coding standards in batch mo
9191
$ make lint
9292
```
9393

94-
#### Running the tests in Travis CI
94+
#### Running the tests in CircleCI
9595

96-
If you prefer to see the full Travis CI test suite run successfully, the easiest
96+
If you prefer to see the full CircleCI CI test suite run successfully, the easiest
9797
way to achieve that is to create your own personal account on
98-
https://travis-ci.org. View your profile details on the Travis CI site, and
99-
toggle the switch to enable builds on your fork of the cider project.
98+
https://circleci.com. Fork CIDER on GitHub, and then add your fork on CircleCI to
99+
start building. Every time you push code to a branch, CircleCI will build it.
100100

101-
Subsequent pushes to your fork will generate a Travis CI build you can monitor
101+
Subsequent pushes to your fork will generate a CircleCI build you can monitor
102102
for success or failure.
103103

104-
#### Simulating the Travis CI tests locally in Docker
104+
#### Simulating the Circle CI tests locally in Docker
105105

106-
If you prefer not to wait for Travis CI all the time, or if you need to debug
107-
something that fails in Travis CI but does not fail for you on your own machine,
108-
then you can also run the Travis CI tests manually in Docker.
106+
If you prefer not to wait for CircleCI all the time, or if you need to debug
107+
something that fails in CircleCI but does not fail for you on your own machine,
108+
then you can also run the CircleCI tests locally with the CircleCI CLI (that's
109+
a mouthful!).
109110

110-
You will need to run some scripts to build and launch the Docker image.
111+
To do this, first [install](https://circleci.com/docs/2.0/local-cli/#installation)
112+
the CircleCI CLI, and [Docker](https://docs.docker.com/install/).
111113

112-
To build:
114+
Currently the CircleCI CLI [doesn't support local builds with version 2.1](https://github.com/CircleCI-Public/circleci-cli/issues/79)
115+
of the CircleCI config, so for now we need to convert it to the 2.0 format.
116+
Make sure not to commit these changes to the `config.yml` file.
113117

114-
```
115-
$ docker/build.sh
116-
```
117-
118-
The build script uses a base image provided by the engineers at Travis CI.
119-
120-
*Note: The Travis docker image is currently more than 8GB, so be prepared with a
121-
good internet connection and time to spare.*
122-
123-
The resulting docker image is tagged simply `cider-travis`. You can run this
124-
image by hand, but there is a convenience script available:
125-
126-
```
127-
$ docker/run.sh
128-
```
129-
130-
This script launches a docker container and bind-mounts your cider project
131-
directory as `/home/travis/cider` such that you can instantly see any code
132-
changes reflected inside the docker environment.
133-
134-
For instance, first you can run tests on Emacs 25.3:
135-
136-
```
137-
(emacs-25.3-travis) ~/cider$ make test
138-
```
139-
140-
And then switch to Emacs 26.1 and test again:
141-
142-
```
143-
(emacs-25.3-travis) ~/cider$ evm use Emacs-26-pretest-travis
144-
(emacs-26.1-travis) ~/cider$ cask install
145-
(emacs-26.1-travis) ~/cider$ make test
146-
```
147-
148-
You can test byte compilation too
149-
150-
```
151-
(emacs-26.1-travis) ~/cider$ make test-bytecomp
118+
```shell
119+
$ circleci config process .circleci/config.yml > .circleci/config.yml.tmp && \
120+
mv .circleci/config.yml.tmp .circleci/config.yml
152121
```
153122

154-
When you are done working in docker, just `exit` the bash prompt, and the docker
155-
container will also exit. Note that `docker/run.sh` runs the container with
156-
`--rm`, meaning any changes to the docker container are discarded when the
157-
container exits.
123+
Now, we're finally ready to
124+
[run a CircleCI container on our machine](https://circleci.com/docs/2.0/local-cli/#run-a-job-in-a-container-on-your-machine).
125+
Run `circleci local execute --job=<job>` where `<job>` is one of those listed
126+
in `.circleci/config.yml`, e.g. `test-emacs-26`.
158127

159-
So for example, by default, the docker image pre-installs only the most recent
160-
releases of Emacs 25, Emacs 26, and a recent snapshot of the Emacs git
161-
repository. The `evm` tool is available should you need to install some other
162-
specific build. However additional versions of Emacs will be discarded when
163-
you exit the docker container.
128+
```shell
129+
$ circleci local execute --job=test-emacs-26
130+
Docker image digest: sha256:65b2102646d5658f892e0ad8253b7912c676126c857c87c8c12460f0aa4f5aa1
131+
====>> Spin up Environment
132+
Build-agent version 1.0.8563-43047892 (2019-03-06T15:11:54+0000)
133+
Starting container silex/emacs:26-dev
134+
image cache not found on this host, downloading silex/emacs:26-dev
135+
26-dev: Pulling from silex/emacs
136+
6cf436f81810: Already exists
137+
987088a85b96: Already exists
138+
e58f362a948a: Waiting
139+
...
140+
====>> make elpa
141+
#!/bin/bash -eo pipefail
142+
make elpa
143+
Compute dependencies
144+
cask install
145+
Loading package information... done
146+
Package operations: 10 installs, 0 removals
147+
...
148+
Indenting region...
149+
Indenting region...done
150+
* Run indent-character
151+
* Run trailing-whitespace
152+
** ELISP-LINT: cider-overlays.el OK
153+
Success!
154+
```
155+
156+
This may take a while to download the CircleCI build agent and the build containers
157+
the first time you run the tests locally.
164158

165159
## Hacking on cider-nrepl (Clojure)
166160

docker/build.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

docker/run.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)