Confirmed users
4,293
edits
(Rework hacking section) |
|||
| Line 283: | Line 283: | ||
git submodule init | git submodule init | ||
git submodule update | git submodule update | ||
== Docker == | |||
You can run a complete Balrog environment locally with Docker, configured very similarly to production. You'll need Docker and Docker Compose installed; on Mac or Windows we require Docker for Mac/Docker for Windows v1.12 or higher. Then run the following in the root of the Balrog repo: | |||
docker-compose up | |||
Once it completes, you should be able to access | |||
* the admin interface at [http://127.0.0.1:8080 http://127.0.0.1:8080] | |||
* the public interface on port 9090, for example [http://127.0.0.1:9090/update/3/Firefox/33.0/20141202185629/Darwin_x86_64-gcc3-u-i386-x86_64/en-US/release/default/default/default/update.xml?force=1 http://127.0.0.1:9090/update/3/Firefox/33.0/20141202185629/Darwin_x86_64-gcc3-u-i386-x86_64/en-US/release/default/default/default/update.xml?force=1] | |||
== UI hacking == | |||
If you want to hack on the UI, you'll also need to install some npm modules: | If you want to hack on the UI, you'll also need to install some npm modules: | ||
| Line 290: | Line 300: | ||
cd .. | cd .. | ||
To make code changes visible to docker you need to run: | |||
cd ui | cd ui | ||
lineman build | lineman build | ||
lineman build minifies the js & css, which can make debugging more difficult, but you can use the ''run'' mode of lineman instead. First make sure docker-compose is up, then | |||
cd ui | |||
lineman run | |||
The UI will be available at [http://127.0.0.1:8000 http://127.0.0.1:8000]. lineman will watch for changes to the source so you need only refresh the browser after saving your work. | |||
== Unit Tests == | == Unit Tests == | ||
| Line 309: | Line 313: | ||
The recommended way to run backend tests is through Docker. Doing so will ensure your tests will run the same way they do in CI. To run them, use this command in the root of your Balrog repository: | The recommended way to run backend tests is through Docker. Doing so will ensure your tests will run the same way they do in CI. To run them, use this command in the root of your Balrog repository: | ||
./run-tests.sh | ./run-tests.sh | ||
If you can't or don't want to run tests within Docker for some reason, you can run them with directly with: | If you can't or don't want to run tests within Docker for some reason, you can run them with directly with: | ||
tox | tox | ||
Tests | Tests run fine on any posix-like environment, but are only run regularly within the Docker image, so it's possible to have failures that aren't related to Balrog code or your changes when running directly with tox. | ||
=== Frontend === | === Frontend === | ||
To run the unit tests use: | To run the unit tests use: | ||
cd ui | |||
lineman spec-ci | lineman spec-ci | ||
More options can be found in [https://github.com/mozbhearsum/balrog-ui/blob/master/README.md ui/README.md] | |||
= Getting Involved = | = Getting Involved = | ||